Skip to content

Commit fe8f346

Browse files
committed
Added rm test for read-only files
1 parent 8941d28 commit fe8f346

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/elixir/test/elixir/file_test.exs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,15 @@ defmodule FileTest do
688688
assert File.rm(fixture) == :ok
689689
refute File.exists?(fixture)
690690
end
691+
692+
test :rm_read_only_file do
693+
fixture = tmp_path("tmp_test.txt")
694+
File.write(fixture, "test")
695+
assert File.exists?(fixture)
696+
File.chmod(fixture, 0100444)
697+
assert File.rm(fixture) == :ok
698+
refute File.exists?(fixture)
699+
end
691700

692701
test :rm_file_with_dir do
693702
assert File.rm(fixture_path) == {:error, :eperm}

0 commit comments

Comments
 (0)