Fix output of test-tidy with duplicated packages.

This commit is contained in:
Josh Matthews 2020-05-20 14:19:47 -04:00
parent 1f4acb940b
commit 4fec987221
3 changed files with 16 additions and 10 deletions

View file

@ -17,13 +17,16 @@ name = "test2"
version = "0.1.0"
source = "git+https://github.com/user/test2#c54edsf"
dependencies = [
"test 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
"test 0.4.9",
]
[[package]]
name = "test3"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"test 0.5.1",
]
[[package]]
name = "test3"

View file

@ -195,14 +195,15 @@ class CheckTidiness(unittest.TestCase):
errors = tidy.collect_errors_for_files(iterFile('duplicated_package.lock'), [tidy.check_lock], [], print_text=False)
msg = """duplicate versions for package `test`
\t\x1b[93mThe following packages depend on version 0.4.9 from 'crates.io':\x1b[0m
\t\ttest2
\t\x1b[93mThe following packages depend on version 0.5.1 from 'crates.io':\x1b[0m"""
\t\ttest2 0.1.0
\t\x1b[93mThe following packages depend on version 0.5.1 from 'crates.io':\x1b[0m
\t\ttest3 0.5.1"""
self.assertEqual(msg, next(errors)[2])
msg2 = """duplicate versions for package `test3`
\t\x1b[93mThe following packages depend on version 0.5.1 from 'crates.io':\x1b[0m
\t\ttest4
\t\ttest4 0.1.0
\t\x1b[93mThe following packages depend on version 0.5.1 from 'https://github.com/user/test3':\x1b[0m
\t\ttest5"""
\t\ttest5 0.1.0"""
self.assertEqual(msg2, next(errors)[2])
self.assertNoMoreErrors(errors)