Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jul 10, 2024
1 parent c3b3cb3 commit 3917a29
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
5 changes: 3 additions & 2 deletions tests/ui/disallowed_script_idents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
46 changes: 20 additions & 26 deletions tests/ui/literals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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
}

0 comments on commit 3917a29

Please sign in to comment.