diff options
Diffstat (limited to 'src/tools/clippy/tests/ui-toml/lint_decimal_readability/test.rs')
-rw-r--r-- | src/tools/clippy/tests/ui-toml/lint_decimal_readability/test.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui-toml/lint_decimal_readability/test.rs b/src/tools/clippy/tests/ui-toml/lint_decimal_readability/test.rs new file mode 100644 index 000000000..2498672d7 --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/lint_decimal_readability/test.rs @@ -0,0 +1,23 @@ +#![allow(clippy::excessive_precision)] +#[deny(clippy::unreadable_literal)] + +fn allow_inconsistent_digit_grouping() { + #![allow(clippy::inconsistent_digit_grouping)] + let _pass1 = 100_200_300.123456789; +} + +fn main() { + allow_inconsistent_digit_grouping(); + + let _pass1 = 100_200_300.100_200_300; + let _pass2 = 1.123456789; + let _pass3 = 1.0; + let _pass4 = 10000.00001; + let _pass5 = 1.123456789e1; + + // due to clippy::inconsistent-digit-grouping + let _fail1 = 100_200_300.123456789; + + // fail due to the integer part + let _fail2 = 100200300.300200100; +} |