Skip to content

Commit 1d68f30

Browse files
committed
add a reduced case for the -o regression. The test does not exhibt the bug, so it is mostly useless :(
1 parent 25c26a4 commit 1d68f30

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

t/hll/05-commandline.t

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! nqp
22

3-
plan(25);
3+
plan(27);
44

55
my $x := HLL::CommandLine::Parser.new(['a', 'b', 'e=s', 'target=s', 'verbose']);
66
my $r := $x.parse(['-a', 'b']);
@@ -53,8 +53,10 @@ ok(pir::join(',', $r.arguments) eq 'script.pl,--verbose',
5353

5454
# TODO: tests for long options as stoppers
5555

56-
$x := HLL::CommandLine::Parser.new(['a|b', 'l|long', 'w|with-arg=s']);
56+
$x := HLL::CommandLine::Parser.new(['a|b', 'l|long',
57+
'w|with-arg=s', 'other|o=s']);
5758
$r := $x.parse(['-a', '-b', '-l', '--long', '-w', 'v1',
59+
'--other=v3', '-o', 'v4',
5860
'--with-arg', 'v2', 'arg1', 'arg2']);
5961

6062
ok(pir::join(',', $r.arguments) eq 'arg1,arg2',
@@ -67,3 +69,6 @@ ok($r.options{'long'} == 1, 'short+long alias (right)');
6769

6870
ok($r.options{'w'} eq 'v1', 'short+long alias with value (left)');
6971
ok($r.options{'with-arg'} eq 'v2', 'short+long alias with value(right)');
72+
73+
ok($r.options<o> eq 'v4', 'long|short alias (short)');
74+
ok($r.options<other> eq 'v3', 'long|short alias (short)');

0 commit comments

Comments
 (0)