Skip to content

Commit 6e99cb3

Browse files
committed
change based on review
1 parent 347ed00 commit 6e99cb3

26 files changed

+60
-60
lines changed

library/test/src/formatters/pretty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl<T: Write> PrettyFormatter<T> {
169169

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

174174
Ok(())
175175
}

library/test/src/formatters/terse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl<T: Write> TerseFormatter<T> {
158158

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

163163
Ok(())
164164
}

library/test/src/types.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,26 +143,26 @@ impl TestDesc {
143143
}
144144
}
145145

146-
pub fn test_mode_string(&self) -> String {
146+
pub fn test_mode_string(&self) -> &'static str {
147147
if self.ignore {
148-
return "ignore".to_string();
148+
return &"ignore";
149149
}
150150
match self.should_panic {
151151
options::ShouldPanic::Yes | options::ShouldPanic::YesWithMessage(_) => {
152-
return "should panic".to_string();
152+
return &"should panic";
153153
}
154-
_ => {}
154+
options::ShouldPanic::No => {}
155155
}
156156
if self.allow_fail {
157-
return "allow fail".to_string();
157+
return &"allow fail";
158158
}
159159
if self.compile_fail {
160-
return "compile fail".to_string();
160+
return &"compile fail";
161161
}
162162
if self.no_run {
163-
return "compile".to_string();
163+
return &"compile";
164164
}
165-
"run".to_string()
165+
&"run"
166166
}
167167
}
168168

src/test/rustdoc-ui/cfg-test.stdout

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

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

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

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

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

src/test/rustdoc-ui/failed-doctest-compile-fail.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

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

55
failures:
66

src/test/rustdoc-ui/failed-doctest-missing-codes.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

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

55
failures:
66

src/test/rustdoc-ui/failed-doctest-output.stdout

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

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

66
failures:
77

src/test/rustdoc-ui/failed-doctest-should-panic.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

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

55
failures:
66

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

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

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

src/test/rustdoc-ui/issue-81662-shortness.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

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

55
failures:
66

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22
running 7 tests
3-
test $DIR/no-run-flag.rs - f (line 11) compile ... ok
4-
test $DIR/no-run-flag.rs - f (line 14) ignore ... ignored
5-
test $DIR/no-run-flag.rs - f (line 17) compile ... ok
6-
test $DIR/no-run-flag.rs - f (line 23) compile fail ... ok
7-
test $DIR/no-run-flag.rs - f (line 28) compile ... ok
8-
test $DIR/no-run-flag.rs - f (line 32) compile ... ok
9-
test $DIR/no-run-flag.rs - f (line 8) compile ... ok
3+
test $DIR/no-run-flag.rs - f (line 11) - compile ... ok
4+
test $DIR/no-run-flag.rs - f (line 14) - ignore ... ignored
5+
test $DIR/no-run-flag.rs - f (line 17) - compile ... ok
6+
test $DIR/no-run-flag.rs - f (line 23) - compile fail ... ok
7+
test $DIR/no-run-flag.rs - f (line 28) - compile ... ok
8+
test $DIR/no-run-flag.rs - f (line 32) - compile ... ok
9+
test $DIR/no-run-flag.rs - f (line 8) - compile ... ok
1010

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

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

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

src/test/rustdoc-ui/test-type.stdout

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

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

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

src/test/rustdoc-ui/unparseable-doc-test.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

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

55
failures:
66

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
running 2 tests
3-
test test1 run ... ok
4-
test test2 run ... ok
3+
test test1 - run ... ok
4+
test test2 - run ... ok
55

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
running 3 tests
3-
test test_no_run ignore ... ignored
4-
test test_ok run ... ok
5-
test test_panic should panic ... ok
3+
test test_no_run - ignore ... ignored
4+
test test_ok - run ... ok
5+
test test_panic - should panic ... ok
66

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

src/test/ui/test-panic-abort-nocapture.run.stdout

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22
running 4 tests
3-
test it_fails run ... about to fail
3+
test it_fails - run ... about to fail
44
FAILED
5-
test it_panics should panic ... about to panic
5+
test it_panics - should panic ... about to panic
66
ok
7-
test it_works run ... about to succeed
7+
test it_works - run ... about to succeed
88
ok
9-
test it_writes_to_stdio run ... hello, world
9+
test it_writes_to_stdio - run ... hello, world
1010
testing123
1111
ok
1212

src/test/ui/test-panic-abort.run.stdout

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22
running 5 tests
3-
test it_exits run ... FAILED
4-
test it_fails run ... FAILED
5-
test it_panics should panic ... ok
6-
test it_works run ... ok
7-
test no_residual_environment run ... ok
3+
test it_exits - run ... FAILED
4+
test it_fails - run ... FAILED
5+
test it_panics - should panic ... ok
6+
test it_works - run ... ok
7+
test no_residual_environment - run ... ok
88

99
failures:
1010

src/test/ui/test-passed.run.stdout

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
running 2 tests
3-
test it_works run ... ok
4-
test it_works_too run ... ok
3+
test it_works - run ... ok
4+
test it_works_too - run ... ok
55

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

src/test/ui/test-thread-capture.run.stdout

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
running 2 tests
3-
test thready_fail run ... FAILED
4-
test thready_pass run ... ok
3+
test thready_fail - run ... FAILED
4+
test thready_pass - run ... ok
55

66
failures:
77

src/test/ui/test-thread-nocapture.run.stdout

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
running 2 tests
3-
test thready_fail run ... fee
3+
test thready_fail - run ... fee
44
fie
55
foe
66
fum
77
FAILED
8-
test thready_pass run ... fee
8+
test thready_pass - run ... fee
99
fie
1010
foe
1111
fum

0 commit comments

Comments
 (0)