aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy_tests
diff options
context:
space:
mode:
authorUK992 <urbankrajnc92@gmail.com>2016-12-24 17:42:20 +0100
committerUK992 <urbankrajnc92@gmail.com>2016-12-26 16:49:08 +0100
commitb760578f0fd9fb33dd83815ce490410ba9a59f88 (patch)
tree753eb0635b9bae1fe2b074e2d47884fe1efb4d9e /python/tidy/servo_tidy_tests
parent5bd53af960638b1cf2a7c89d3d97280fea208dfa (diff)
downloadservo-b760578f0fd9fb33dd83815ce490410ba9a59f88.tar.gz
servo-b760578f0fd9fb33dd83815ce490410ba9a59f88.zip
Tidy: Check Cargo.lock for packages with same version and different sources
Diffstat (limited to 'python/tidy/servo_tidy_tests')
-rw-r--r--python/tidy/servo_tidy_tests/duplicated_package.lock28
-rw-r--r--python/tidy/servo_tidy_tests/test_tidy.py16
2 files changed, 37 insertions, 7 deletions
diff --git a/python/tidy/servo_tidy_tests/duplicated_package.lock b/python/tidy/servo_tidy_tests/duplicated_package.lock
index 77777fdd82c..6075f99164c 100644
--- a/python/tidy/servo_tidy_tests/duplicated_package.lock
+++ b/python/tidy/servo_tidy_tests/duplicated_package.lock
@@ -15,7 +15,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "test2"
version = "0.1.0"
-source = "git+https://github.com/"
+source = "git+https://github.com/user/test2#c54edsf"
dependencies = [
"test 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
+
+[[package]]
+name = "test3"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "test3"
+version = "0.5.1"
+source = "git+https://github.com/user/test3#c54edsf"
+
+[[package]]
+name = "test4"
+version = "0.1.0"
+source = "git+https://github.com/user/test4#c54edsf"
+dependencies = [
+ "test3 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "test5"
+version = "0.1.0"
+source = "git+https://github.com/"
+dependencies = [
+ "test3 0.5.1 (git+https://github.com/user/test3)",
+]
diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py
index 265c485a106..7adcbda2dfe 100644
--- a/python/tidy/servo_tidy_tests/test_tidy.py
+++ b/python/tidy/servo_tidy_tests/test_tidy.py
@@ -200,13 +200,17 @@ class CheckTidiness(unittest.TestCase):
def test_lock(self):
errors = tidy.collect_errors_for_files(iterFile('duplicated_package.lock'), [tidy.check_lock], [], print_text=False)
- msg = """duplicate versions for package "test"
-\t\033[93mfound dependency on version 0.4.9\033[0m
-\t\033[91mbut highest version is 0.5.1\033[0m
-\t\033[93mtry upgrading with\033[0m \033[96m./mach cargo-update -p test:0.4.9\033[0m
-\tThe following packages depend on version 0.4.9:
-\t\ttest2"""
+ 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"""
self.assertEqual(msg, errors.next()[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\x1b[93mThe following packages depend on version 0.5.1 from 'https://github.com/user/test3':\x1b[0m
+\t\ttest5"""
+ self.assertEqual(msg2, errors.next()[2])
self.assertNoMoreErrors(errors)
def test_lint_runner(self):