Bug 1645066 - mozlint/clippy: update of the test to reflect the new output r=marco a=test-only
authorSylvestre Ledru <sledru@mozilla.com>
Tue, 16 Jun 2020 18:54:54 +0000
changeset 600869 22bb2eb335ceff3e118db9386970fb229cfbca41
parent 600868 1e8edd35e3238c07666d070f9ffcd2d2a1450c81
child 600870 26cc20dfe6b5e3ac9d8f73549c195dd32ba1e38a
push id2362
push userryanvm@gmail.com
push dateMon, 22 Jun 2020 23:05:09 +0000
treeherdermozilla-release@af00ea74f8fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarco, test-only
bugs1645066
milestone78.0
Bug 1645066 - mozlint/clippy: update of the test to reflect the new output r=marco a=test-only Differential Revision: https://phabricator.services.mozilla.com/D79436
tools/lint/test/test_clippy.py
--- a/tools/lint/test/test_clippy.py
+++ b/tools/lint/test/test_clippy.py
@@ -7,17 +7,17 @@ LINTER = 'clippy'
 def test_basic(lint, config, paths):
     results = lint(paths("test1/"))
     print(results)
     assert len(results) > 7
 
     assert "is never read" in results[0].message or 'but never used' in results[0].message
     assert results[0].level == "warning"
     assert results[0].lineno == 7
-    assert results[0].column == 13
+    assert results[0].column == 9
     assert results[0].rule == "unused_assignments"
     assert results[0].relpath == "test1/bad.rs"
     assert "tools/lint/test/files/clippy/test1/bad.rs" in results[0].path
 
     assert "value assigned to `b` is never read" in results[1].message
     assert results[1].level == "warning"
     assert results[1].relpath == "test1/bad.rs"
 
@@ -48,41 +48,41 @@ def test_file_and_path_provided(lint, co
     # even if clippy analyzed it
     # we should not have anything from bad_2.rs
     # as mozlint is filtering out the file
     print(results)
     assert len(results) > 16
     assert "value assigned to `a` is never read" in results[0].message
     assert results[0].level == "warning"
     assert results[0].lineno == 7
-    assert results[0].column == 13
+    assert results[0].column == 9
     assert results[0].rule == "unused_assignments"
     assert results[0].relpath == "test1/bad.rs"
     assert "tools/lint/test/files/clippy/test1/bad.rs" in results[0].path
     assert "value assigned to `a` is never read" in results[0].message
     assert results[8].level == "warning"
     assert results[8].lineno == 9
-    assert results[8].column == 13
+    assert results[8].column == 9
     assert results[8].rule == "unused_assignments"
     assert results[8].relpath == "test2/src/bad_1.rs"
     assert "tools/lint/test/files/clippy/test2/src/bad_1.rs" in results[8].path
     for r in results:
         assert "bad_2.rs" not in r.relpath
 
 
 def test_file_provided(lint, config, paths):
     results = lint(paths("./test2/src/bad_1.rs"))
     # even if clippy analyzed it
     # we should not have anything from bad_2.rs
     # as mozlint is filtering out the file
     print(results)
     assert len(results) > 8
     assert results[0].level == "warning"
     assert results[0].lineno == 9
-    assert results[0].column == 13
+    assert results[0].column == 9
     assert results[0].rule == "unused_assignments"
     assert results[0].relpath == "test2/src/bad_1.rs"
     assert "tools/lint/test/files/clippy/test2/src/bad_1.rs" in results[0].path
     for r in results:
         assert "bad_2.rs" not in r.relpath
 
 
 def test_cleanup(lint, paths, root):