Skip to content

Commit

Permalink
change based on review
Browse files Browse the repository at this point in the history
  • Loading branch information
ABouttefeux committed May 3, 2021
1 parent 347ed00 commit 6e99cb3
Show file tree
Hide file tree
Showing 26 changed files with 60 additions and 60 deletions.
2 changes: 1 addition & 1 deletion library/test/src/formatters/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl<T: Write> PrettyFormatter<T> {

fn write_test_name(&mut self, desc: &TestDesc) -> io::Result<()> {
let name = desc.padded_name(self.max_name_len, desc.name.padding());
self.write_plain(&format!("test {} {} ... ", name, desc.test_mode_string()))?;
self.write_plain(&format!("test {} - {} ... ", name, desc.test_mode_string()))?;

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion library/test/src/formatters/terse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl<T: Write> TerseFormatter<T> {

fn write_test_name(&mut self, desc: &TestDesc) -> io::Result<()> {
let name = desc.padded_name(self.max_name_len, desc.name.padding());
self.write_plain(&format!("test {} {} ... ", name, desc.test_mode_string()))?;
self.write_plain(&format!("test {} - {} ... ", name, desc.test_mode_string()))?;

Ok(())
}
Expand Down
16 changes: 8 additions & 8 deletions library/test/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,26 +143,26 @@ impl TestDesc {
}
}

pub fn test_mode_string(&self) -> String {
pub fn test_mode_string(&self) -> &'static str {
if self.ignore {
return "ignore".to_string();
return &"ignore";
}
match self.should_panic {
options::ShouldPanic::Yes | options::ShouldPanic::YesWithMessage(_) => {
return "should panic".to_string();
return &"should panic";
}
_ => {}
options::ShouldPanic::No => {}
}
if self.allow_fail {
return "allow fail".to_string();
return &"allow fail";
}
if self.compile_fail {
return "compile fail".to_string();
return &"compile fail";
}
if self.no_run {
return "compile".to_string();
return &"compile";
}
"run".to_string()
&"run"
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/rustdoc-ui/cfg-test.stdout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

running 2 tests
test $DIR/cfg-test.rs - Bar (line 27) run ... ok
test $DIR/cfg-test.rs - Foo (line 19) run ... ok
test $DIR/cfg-test.rs - Bar (line 27) - run ... ok
test $DIR/cfg-test.rs - Foo (line 19) - run ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME

2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/doc-test-doctest-feature.stdout
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

running 1 test
test $DIR/doc-test-doctest-feature.rs - Foo (line 9) run ... ok
test $DIR/doc-test-doctest-feature.rs - Foo (line 9) - run ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME

2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/doc-test-rustdoc-feature.stdout
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

running 1 test
test $DIR/doc-test-rustdoc-feature.rs - Foo (line 10) run ... ok
test $DIR/doc-test-rustdoc-feature.rs - Foo (line 10) - run ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME

6 changes: 3 additions & 3 deletions src/test/rustdoc-ui/doctest-output.stdout
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

running 3 tests
test $DIR/doctest-output.rs - (line 8) run ... ok
test $DIR/doctest-output.rs - ExpandedStruct (line 24) run ... ok
test $DIR/doctest-output.rs - foo::bar (line 18) run ... ok
test $DIR/doctest-output.rs - (line 8) - run ... ok
test $DIR/doctest-output.rs - ExpandedStruct (line 24) - run ... ok
test $DIR/doctest-output.rs - foo::bar (line 18) - run ... ok

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME

2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/failed-doctest-compile-fail.stdout
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

running 1 test
test $DIR/failed-doctest-compile-fail.rs - Foo (line 9) compile fail ... FAILED
test $DIR/failed-doctest-compile-fail.rs - Foo (line 9) - compile fail ... FAILED

failures:

Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/failed-doctest-missing-codes.stdout
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

running 1 test
test $DIR/failed-doctest-missing-codes.rs - Foo (line 9) compile fail ... FAILED
test $DIR/failed-doctest-missing-codes.rs - Foo (line 9) - compile fail ... FAILED

failures:

Expand Down
4 changes: 2 additions & 2 deletions src/test/rustdoc-ui/failed-doctest-output.stdout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

running 2 tests
test $DIR/failed-doctest-output.rs - OtherStruct (line 22) run ... FAILED
test $DIR/failed-doctest-output.rs - SomeStruct (line 12) run ... FAILED
test $DIR/failed-doctest-output.rs - OtherStruct (line 22) - run ... FAILED
test $DIR/failed-doctest-output.rs - SomeStruct (line 12) - run ... FAILED

failures:

Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/failed-doctest-should-panic.stdout
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

running 1 test
test $DIR/failed-doctest-should-panic.rs - Foo (line 9) run ... FAILED
test $DIR/failed-doctest-should-panic.rs - Foo (line 9) - run ... FAILED

failures:

Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/issue-80992.stdout
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

running 1 test
test $DIR/issue-80992.rs - test (line 7) compile fail ... ok
test $DIR/issue-80992.rs - test (line 7) - compile fail ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME

2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/issue-81662-shortness.stdout
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

running 1 test
test $DIR/issue-81662-shortness.rs - foo (line 6) run ... FAILED
test $DIR/issue-81662-shortness.rs - foo (line 6) - run ... FAILED

failures:

Expand Down
14 changes: 7 additions & 7 deletions src/test/rustdoc-ui/no-run-flag.stdout
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

running 7 tests
test $DIR/no-run-flag.rs - f (line 11) compile ... ok
test $DIR/no-run-flag.rs - f (line 14) ignore ... ignored
test $DIR/no-run-flag.rs - f (line 17) compile ... ok
test $DIR/no-run-flag.rs - f (line 23) compile fail ... ok
test $DIR/no-run-flag.rs - f (line 28) compile ... ok
test $DIR/no-run-flag.rs - f (line 32) compile ... ok
test $DIR/no-run-flag.rs - f (line 8) compile ... ok
test $DIR/no-run-flag.rs - f (line 11) - compile ... ok
test $DIR/no-run-flag.rs - f (line 14) - ignore ... ignored
test $DIR/no-run-flag.rs - f (line 17) - compile ... ok
test $DIR/no-run-flag.rs - f (line 23) - compile fail ... ok
test $DIR/no-run-flag.rs - f (line 28) - compile ... ok
test $DIR/no-run-flag.rs - f (line 32) - compile ... ok
test $DIR/no-run-flag.rs - f (line 8) - compile ... ok

test result: ok. 6 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in $TIME

2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/run-directory.correct.stdout
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

running 1 test
test $DIR/run-directory.rs - foo (line 10) run ... ok
test $DIR/run-directory.rs - foo (line 10) - run ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME

2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/run-directory.incorrect.stdout
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

running 1 test
test $DIR/run-directory.rs - foo (line 19) run ... ok
test $DIR/run-directory.rs - foo (line 19) - run ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME

2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/test-no_std.stdout
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

running 1 test
test $DIR/test-no_std.rs - f (line 10) run ... ok
test $DIR/test-no_std.rs - f (line 10) - run ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME

10 changes: 5 additions & 5 deletions src/test/rustdoc-ui/test-type.stdout
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

running 5 tests
test $DIR/test-type.rs - f (line 12) ignore ... ignored
test $DIR/test-type.rs - f (line 15) compile ... ok
test $DIR/test-type.rs - f (line 21) compile fail ... ok
test $DIR/test-type.rs - f (line 6) run ... ok
test $DIR/test-type.rs - f (line 9) run ... ok
test $DIR/test-type.rs - f (line 12) - ignore ... ignored
test $DIR/test-type.rs - f (line 15) - compile ... ok
test $DIR/test-type.rs - f (line 21) - compile fail ... ok
test $DIR/test-type.rs - f (line 6) - run ... ok
test $DIR/test-type.rs - f (line 9) - run ... ok

test result: ok. 4 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in $TIME

2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/unparseable-doc-test.stdout
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

running 1 test
test $DIR/unparseable-doc-test.rs - foo (line 7) run ... FAILED
test $DIR/unparseable-doc-test.rs - foo (line 7) - run ... FAILED

failures:

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/test-attrs/test-filter-multiple.run.stdout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

running 2 tests
test test1 run ... ok
test test2 run ... ok
test test1 - run ... ok
test test2 - run ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in $TIME

6 changes: 3 additions & 3 deletions src/test/ui/test-attrs/test-type.run.stdout
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

running 3 tests
test test_no_run ignore ... ignored
test test_ok run ... ok
test test_panic should panic ... ok
test test_no_run - ignore ... ignored
test test_ok - run ... ok
test test_panic - should panic ... ok

test result: ok. 2 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in $TIME

8 changes: 4 additions & 4 deletions src/test/ui/test-panic-abort-nocapture.run.stdout
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

running 4 tests
test it_fails run ... about to fail
test it_fails - run ... about to fail
FAILED
test it_panics should panic ... about to panic
test it_panics - should panic ... about to panic
ok
test it_works run ... about to succeed
test it_works - run ... about to succeed
ok
test it_writes_to_stdio run ... hello, world
test it_writes_to_stdio - run ... hello, world
testing123
ok

Expand Down
10 changes: 5 additions & 5 deletions src/test/ui/test-panic-abort.run.stdout
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

running 5 tests
test it_exits run ... FAILED
test it_fails run ... FAILED
test it_panics should panic ... ok
test it_works run ... ok
test no_residual_environment run ... ok
test it_exits - run ... FAILED
test it_fails - run ... FAILED
test it_panics - should panic ... ok
test it_works - run ... ok
test no_residual_environment - run ... ok

failures:

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/test-passed.run.stdout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

running 2 tests
test it_works run ... ok
test it_works_too run ... ok
test it_works - run ... ok
test it_works_too - run ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME

4 changes: 2 additions & 2 deletions src/test/ui/test-thread-capture.run.stdout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

running 2 tests
test thready_fail run ... FAILED
test thready_pass run ... ok
test thready_fail - run ... FAILED
test thready_pass - run ... ok

failures:

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/test-thread-nocapture.run.stdout
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

running 2 tests
test thready_fail run ... fee
test thready_fail - run ... fee
fie
foe
fum
FAILED
test thready_pass run ... fee
test thready_pass - run ... fee
fie
foe
fum
Expand Down

0 comments on commit 6e99cb3

Please sign in to comment.