@@ -40,6 +40,12 @@ describe('yargs-parser', function () {
4040 parse . should . have . property ( '_' ) . with . length ( 0 )
4141 } )
4242
43+ it ( 'should set the value of a single long option to the next supplied value, even if the value is empty' , function ( ) {
44+ var parse = parser ( [ '--pow' , '' ] )
45+ parse . should . have . property ( 'pow' , '' )
46+ parse . should . have . property ( '_' ) . with . length ( 0 )
47+ } )
48+
4349 it ( 'should set the value of a single long option if an = was used' , function ( ) {
4450 var parse = parser ( [ '--pow=xixxle' ] )
4551 parse . should . have . property ( 'pow' , 'xixxle' )
@@ -121,6 +127,12 @@ describe('yargs-parser', function () {
121127 argv . _ [ 0 ] . should . be . a ( 'number' )
122128 } )
123129
130+ it ( 'should set the value of a single short option to the next supplied value, even if the value is empty' , function ( ) {
131+ var parse = parser ( [ '-p' , '' ] )
132+ parse . should . have . property ( 'p' , '' )
133+ parse . should . have . property ( '_' ) . with . length ( 0 )
134+ } )
135+
124136 it ( 'should not set the next value as the value of a short option if that option is explicitly defined as a boolean' , function ( ) {
125137 var parse = parser ( [ '-t' , 'moo' ] , {
126138 boolean : 't'
0 commit comments