@@ -18,6 +18,8 @@ def setup
1818 def test_short
1919 assert_equal ( %w" " , no_error { @opt . parse! ( %w" -x -n " ) } )
2020 assert_equal ( nil , @flag )
21+ assert_equal ( %w" " , no_error { @opt . parse! ( %w" -x - " ) } )
22+ assert_equal ( "-" , @flag )
2123 @flag = false
2224 assert_equal ( %w" " , no_error { @opt . parse! ( %w" -x foo " ) } )
2325 assert_equal ( "foo" , @flag )
@@ -30,6 +32,8 @@ def test_short
3032 def test_abbrev
3133 assert_equal ( %w" " , no_error { @opt . parse! ( %w" -o -n " ) } )
3234 assert_equal ( nil , @flag )
35+ assert_equal ( %w" " , no_error { @opt . parse! ( %w" -o - " ) } )
36+ assert_equal ( "-" , @flag )
3337 @flag = false
3438 assert_equal ( %w" " , no_error { @opt . parse! ( %w" -o foo " ) } )
3539 assert_equal ( "foo" , @flag )
@@ -42,6 +46,8 @@ def test_abbrev
4246 def test_long
4347 assert_equal ( %w" " , no_error { @opt . parse! ( %w" --opt -n " ) } )
4448 assert_equal ( nil , @flag )
49+ assert_equal ( %w" " , no_error { @opt . parse! ( %w" --opt - " ) } )
50+ assert_equal ( "-" , @flag )
4551 assert_equal ( %w" foo " , no_error { @opt . parse! ( %w" --opt= foo " ) } )
4652 assert_equal ( "" , @flag )
4753 assert_equal ( %w" " , no_error { @opt . parse! ( %w" --opt=foo " ) } )
0 commit comments