@@ -123,6 +123,26 @@ public void Should_return_error_if_option_format_with_equals_is_not_correct()
123
123
Assert . Equal ( ErrorType . BadFormatTokenError , tokens . First ( ) . Tag ) ;
124
124
Assert . Equal ( ErrorType . BadFormatTokenError , tokens . Last ( ) . Tag ) ;
125
125
}
126
+
127
+
128
+ [ Theory ]
129
+ [ InlineData ( new [ ] { "-a" , "-" } , 2 , "a" , "-" ) ]
130
+ [ InlineData ( new [ ] { "--file" , "-" } , 2 , "file" , "-" ) ]
131
+ [ InlineData ( new [ ] { "-f-" } , 2 , "f" , "-" ) ]
132
+ [ InlineData ( new [ ] { "--file=-" } , 2 , "file" , "-" ) ]
133
+ [ InlineData ( new [ ] { "-a" , "--" } , 1 , "a" , "a" ) ]
134
+ public void single_dash_as_a_value ( string [ ] args , int countExcepted , string first , string last )
135
+ {
136
+ //Arrange
137
+ //Act
138
+ var result = Tokenizer . Tokenize ( args , name => NameLookupResult . OtherOptionFound , token => token ) ;
139
+ var tokens = result . SucceededWith ( ) . ToList ( ) ;
140
+ //Assert
141
+ tokens . Should ( ) . NotBeNull ( ) ;
142
+ tokens . Count . Should ( ) . Be ( countExcepted ) ;
143
+ tokens . First ( ) . Text . Should ( ) . Be ( first ) ;
144
+ tokens . Last ( ) . Text . Should ( ) . Be ( last ) ;
145
+ }
126
146
}
127
147
128
148
}
0 commit comments