aboutsummaryrefslogtreecommitdiff
path: root/mingling_cli/src/lints/template_linter.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-07-21 15:55:11 +0800
committer魏曹先生 <1992414357@qq.com>2026-07-21 15:55:11 +0800
commit770d738829076e0be2152452ab68933a47a483e2 (patch)
tree1d4ed37639ef4aca019c5139dfaa5cabec9976b8 /mingling_cli/src/lints/template_linter.rs
parent0056e1095e75b34f39cde7de87ce6be2cd301ff1 (diff)
feat: add testing macros and unit tests for linters
Add `assert_detected!` and `assert_not_detected!` macros to simplify writing lint tests, along with initial test coverage for the unnecessary render result creation linter.
Diffstat (limited to 'mingling_cli/src/lints/template_linter.rs')
-rw-r--r--mingling_cli/src/lints/template_linter.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/mingling_cli/src/lints/template_linter.rs b/mingling_cli/src/lints/template_linter.rs
index 4ea2f94..271aa0c 100644
--- a/mingling_cli/src/lints/template_linter.rs
+++ b/mingling_cli/src/lints/template_linter.rs
@@ -46,3 +46,11 @@ pub fn linter(_ast: syn::ItemFn, _source: &str) -> Vec<MlintReport> {
// | syn::ItemUnion
vec![]
}
+
+#[cfg(test)]
+mod lint_test {
+ use crate::{assert_detected, assert_not_detected};
+
+ #[test]
+ fn test() {}
+}