mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
34 lines
764 B
Rust
34 lines
764 B
Rust
use oxc_linter::{RuleCategory, RuleMeta};
|
|
use oxc_macros::declare_oxc_lint_test;
|
|
|
|
struct TestRule;
|
|
|
|
declare_oxc_lint_test!(
|
|
/// Dummy description
|
|
/// # which is multiline
|
|
TestRule,
|
|
correctness
|
|
);
|
|
|
|
struct TestRule2 {
|
|
#[allow(dead_code)]
|
|
dummy_field: u8,
|
|
}
|
|
|
|
declare_oxc_lint_test!(
|
|
/// Dummy description2
|
|
TestRule2,
|
|
correctness
|
|
);
|
|
|
|
#[test]
|
|
fn test_declare_oxc_lint() {
|
|
// Simple, multiline documentation
|
|
assert_eq!(TestRule::documentation().unwrap(), "Dummy description\n# which is multiline\n");
|
|
|
|
// Ensure structs with fields can be passed to the macro
|
|
assert_eq!(TestRule2::documentation().unwrap(), "Dummy description2\n");
|
|
|
|
// Auto-generated kebab-case name
|
|
assert_eq!(TestRule::NAME, "test-rule");
|
|
}
|