Skip to content

Commit

Permalink
CI: add additional test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFrasier committed Aug 16, 2023
1 parent 0e676aa commit 58abfd1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
17 changes: 16 additions & 1 deletion marker_uilints/tests/ui/cfg_attr_check.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
#![cfg_attr(marker, feature(register_tool))]
#![cfg_attr(marker, register_tool(marker))]

mod cfg_attr_scope {
mod allow_with_simple_attr {
#[cfg_attr(marker, allow(marker::item_with_test_name))]
fn find_me_fn() {}
}

mod allow_with_crate_check_attr {
#[cfg_attr(marker = "marker_uilints", allow(marker::item_with_test_name))]
fn find_me_fn() {}
}

mod lint_with_unloaded_crate_attr {
#[cfg_attr(marker = "some_unknown_crate_that_isnt_loaded", allow(marker::item_with_test_name))]
fn find_me_fn() {}
}

mod unknown_lint_allow {
#[cfg_attr(marker, allow(marker::some_unknown_lint_that_doesnt_exist))]
fn foo() {}
}
18 changes: 18 additions & 0 deletions marker_uilints/tests/ui/cfg_attr_check.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
warning: unknown lint: `marker::some_unknown_lint_that_doesnt_exist`
--> $DIR/cfg_attr_check.rs:20:30
|
20 | #[cfg_attr(marker, allow(marker::some_unknown_lint_that_doesnt_exist))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unknown_lints)]` on by default

warning: found a `fn` item with a test name
--> $DIR/cfg_attr_check.rs:16:5
|
16 | fn find_me_fn() {}
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(marker::item_with_test_name)]` on by default

warning: 2 warnings emitted

0 comments on commit 58abfd1

Please sign in to comment.