about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui-toml/item_name_repetitions/allow_exact_repetitions/clippy.toml1
-rw-r--r--tests/ui-toml/item_name_repetitions/allow_exact_repetitions/item_name_repetitions.rs13
-rw-r--r--tests/ui-toml/item_name_repetitions/allow_exact_repetitions/item_name_repetitions.stderr11
-rw-r--r--tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr3
4 files changed, 28 insertions, 0 deletions
diff --git a/tests/ui-toml/item_name_repetitions/allow_exact_repetitions/clippy.toml b/tests/ui-toml/item_name_repetitions/allow_exact_repetitions/clippy.toml
new file mode 100644
index 00000000000..3ed7cedbd14
--- /dev/null
+++ b/tests/ui-toml/item_name_repetitions/allow_exact_repetitions/clippy.toml
@@ -0,0 +1 @@
+allow-exact-repetitions = false
diff --git a/tests/ui-toml/item_name_repetitions/allow_exact_repetitions/item_name_repetitions.rs b/tests/ui-toml/item_name_repetitions/allow_exact_repetitions/item_name_repetitions.rs
new file mode 100644
index 00000000000..20603766624
--- /dev/null
+++ b/tests/ui-toml/item_name_repetitions/allow_exact_repetitions/item_name_repetitions.rs
@@ -0,0 +1,13 @@
+#![warn(clippy::module_name_repetitions)]
+#![allow(dead_code)]
+
+pub mod foo {
+    // this line should produce a warning:
+    pub fn foo() {}
+    //~^ module_name_repetitions
+
+    // but this line shouldn't
+    pub fn to_foo() {}
+}
+
+fn main() {}
diff --git a/tests/ui-toml/item_name_repetitions/allow_exact_repetitions/item_name_repetitions.stderr b/tests/ui-toml/item_name_repetitions/allow_exact_repetitions/item_name_repetitions.stderr
new file mode 100644
index 00000000000..8e6f726d02c
--- /dev/null
+++ b/tests/ui-toml/item_name_repetitions/allow_exact_repetitions/item_name_repetitions.stderr
@@ -0,0 +1,11 @@
+error: item name is the same as its containing module's name
+  --> tests/ui-toml/item_name_repetitions/allow_exact_repetitions/item_name_repetitions.rs:6:12
+   |
+LL |     pub fn foo() {}
+   |            ^^^
+   |
+   = note: `-D clippy::module-name-repetitions` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::module_name_repetitions)]`
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr b/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr
index 0a36cd3cf26..6ee77ebd8ec 100644
--- a/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr
+++ b/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr
@@ -5,6 +5,7 @@ error: error reading Clippy's configuration file: unknown field `foobar`, expect
            accept-comment-above-statement
            allow-comparison-to-zero
            allow-dbg-in-tests
+           allow-exact-repetitions
            allow-expect-in-consts
            allow-expect-in-tests
            allow-indexing-slicing-in-tests
@@ -98,6 +99,7 @@ error: error reading Clippy's configuration file: unknown field `barfoo`, expect
            accept-comment-above-statement
            allow-comparison-to-zero
            allow-dbg-in-tests
+           allow-exact-repetitions
            allow-expect-in-consts
            allow-expect-in-tests
            allow-indexing-slicing-in-tests
@@ -191,6 +193,7 @@ error: error reading Clippy's configuration file: unknown field `allow_mixed_uni
            accept-comment-above-statement
            allow-comparison-to-zero
            allow-dbg-in-tests
+           allow-exact-repetitions
            allow-expect-in-consts
            allow-expect-in-tests
            allow-indexing-slicing-in-tests