@@ -37,12 +37,12 @@ fn cargo_bench_simple() {
3737 p. process ( & p. bin ( "foo" ) ) . with_stdout ( "hello\n " ) . run ( ) ;
3838
3939 p. cargo ( "bench" )
40- . with_stderr ( & format ! (
40+ . with_stderr (
4141 "\
4242 [COMPILING] foo v0.5.0 (CWD)
4343[FINISHED] release [optimized] target(s) in [..]
4444[RUNNING] target/release/deps/foo-[..][EXE]" ,
45- ) ) . with_stdout_contains ( "test bench_hello ... bench: [..]" )
45+ ) . with_stdout_contains ( "test bench_hello ... bench: [..]" )
4646 . run ( ) ;
4747}
4848
@@ -76,14 +76,14 @@ fn bench_bench_implicit() {
7676 ) . build ( ) ;
7777
7878 p. cargo ( "bench --benches" )
79- . with_stderr ( format ! (
79+ . with_stderr (
8080 "\
8181 [COMPILING] foo v0.0.1 (CWD)
8282[FINISHED] release [optimized] target(s) in [..]
8383[RUNNING] target/release/deps/foo-[..][EXE]
8484[RUNNING] target/release/deps/mybench-[..][EXE]
8585" ,
86- ) ) . with_stdout_contains ( "test run2 ... bench: [..]" )
86+ ) . with_stdout_contains ( "test run2 ... bench: [..]" )
8787 . run ( ) ;
8888}
8989
@@ -117,13 +117,13 @@ fn bench_bin_implicit() {
117117 ) . build ( ) ;
118118
119119 p. cargo ( "bench --bins" )
120- . with_stderr ( format ! (
120+ . with_stderr (
121121 "\
122122 [COMPILING] foo v0.0.1 (CWD)
123123[FINISHED] release [optimized] target(s) in [..]
124124[RUNNING] target/release/deps/foo-[..][EXE]
125125" ,
126- ) ) . with_stdout_contains ( "test run1 ... bench: [..]" )
126+ ) . with_stdout_contains ( "test run1 ... bench: [..]" )
127127 . run ( ) ;
128128}
129129
@@ -149,13 +149,13 @@ fn bench_tarname() {
149149 ) . build ( ) ;
150150
151151 p. cargo ( "bench --bench bin2" )
152- . with_stderr ( format ! (
152+ . with_stderr (
153153 "\
154154 [COMPILING] foo v0.0.1 (CWD)
155155[FINISHED] release [optimized] target(s) in [..]
156156[RUNNING] target/release/deps/bin2-[..][EXE]
157157" ,
158- ) ) . with_stdout_contains ( "test run2 ... bench: [..]" )
158+ ) . with_stdout_contains ( "test run2 ... bench: [..]" )
159159 . run ( ) ;
160160}
161161
@@ -213,13 +213,13 @@ fn cargo_bench_verbose() {
213213 ) . build ( ) ;
214214
215215 p. cargo ( "bench -v hello" )
216- . with_stderr ( & format ! (
216+ . with_stderr (
217217 "\
218218 [COMPILING] foo v0.5.0 (CWD)
219219[RUNNING] `rustc [..] src/main.rs [..]`
220220[FINISHED] release [optimized] target(s) in [..]
221221[RUNNING] `[..]target/release/deps/foo-[..][EXE] hello --bench`" ,
222- ) ) . with_stdout_contains ( "test bench_hello ... bench: [..]" )
222+ ) . with_stdout_contains ( "test bench_hello ... bench: [..]" )
223223 . run ( ) ;
224224}
225225
@@ -303,12 +303,12 @@ fn cargo_bench_failing_test() {
303303 // Force libtest into serial execution so that the test header will be printed.
304304 p. cargo ( "bench -- --test-threads=1" )
305305 . with_stdout_contains ( "test bench_hello ...[..]" )
306- . with_stderr_contains ( format ! (
306+ . with_stderr_contains (
307307 "\
308308 [COMPILING] foo v0.5.0 (CWD)[..]
309309[FINISHED] release [optimized] target(s) in [..]
310310[RUNNING] target/release/deps/foo-[..][EXE]" ,
311- ) ) . with_either_contains (
311+ ) . with_either_contains (
312312 "[..]thread '[..]' panicked at 'assertion failed: `(left == right)`[..]" ,
313313 ) . with_either_contains ( "[..]left: `\" hello\" `[..]" )
314314 . with_either_contains ( "[..]right: `\" nope\" `[..]" )
@@ -370,13 +370,13 @@ fn bench_with_lib_dep() {
370370 ) . build ( ) ;
371371
372372 p. cargo ( "bench" )
373- . with_stderr ( & format ! (
373+ . with_stderr (
374374 "\
375375 [COMPILING] foo v0.0.1 (CWD)
376376[FINISHED] release [optimized] target(s) in [..]
377377[RUNNING] target/release/deps/foo-[..][EXE]
378378[RUNNING] target/release/deps/baz-[..][EXE]" ,
379- ) ) . with_stdout_contains ( "test lib_bench ... bench: [..]" )
379+ ) . with_stdout_contains ( "test lib_bench ... bench: [..]" )
380380 . with_stdout_contains ( "test bin_bench ... bench: [..]" )
381381 . run ( ) ;
382382}
@@ -430,13 +430,13 @@ fn bench_with_deep_lib_dep() {
430430 ) . build ( ) ;
431431
432432 p. cargo ( "bench" )
433- . with_stderr ( & format ! (
433+ . with_stderr (
434434 "\
435435 [COMPILING] foo v0.0.1 ([..])
436436[COMPILING] bar v0.0.1 (CWD)
437437[FINISHED] release [optimized] target(s) in [..]
438438[RUNNING] target/release/deps/bar-[..][EXE]" ,
439- ) ) . with_stdout_contains ( "test bar_bench ... bench: [..]" )
439+ ) . with_stdout_contains ( "test bar_bench ... bench: [..]" )
440440 . run ( ) ;
441441}
442442
@@ -484,13 +484,13 @@ fn external_bench_explicit() {
484484 ) . build ( ) ;
485485
486486 p. cargo ( "bench" )
487- . with_stderr ( & format ! (
487+ . with_stderr (
488488 "\
489489 [COMPILING] foo v0.0.1 (CWD)
490490[FINISHED] release [optimized] target(s) in [..]
491491[RUNNING] target/release/deps/foo-[..][EXE]
492492[RUNNING] target/release/deps/bench-[..][EXE]" ,
493- ) ) . with_stdout_contains ( "test internal_bench ... bench: [..]" )
493+ ) . with_stdout_contains ( "test internal_bench ... bench: [..]" )
494494 . with_stdout_contains ( "test external_bench ... bench: [..]" )
495495 . run ( ) ;
496496}
@@ -528,13 +528,13 @@ fn external_bench_implicit() {
528528 ) . build ( ) ;
529529
530530 p. cargo ( "bench" )
531- . with_stderr ( & format ! (
531+ . with_stderr (
532532 "\
533533 [COMPILING] foo v0.0.1 (CWD)
534534[FINISHED] release [optimized] target(s) in [..]
535535[RUNNING] target/release/deps/foo-[..][EXE]
536536[RUNNING] target/release/deps/external-[..][EXE]" ,
537- ) ) . with_stdout_contains ( "test internal_bench ... bench: [..]" )
537+ ) . with_stdout_contains ( "test internal_bench ... bench: [..]" )
538538 . with_stdout_contains ( "test external_bench ... bench: [..]" )
539539 . run ( ) ;
540540}
@@ -588,7 +588,7 @@ fn bench_autodiscover_2015() {
588588
589589 p. cargo ( "bench bench_basic" )
590590 . masquerade_as_nightly_cargo ( )
591- . with_stderr ( & format ! (
591+ . with_stderr (
592592 "warning: \
593593 An explicit [[bench]] section is specified in Cargo.toml which currently
594594disables Cargo from automatically inferring other benchmark targets.
@@ -609,7 +609,7 @@ https://github.com/rust-lang/cargo/issues/5330
609609[FINISHED] release [optimized] target(s) in [..]
610610[RUNNING] target/release/deps/foo-[..][EXE]
611611" ,
612- ) ) . run ( ) ;
612+ ) . run ( ) ;
613613}
614614
615615#[ test]
@@ -647,12 +647,12 @@ fn pass_through_command_line() {
647647 ) . build ( ) ;
648648
649649 p. cargo ( "bench bar" )
650- . with_stderr ( & format ! (
650+ . with_stderr (
651651 "\
652652 [COMPILING] foo v0.0.1 (CWD)
653653[FINISHED] release [optimized] target(s) in [..]
654654[RUNNING] target/release/deps/foo-[..][EXE]" ,
655- ) ) . with_stdout_contains ( "test bar ... bench: [..]" )
655+ ) . with_stdout_contains ( "test bar ... bench: [..]" )
656656 . run ( ) ;
657657
658658 p. cargo ( "bench foo" )
@@ -734,13 +734,13 @@ fn lib_bin_same_name() {
734734 ) . build ( ) ;
735735
736736 p. cargo ( "bench" )
737- . with_stderr ( & format ! (
737+ . with_stderr (
738738 "\
739739 [COMPILING] foo v0.0.1 (CWD)
740740[FINISHED] release [optimized] target(s) in [..]
741741[RUNNING] target/release/deps/foo-[..][EXE]
742742[RUNNING] target/release/deps/foo-[..][EXE]" ,
743- ) ) . with_stdout_contains_n ( "test [..] ... bench: [..]" , 2 )
743+ ) . with_stdout_contains_n ( "test [..] ... bench: [..]" , 2 )
744744 . run ( ) ;
745745}
746746
@@ -780,13 +780,13 @@ fn lib_with_standard_name() {
780780 ) . build ( ) ;
781781
782782 p. cargo ( "bench" )
783- . with_stderr ( & format ! (
783+ . with_stderr (
784784 "\
785785 [COMPILING] syntax v0.0.1 (CWD)
786786[FINISHED] release [optimized] target(s) in [..]
787787[RUNNING] target/release/deps/syntax-[..][EXE]
788788[RUNNING] target/release/deps/bench-[..][EXE]" ,
789- ) ) . with_stdout_contains ( "test foo_bench ... bench: [..]" )
789+ ) . with_stdout_contains ( "test foo_bench ... bench: [..]" )
790790 . with_stdout_contains ( "test bench ... bench: [..]" )
791791 . run ( ) ;
792792}
@@ -829,12 +829,12 @@ fn lib_with_standard_name2() {
829829 ) . build ( ) ;
830830
831831 p. cargo ( "bench" )
832- . with_stderr ( & format ! (
832+ . with_stderr (
833833 "\
834834 [COMPILING] syntax v0.0.1 (CWD)
835835[FINISHED] release [optimized] target(s) in [..]
836836[RUNNING] target/release/deps/syntax-[..][EXE]" ,
837- ) ) . with_stdout_contains ( "test bench ... bench: [..]" )
837+ ) . with_stdout_contains ( "test bench ... bench: [..]" )
838838 . run ( ) ;
839839}
840840
@@ -899,7 +899,7 @@ fn bench_dylib() {
899899 . build ( ) ;
900900
901901 p. cargo ( "bench -v" )
902- . with_stderr ( & format ! (
902+ . with_stderr (
903903 "\
904904 [COMPILING] bar v0.0.1 (CWD/bar)
905905[RUNNING] [..] -C opt-level=3 [..]
@@ -910,19 +910,19 @@ fn bench_dylib() {
910910[FINISHED] release [optimized] target(s) in [..]
911911[RUNNING] `[..]target/release/deps/foo-[..][EXE] --bench`
912912[RUNNING] `[..]target/release/deps/bench-[..][EXE] --bench`" ,
913- ) ) . with_stdout_contains_n ( "test foo ... bench: [..]" , 2 )
913+ ) . with_stdout_contains_n ( "test foo ... bench: [..]" , 2 )
914914 . run ( ) ;
915915
916916 p. root ( ) . move_into_the_past ( ) ;
917917 p. cargo ( "bench -v" )
918- . with_stderr ( & format ! (
918+ . with_stderr (
919919 "\
920920 [FRESH] bar v0.0.1 (CWD/bar)
921921[FRESH] foo v0.0.1 (CWD)
922922[FINISHED] release [optimized] target(s) in [..]
923923[RUNNING] `[..]target/release/deps/foo-[..][EXE] --bench`
924924[RUNNING] `[..]target/release/deps/bench-[..][EXE] --bench`" ,
925- ) ) . with_stdout_contains_n ( "test foo ... bench: [..]" , 2 )
925+ ) . with_stdout_contains_n ( "test foo ... bench: [..]" , 2 )
926926 . run ( ) ;
927927}
928928
@@ -955,12 +955,12 @@ fn bench_twice_with_build_cmd() {
955955 ) . build ( ) ;
956956
957957 p. cargo ( "bench" )
958- . with_stderr ( & format ! (
958+ . with_stderr (
959959 "\
960960 [COMPILING] foo v0.0.1 (CWD)
961961[FINISHED] release [optimized] target(s) in [..]
962962[RUNNING] target/release/deps/foo-[..][EXE]" ,
963- ) ) . with_stdout_contains ( "test foo ... bench: [..]" )
963+ ) . with_stdout_contains ( "test foo ... bench: [..]" )
964964 . run ( ) ;
965965
966966 p. cargo ( "bench" )
@@ -1039,7 +1039,7 @@ fn bench_with_examples() {
10391039 ) . build ( ) ;
10401040
10411041 p. cargo ( "bench -v" )
1042- . with_stderr ( & format ! (
1042+ . with_stderr (
10431043 "\
10441044 [COMPILING] foo v6.6.6 (CWD)
10451045[RUNNING] `rustc [..]`
@@ -1048,7 +1048,7 @@ fn bench_with_examples() {
10481048[FINISHED] release [optimized] target(s) in [..]
10491049[RUNNING] `CWD/target/release/deps/foo-[..][EXE] --bench`
10501050[RUNNING] `CWD/target/release/deps/testb1-[..][EXE] --bench`" ,
1051- ) ) . with_stdout_contains ( "test bench_bench1 ... bench: [..]" )
1051+ ) . with_stdout_contains ( "test bench_bench1 ... bench: [..]" )
10521052 . with_stdout_contains ( "test bench_bench2 ... bench: [..]" )
10531053 . run ( ) ;
10541054}
0 commit comments