File tree Expand file tree Collapse file tree 4 files changed +15
-13
lines changed Expand file tree Collapse file tree 4 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -3938,10 +3938,6 @@ fn inferred_benchmarks() {
3938
3938
3939
3939
#[ test]
3940
3940
fn target_edition ( ) {
3941
- if !is_nightly ( ) {
3942
- // --edition is nightly-only
3943
- return ;
3944
- }
3945
3941
let p = project ( )
3946
3942
. file (
3947
3943
"Cargo.toml" ,
@@ -3957,6 +3953,7 @@ fn target_edition() {
3957
3953
. build ( ) ;
3958
3954
3959
3955
p. cargo ( "build -v" )
3956
+ . without_status ( ) // passes on nightly, fails on stable, b/c --edition is nightly-only
3960
3957
. with_stderr_contains (
3961
3958
"\
3962
3959
[COMPILING] foo v0.0.1 ([..])
Original file line number Diff line number Diff line change @@ -635,7 +635,7 @@ fn output_not_captured() {
635
635
) . build ( ) ;
636
636
637
637
p. cargo ( "doc" )
638
- . with_status ( 101 )
638
+ . without_status ( )
639
639
. with_stderr_contains ( "1 | ☃" )
640
640
. with_stderr_contains ( r"error: unknown start of token: \u{2603}" )
641
641
. run ( ) ;
Original file line number Diff line number Diff line change @@ -932,10 +932,6 @@ fn package_two_kinds_of_deps() {
932
932
933
933
#[ test]
934
934
fn test_edition ( ) {
935
- if !is_nightly ( ) {
936
- // --edition is nightly-only
937
- return ;
938
- }
939
935
let p = project ( )
940
936
. file (
941
937
"Cargo.toml" ,
@@ -951,10 +947,11 @@ fn test_edition() {
951
947
. build ( ) ;
952
948
953
949
p. cargo ( "build -v" ) . masquerade_as_nightly_cargo ( )
954
- // --edition is still in flux and we're not passing -Zunstable-options
955
- // from Cargo so it will probably error. Only partially match the output
956
- // until stuff stabilizes
957
- . with_stderr_contains ( "\
950
+ . without_status ( ) // passes on nightly, fails on stable, b/c --edition is nightly-only
951
+ // --edition is still in flux and we're not passing -Zunstable-options
952
+ // from Cargo so it will probably error. Only partially match the output
953
+ // until stuff stabilizes
954
+ . with_stderr_contains ( "\
958
955
[COMPILING] foo v0.0.1 ([..])
959
956
[RUNNING] `rustc [..]--edition=2018 [..]
960
957
" ) . run ( ) ;
Original file line number Diff line number Diff line change @@ -566,6 +566,14 @@ impl Execs {
566
566
self
567
567
}
568
568
569
+ /// Remove exit code check for the process.
570
+ ///
571
+ /// By default, the expected exit code is `0`.
572
+ pub fn without_status ( & mut self ) -> & mut Self {
573
+ self . expect_exit_code = None ;
574
+ self
575
+ }
576
+
569
577
/// Verify that stdout contains the given contiguous lines somewhere in
570
578
/// its output.
571
579
/// See `lines_match` for supported patterns.
You can’t perform that action at this time.
0 commit comments