From 3917a29105ede844e72bce9e6d2f51d14cfeace2 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 10 Jul 2024 16:19:19 +0200 Subject: [PATCH] Update tests --- tests/ui/disallowed_script_idents.rs | 5 +-- tests/ui/literals.rs | 46 ++++++++++++---------------- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/tests/ui/disallowed_script_idents.rs b/tests/ui/disallowed_script_idents.rs index 6b68fae318c0..08fd1d9669ee 100644 --- a/tests/ui/disallowed_script_idents.rs +++ b/tests/ui/disallowed_script_idents.rs @@ -9,8 +9,9 @@ fn main() { // Cyrillic is not allowed by default. let счётчик = 10; - //~^ ERROR: identifier `счётчик` has a Unicode script that is not allowed by configura + //~^ disallowed_script_idents + // Same for japanese. let カウンタ = 10; - //~^ ERROR: identifier `カウンタ` has a Unicode script that is not allowed by configuratio + //~^ disallowed_script_idents } diff --git a/tests/ui/literals.rs b/tests/ui/literals.rs index c275b04d886b..a2792170c4af 100644 --- a/tests/ui/literals.rs +++ b/tests/ui/literals.rs @@ -11,32 +11,28 @@ fn main() { let ok1 = 0xABCD; let ok3 = 0xab_cd; let ok4 = 0xab_cd_i32; - //~^ ERROR: integer type suffix should not be separated by an underscore - //~| NOTE: `-D clippy::separated-literal-suffix` implied by `-D warnings` + //~^ separated_literal_suffix let ok5 = 0xAB_CD_u32; - //~^ ERROR: integer type suffix should not be separated by an underscore + //~^ separated_literal_suffix let ok5 = 0xAB_CD_isize; - //~^ ERROR: integer type suffix should not be separated by an underscore + //~^ separated_literal_suffix let fail1 = 0xabCD; - //~^ ERROR: inconsistent casing in hexadecimal literal - //~| NOTE: `-D clippy::mixed-case-hex-literals` implied by `-D warnings` + //~^ mixed_case_hex_literals let fail2 = 0xabCD_u32; - //~^ ERROR: integer type suffix should not be separated by an underscore - //~| ERROR: inconsistent casing in hexadecimal literal + //~^ mixed_case_hex_literals + //~| separated_literal_suffix let fail2 = 0xabCD_isize; - //~^ ERROR: integer type suffix should not be separated by an underscore - //~| ERROR: inconsistent casing in hexadecimal literal + //~^ separated_literal_suffix + //~| mixed_case_hex_literals let fail_multi_zero = 000_123usize; - //~^ ERROR: integer type suffix should be separated by an underscore - //~| NOTE: `-D clippy::unseparated-literal-suffix` implied by `-D warnings` - //~| ERROR: this is a decimal constant - //~| NOTE: `-D clippy::zero-prefixed-literal` implied by `-D warnings` + //~^ zero_prefixed_literal + //~| unseparated_literal_suffix let ok9 = 0; let ok10 = 0_i64; - //~^ ERROR: integer type suffix should not be separated by an underscore + //~^ separated_literal_suffix let fail8 = 0123; - //~^ ERROR: this is a decimal constant + //~^ zero_prefixed_literal let ok11 = 0o123; let ok12 = 0b10_1010; @@ -46,20 +42,18 @@ fn main() { let ok15 = 0xab_cabc_abca_bcab_cabc; let ok16 = 0xFE_BAFE_ABAB_ABCD; let ok17 = 0x123_4567_8901_usize; - //~^ ERROR: integer type suffix should not be separated by an underscore + //~^ separated_literal_suffix let ok18 = 0xF; let fail19 = 12_3456_21; - //~^ ERROR: digits grouped inconsistently by underscores - //~| NOTE: `-D clippy::inconsistent-digit-grouping` implied by `-D warnings` + //~^ inconsistent_digit_grouping let fail22 = 3__4___23; - //~^ ERROR: digits grouped inconsistently by underscores + //~^ inconsistent_digit_grouping let fail23 = 3__16___23; - //~^ ERROR: digits grouped inconsistently by underscores + //~^ inconsistent_digit_grouping let fail24 = 0xAB_ABC_AB; - //~^ ERROR: digits of hex, binary or octal literal not in groups of equal size - //~| NOTE: `-D clippy::unusual-byte-groupings` implied by `-D warnings` + //~^ unusual_byte_groupings let fail25 = 0b01_100_101; let ok26 = 0x6_A0_BF; let ok27 = 0b1_0010_0101; @@ -68,9 +62,9 @@ fn main() { fn issue9651() { // lint but octal form is not possible here let _ = 08; - //~^ ERROR: this is a decimal constant + //~^ zero_prefixed_literal let _ = 09; - //~^ ERROR: this is a decimal constant + //~^ zero_prefixed_literal let _ = 089; - //~^ ERROR: this is a decimal constant + //~^ zero_prefixed_literal }