diff options
| author | AliƩnore Bouttefeux <alienore.bouttefeux@gmail.com> | 2021-05-03 20:16:44 +0200 |
|---|---|---|
| committer | AliƩnore Bouttefeux <alienore.bouttefeux@gmail.com> | 2021-05-03 20:17:15 +0200 |
| commit | 6e99cb39899a4be7d5e1f6572d38486712c75786 (patch) | |
| tree | 44b6d2fd0acb1e40acfe707d1932ac102608b9aa /library/test | |
| parent | 347ed001e81607f609f7c47a6d7cd5f723c288a1 (diff) | |
| download | rust-6e99cb39899a4be7d5e1f6572d38486712c75786.tar.gz rust-6e99cb39899a4be7d5e1f6572d38486712c75786.zip | |
change based on review
Diffstat (limited to 'library/test')
| -rw-r--r-- | library/test/src/formatters/pretty.rs | 2 | ||||
| -rw-r--r-- | library/test/src/formatters/terse.rs | 2 | ||||
| -rw-r--r-- | library/test/src/types.rs | 16 |
3 files changed, 10 insertions, 10 deletions
diff --git a/library/test/src/formatters/pretty.rs b/library/test/src/formatters/pretty.rs index 00d4b18b302..543b9a6924a 100644 --- a/library/test/src/formatters/pretty.rs +++ b/library/test/src/formatters/pretty.rs @@ -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(()) } diff --git a/library/test/src/formatters/terse.rs b/library/test/src/formatters/terse.rs index a68ceb404f9..286b50b525d 100644 --- a/library/test/src/formatters/terse.rs +++ b/library/test/src/formatters/terse.rs @@ -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(()) } diff --git a/library/test/src/types.rs b/library/test/src/types.rs index 61c644f7972..a2c3d5fa8ee 100644 --- a/library/test/src/types.rs +++ b/library/test/src/types.rs @@ -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" } } |
