diff options
| author | Leedehai <18319900+Leedehai@users.noreply.github.com> | 2024-07-11 10:43:16 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-11 14:43:16 +0000 |
| commit | ab5cebc57c8345f397c3f0a1ed0c024dc6811e2f (patch) | |
| tree | 6307c48f4e4dc006d354c61c45652fbd5f1af76c | |
| parent | be516867c834d1172e17b3b2b25d70428c3d918b (diff) | |
Let test error hide line number if it's zero (#4535)
| -rw-r--r-- | tests/src/collect.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/src/collect.rs b/tests/src/collect.rs index ee4f9db9..f10f4a2e 100644 --- a/tests/src/collect.rs +++ b/tests/src/collect.rs @@ -48,7 +48,11 @@ impl FilePos { impl Display for FilePos { fn fmt(&self, f: &mut Formatter) -> fmt::Result { - write!(f, "{}:{}", self.path.display(), self.line) + if self.line > 0 { + write!(f, "{}:{}", self.path.display(), self.line) + } else { + write!(f, "{}", self.path.display()) + } } } |
