diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-06-28 06:38:24 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-06-28 06:38:24 +0800 |
| commit | 0414c4642c0fc98a5c5bae37943ac93ef75da60a (patch) | |
| tree | 23ad6da2cd59b7e84284f2573b6b68b63458c0e7 /mingling_pathf/test/src/lib.rs | |
| parent | 0f84a88d0b2c9205ec1b3cbfa18ffe05478e5a64 (diff) | |
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
Diffstat (limited to 'mingling_pathf/test/src/lib.rs')
| -rw-r--r-- | mingling_pathf/test/src/lib.rs | 6 |
1 files changed, 2 insertions, 4 deletions
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")); } |
