From 0414c4642c0fc98a5c5bae37943ac93ef75da60a Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 28 Jun 2026 06:38:24 +0800 Subject: fix(test): rename test and update pattern analyzer usage Rename `test_pattern_analyzer` to clarify it runs once and update the analyzer initialization to match the new API without adding a pattern manually --- .gitignore | 1 + mingling_pathf/test/src/lib.rs | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 425a588..c2c7b5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .temp +__*/ # Temp file for dev_tools/scripts/windows-folder-hide.ps1 dev_tools/scripts/last_check diff --git a/mingling_pathf/test/src/lib.rs b/mingling_pathf/test/src/lib.rs index dbbd76d..f2ca3e0 100644 --- a/mingling_pathf/test/src/lib.rs +++ b/mingling_pathf/test/src/lib.rs @@ -39,12 +39,10 @@ fn test_module_pathf() { } #[test] -fn test_pattern_analyzer() { +fn test_pattern_analyzer_once() { let dir = current_dir().unwrap().join("test_proj"); - let mut analyzer = mingling_pathf::pattern_analyzer::init(); - analyzer.add_pattern(mingling_pathf::patterns::BasicStructPattern); + let analyzer = mingling_pathf::pattern_analyzer::init(); let result = analyzer.analyze_file(dir.join("src/has_sub_mod.rs")).unwrap(); - assert!(result.contains("::directly_sub_mod::DirectlySubModStruct")); } -- cgit