Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

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

0 commit comments

Comments
 (0)