summaryrefslogtreecommitdiff
path: root/lib/elixir/test/elixir/option_parser_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/elixir/test/elixir/option_parser_test.exs')
-rw-r--r--lib/elixir/test/elixir/option_parser_test.exs17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/elixir/test/elixir/option_parser_test.exs b/lib/elixir/test/elixir/option_parser_test.exs
index 7f38e4264..c589a1165 100644
--- a/lib/elixir/test/elixir/option_parser_test.exs
+++ b/lib/elixir/test/elixir/option_parser_test.exs
@@ -148,6 +148,23 @@ defmodule OptionParserTest do
) == {[source: "foo"], ["bar", "--", "-x"], []}
end
+ test "return separators" do
+ assert OptionParser.parse_head(["--", "foo"],
+ switches: [],
+ return_separator: true
+ ) == {[], ["--", "foo"], []}
+
+ assert OptionParser.parse_head(["--no-halt", "--", "foo"],
+ switches: [halt: :boolean],
+ return_separator: true
+ ) == {[halt: false], ["--", "foo"], []}
+
+ assert OptionParser.parse_head(["foo.exs", "--no-halt", "--", "foo"],
+ switches: [halt: :boolean],
+ return_separator: true
+ ) == {[], ["foo.exs", "--no-halt", "--", "foo"], []}
+ end
+
test "parses - as argument" do
argv = ["--foo", "-", "-b", "-"]
opts = [strict: [foo: :boolean, boo: :string], aliases: [b: :boo]]