-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
235 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,4 @@ jobs: | |
|
||
- run: mix compile --warnings-as-errors | ||
|
||
- run: mix test | ||
- run: mix test --only os_macos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
defmodule FileSystem.Backends.FSInotifyLinuxTest do | ||
use ExUnit.Case, async: true | ||
import FileSystem.Backends.FSInotify | ||
|
||
@moduletag os_inux: true | ||
|
||
describe "options parse test" do | ||
test "supported options" do | ||
assert {:ok, | ||
[ | ||
~c"-e", | ||
~c"modify", | ||
~c"-e", | ||
~c"close_write", | ||
~c"-e", | ||
~c"moved_to", | ||
~c"-e", | ||
~c"moved_from", | ||
~c"-e", | ||
~c"create", | ||
~c"-e", | ||
~c"delete", | ||
~c"-e", | ||
~c"attrib", | ||
~c"--format", | ||
[37, 119, 1, 37, 101, 1, 37, 102], | ||
~c"--quiet", | ||
~c"-m", | ||
~c"-r", | ||
~c"/tmp" | ||
]} == | ||
parse_options(dirs: ["/tmp"], recursive: true) | ||
|
||
assert {:ok, | ||
[ | ||
~c"-e", | ||
~c"modify", | ||
~c"-e", | ||
~c"close_write", | ||
~c"-e", | ||
~c"moved_to", | ||
~c"-e", | ||
~c"moved_from", | ||
~c"-e", | ||
~c"create", | ||
~c"-e", | ||
~c"delete", | ||
~c"-e", | ||
~c"attrib", | ||
~c"--format", | ||
[37, 119, 1, 37, 101, 1, 37, 102], | ||
~c"--quiet", | ||
~c"-m", | ||
~c"/tmp" | ||
]} == | ||
parse_options(dirs: ["/tmp"], recursive: false) | ||
end | ||
|
||
test "ignore unsupported options" do | ||
assert {:ok, | ||
[ | ||
~c"-e", | ||
~c"modify", | ||
~c"-e", | ||
~c"close_write", | ||
~c"-e", | ||
~c"moved_to", | ||
~c"-e", | ||
~c"moved_from", | ||
~c"-e", | ||
~c"create", | ||
~c"-e", | ||
~c"delete", | ||
~c"-e", | ||
~c"attrib", | ||
~c"--format", | ||
[37, 119, 1, 37, 101, 1, 37, 102], | ||
~c"--quiet", | ||
~c"-m", | ||
~c"/tmp" | ||
]} == | ||
parse_options(dirs: ["/tmp"], recursive: false, unsupported: :options) | ||
|
||
assert {:ok, | ||
[ | ||
~c"-e", | ||
~c"modify", | ||
~c"-e", | ||
~c"close_write", | ||
~c"-e", | ||
~c"moved_to", | ||
~c"-e", | ||
~c"moved_from", | ||
~c"-e", | ||
~c"create", | ||
~c"-e", | ||
~c"delete", | ||
~c"-e", | ||
~c"attrib", | ||
~c"--format", | ||
[37, 119, 1, 37, 101, 1, 37, 102], | ||
~c"--quiet", | ||
~c"-m", | ||
~c"-r", | ||
~c"/tmp" | ||
]} == | ||
parse_options(dirs: ["/tmp"], recursive: :unknown_value) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
defmodule FileSystem.Backends.FSInotifyWindowsTest do | ||
use ExUnit.Case, async: true | ||
import FileSystem.Backends.FSInotify | ||
|
||
@moduletag os_windows: true | ||
|
||
describe "options parse test" do | ||
test "supported options" do | ||
assert {:ok, | ||
[ | ||
~c"-e", | ||
~c"modify", | ||
~c"-e", | ||
~c"close_write", | ||
~c"-e", | ||
~c"moved_to", | ||
~c"-e", | ||
~c"moved_from", | ||
~c"-e", | ||
~c"create", | ||
~c"-e", | ||
~c"delete", | ||
~c"-e", | ||
~c"attrib", | ||
~c"--format", | ||
[37, 119, 1, 37, 101, 1, 37, 102], | ||
~c"--quiet", | ||
~c"-m", | ||
~c"-r", | ||
tmp_dir | ||
]} = parse_options(dirs: ["/tmp"], recursive: true) | ||
|
||
assert tmp_dir |> to_string() |> String.ends_with?("/tmp") | ||
|
||
assert {:ok, | ||
[ | ||
~c"-e", | ||
~c"modify", | ||
~c"-e", | ||
~c"close_write", | ||
~c"-e", | ||
~c"moved_to", | ||
~c"-e", | ||
~c"moved_from", | ||
~c"-e", | ||
~c"create", | ||
~c"-e", | ||
~c"delete", | ||
~c"-e", | ||
~c"attrib", | ||
~c"--format", | ||
[37, 119, 1, 37, 101, 1, 37, 102], | ||
~c"--quiet", | ||
~c"-m", | ||
tmp_dir | ||
]} = parse_options(dirs: ["/tmp"], recursive: false) | ||
|
||
assert tmp_dir |> to_string() |> String.ends_with?("/tmp") | ||
end | ||
|
||
test "ignore unsupported options" do | ||
assert {:ok, | ||
[ | ||
~c"-e", | ||
~c"modify", | ||
~c"-e", | ||
~c"close_write", | ||
~c"-e", | ||
~c"moved_to", | ||
~c"-e", | ||
~c"moved_from", | ||
~c"-e", | ||
~c"create", | ||
~c"-e", | ||
~c"delete", | ||
~c"-e", | ||
~c"attrib", | ||
~c"--format", | ||
[37, 119, 1, 37, 101, 1, 37, 102], | ||
~c"--quiet", | ||
~c"-m", | ||
tmp_dir | ||
]} = parse_options(dirs: ["/tmp"], recursive: false, unsupported: :options) | ||
|
||
assert tmp_dir |> to_string() |> String.ends_with?("/tmp") | ||
|
||
assert {:ok, | ||
[ | ||
~c"-e", | ||
~c"modify", | ||
~c"-e", | ||
~c"close_write", | ||
~c"-e", | ||
~c"moved_to", | ||
~c"-e", | ||
~c"moved_from", | ||
~c"-e", | ||
~c"create", | ||
~c"-e", | ||
~c"delete", | ||
~c"-e", | ||
~c"attrib", | ||
~c"--format", | ||
[37, 119, 1, 37, 101, 1, 37, 102], | ||
~c"--quiet", | ||
~c"-m", | ||
~c"-r", | ||
tmp_dir | ||
]} = parse_options(dirs: ["/tmp"], recursive: :unknown_value) | ||
|
||
assert tmp_dir |> to_string() |> String.ends_with?("/tmp") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters