@@ -246,7 +246,7 @@ mod prepare {
246
246
#[ test]
247
247
fn multiple_arguments_in_one_line_with_auto_split ( ) {
248
248
let cmd = std:: process:: Command :: from (
249
- gix_command:: prepare ( "echo first second third" ) . with_shell_allow_argument_splitting ( ) ,
249
+ gix_command:: prepare ( "echo first second third" ) . with_shell_allow_manual_argument_splitting ( ) ,
250
250
) ;
251
251
assert_eq ! (
252
252
format!( "{cmd:?}" ) ,
@@ -313,19 +313,29 @@ mod prepare {
313
313
314
314
#[ test]
315
315
fn single_and_complex_arguments_with_auto_split ( ) {
316
- let cmd =
317
- std:: process:: Command :: from ( gix_command:: prepare ( "ls --foo=\" a b\" " ) . with_shell_allow_argument_splitting ( ) ) ;
316
+ let cmd = std:: process:: Command :: from (
317
+ gix_command:: prepare ( "ls --foo=\" a b\" " ) . with_shell_allow_manual_argument_splitting ( ) ,
318
+ ) ;
318
319
assert_eq ! (
319
320
format!( "{cmd:?}" ) ,
320
321
format!( r#""ls" "--foo=a b""# ) ,
321
322
"splitting can also handle quotes"
322
323
) ;
323
324
}
324
325
326
+ #[ test]
327
+ fn single_and_complex_arguments_without_auto_split ( ) {
328
+ let cmd = std:: process:: Command :: from (
329
+ gix_command:: prepare ( "ls --foo=\" a b\" " ) . with_shell_disallow_manual_argument_splitting ( ) ,
330
+ ) ;
331
+ assert_eq ! ( format!( "{cmd:?}" ) , quoted( & [ SH , "-c" , r#"ls --foo=\"a b\""# , "--" ] ) ) ;
332
+ }
333
+
325
334
#[ test]
326
335
fn single_and_complex_arguments_will_not_auto_split_on_special_characters ( ) {
327
- let cmd =
328
- std:: process:: Command :: from ( gix_command:: prepare ( "ls --foo=~/path" ) . with_shell_allow_argument_splitting ( ) ) ;
336
+ let cmd = std:: process:: Command :: from (
337
+ gix_command:: prepare ( "ls --foo=~/path" ) . with_shell_allow_manual_argument_splitting ( ) ,
338
+ ) ;
329
339
assert_eq ! (
330
340
format!( "{cmd:?}" ) ,
331
341
format!( r#""{SH}" "-c" "ls --foo=~/path" "--""# ) ,
0 commit comments