From 180d914c5ee6817eb0a387b790403030985304f9 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Thu, 6 Feb 2020 15:52:23 -0800 Subject: [PATCH] Update tests for 1.42. --- tests/error-tests/tests/binop-mul-bool.rs | 3 ++- tests/error-tests/tests/dead-code-ret.rs | 2 +- .../tests/method-ambig-two-traits-with-default-method.rs | 6 ++++-- tests/error-tests/tests/remote_note_1.rs | 2 +- tests/error-tests/tests/test_multiple_primary_spans.rs | 9 +++++++-- tests/message-order/tests/test_test_output.rs | 2 +- tests/test_message_order.py | 5 +++-- tests/test_syntax_check.py | 3 ++- 8 files changed, 21 insertions(+), 11 deletions(-) diff --git a/tests/error-tests/tests/binop-mul-bool.rs b/tests/error-tests/tests/binop-mul-bool.rs index 0b6d0af9..dc7bb5ec 100644 --- a/tests/error-tests/tests/binop-mul-bool.rs +++ b/tests/error-tests/tests/binop-mul-bool.rs @@ -15,7 +15,8 @@ fn main() { let x = true * false; } // ^^^^NOTE(<1.19.0) an implementation of // ^^^^^^^^^^^^ERR(>=1.19.0,<1.35.0-beta) binary operation // ^^^^^^^^^^^^NOTE(>=1.19.0,<1.35.0-beta) an implementation of -// ^ERR(>=1.35.0-beta) binary operation +// ^ERR(>=1.35.0-beta,<1.42.0-beta) binary operation +// ^ERR(>=1.42.0-beta) cannot multiply // ^NOTE(>=1.35.0-beta) an implementation of // ^^^^ERR(>=1.35.0-beta) bool // ^^^^^ERR(>=1.35.0-beta) bool diff --git a/tests/error-tests/tests/dead-code-ret.rs b/tests/error-tests/tests/dead-code-ret.rs index ea52e824..76cbddaf 100644 --- a/tests/error-tests/tests/dead-code-ret.rs +++ b/tests/error-tests/tests/dead-code-ret.rs @@ -11,7 +11,7 @@ // error-pattern: unreachable statement #![deny(unreachable_code)] -// ^^^^^^^^^^^^^^^^NOTE lint level defined here +// ^^^^^^^^^^^^^^^^NOTE defined here // ^^^^^^^^^^^^^^^^MSG See Primary: ↓:20 fn main() { diff --git a/tests/error-tests/tests/method-ambig-two-traits-with-default-method.rs b/tests/error-tests/tests/method-ambig-two-traits-with-default-method.rs index 4cee980a..2eabf296 100644 --- a/tests/error-tests/tests/method-ambig-two-traits-with-default-method.rs +++ b/tests/error-tests/tests/method-ambig-two-traits-with-default-method.rs @@ -28,8 +28,10 @@ fn main() { 1_usize.method(); // ^^^^^^ERR multiple applicable items // ^^^^^^ERR multiple `method` found -// ^^^^^^HELP(>=1.38.0-beta) to disambiguate -// ^^^^^^HELP(>=1.38.0-beta) to disambiguate +// ^^^^^^HELP(>=1.38.0-beta) disambiguate +// ^^^^^^^^^^^^^^^^HELP(>=1.42.0-beta) /Accept Replacement:.*Foo::method/ +// ^^^^^^HELP(>=1.38.0-beta) disambiguate +// ^^^^^^^^^^^^^^^^HELP(>=1.42.0-beta) /Accept Replacement:.*Bar::method/ // ^^^^^^MSG See Also: ↑:13 // ^^^^^^MSG See Also: ↑:18 } diff --git a/tests/error-tests/tests/remote_note_1.rs b/tests/error-tests/tests/remote_note_1.rs index 0119dd71..fd063acd 100644 --- a/tests/error-tests/tests/remote_note_1.rs +++ b/tests/error-tests/tests/remote_note_1.rs @@ -1,5 +1,5 @@ #![deny(unreachable_code)] -// ^^^^^^^^^^^^^^^^NOTE lint level defined here +// ^^^^^^^^^^^^^^^^NOTE defined here // ^^^^^^^^^^^^^^^^MSG See Primary: remote_note_1_mod.rs:4 pub mod remote_note_1_mod; diff --git a/tests/error-tests/tests/test_multiple_primary_spans.rs b/tests/error-tests/tests/test_multiple_primary_spans.rs index e3c2eadb..592d4cee 100644 --- a/tests/error-tests/tests/test_multiple_primary_spans.rs +++ b/tests/error-tests/tests/test_multiple_primary_spans.rs @@ -2,6 +2,11 @@ // (both spans have no label). #[repr(C, u64)] -// ^WARN conflicting representation hints -// ^^^WARN conflicting representation hints +// ^WARN(<1.42.0-beta) conflicting representation hints +// ^^^WARN(<1.42.0-beta) conflicting representation hints +// ^ERR(>=1.42.0-beta) conflicting representation hints +// ^^^ERR(>=1.42.0-beta) conflicting representation hints +// ^NOTE(>=1.43.0-beta) `#[deny(conflicting_repr_hints)]` on by default +// ^WARN(>=1.43.0-beta) this was previously +// ^NOTE(>=1.43.0-beta) for more information pub enum C { C } diff --git a/tests/message-order/tests/test_test_output.rs b/tests/message-order/tests/test_test_output.rs index 501df044..2a58d0fc 100644 --- a/tests/message-order/tests/test_test_output.rs +++ b/tests/message-order/tests/test_test_output.rs @@ -56,6 +56,6 @@ fn slow() { #[test] fn panic_outside_crate() { // This (unfortunately) should not show up as an error when running tests - // since Rust prints the path to src/libcore/result.rs. + // since Rust prints the path to src/libcore/result.rs. (This has been fixed in 1.42.) Err::("err").unwrap(); } diff --git a/tests/test_message_order.py b/tests/test_message_order.py index 6efdd5ba..4432eb7e 100644 --- a/tests/test_message_order.py +++ b/tests/test_message_order.py @@ -51,6 +51,7 @@ (3, 'tests/test_test_output.rs', 'ERR', (18, 4), 'tests/test_test_output.rs:19:5', 'tests/test_test_output.rs:19:5'), (4, 'tests/test_test_output.rs', 'ERR', (23, 4), 'tests/test_test_output.rs:24:5', 'tests/test_test_output.rs:24:5'), (5, 'tests/test_test_output.rs', 'ERR', (28, 4), 'tests/test_test_output.rs:29:5', 'tests/test_test_output.rs:29:5'), + (6, 'tests/test_test_output.rs', 'ERR', (59, 4), 'tests/test_test_output.rs:60:5', 'tests/test_test_output.rs:60:5'), ] } ] @@ -62,8 +63,8 @@ def setUp(self): super(TestMessageOrder, self).setUp() # Set a base version for these tests. version = util.get_rustc_version(sublime.active_window(), plugin_path) - if semver.match(version, '<1.41.0-beta'): - self.skipTest('Tests require rust 1.41 or newer.') + if semver.match(version, '<1.42.0-beta'): + self.skipTest('Tests require rust 1.42 or newer.') # Make it so that the build target is automatically determined from # the active view so each test doesn't have to specify it. diff --git a/tests/test_syntax_check.py b/tests/test_syntax_check.py index 8384bfad..f8207de4 100755 --- a/tests/test_syntax_check.py +++ b/tests/test_syntax_check.py @@ -232,7 +232,8 @@ def check_actual_text(expected_text, actual_text): else: actual_text = msg.text if check_actual_text(emsg_info['message'], actual_text): - self.assertEqual(emsg_info['level'], msg.level) + self.assertEqual(emsg_info['level'], msg.level, + 'Level mismatch. Expected:\n%s\nGot:\n%s' % (emsg_info, msg)) break else: raise AssertionError('Did not find expected message "%s:%s" for region %r:%r for file %r\nsetup=%s\nversion=%s\nAvailable messages=%r' % (