From 019e310861c170105d40b1c93453d4b83cb78a4c Mon Sep 17 00:00:00 2001 From: mcarton Date: Sun, 2 Oct 2016 14:43:09 +0200 Subject: [PATCH] Add more tests for bad configuration file --- tests/compile-fail/conf_bad_toml.rs | 6 ++++++ tests/compile-fail/conf_bad_toml.toml | 2 ++ tests/compile-fail/conf_path_non_string.rs | 6 ++++++ 3 files changed, 14 insertions(+) create mode 100644 tests/compile-fail/conf_bad_toml.rs create mode 100644 tests/compile-fail/conf_bad_toml.toml create mode 100644 tests/compile-fail/conf_path_non_string.rs diff --git a/tests/compile-fail/conf_bad_toml.rs b/tests/compile-fail/conf_bad_toml.rs new file mode 100644 index 00000000000..b5ea6d96ef5 --- /dev/null +++ b/tests/compile-fail/conf_bad_toml.rs @@ -0,0 +1,6 @@ +// error-pattern: error reading Clippy's configuration file + +#![feature(plugin)] +#![plugin(clippy(conf_file="./tests/compile-fail/conf_bad_toml.toml"))] + +fn main() {} diff --git a/tests/compile-fail/conf_bad_toml.toml b/tests/compile-fail/conf_bad_toml.toml new file mode 100644 index 00000000000..823e01a33b9 --- /dev/null +++ b/tests/compile-fail/conf_bad_toml.toml @@ -0,0 +1,2 @@ +fn this_is_obviously(not: a, toml: file) { +} diff --git a/tests/compile-fail/conf_path_non_string.rs b/tests/compile-fail/conf_path_non_string.rs new file mode 100644 index 00000000000..f26f581f5c0 --- /dev/null +++ b/tests/compile-fail/conf_path_non_string.rs @@ -0,0 +1,6 @@ +#![feature(attr_literals)] +#![feature(plugin)] +#![plugin(clippy(conf_file=42))] +//~^ ERROR `conf_file` value must be a string + +fn main() {}