feat: 项目整体命名修改cache-schema-checker
All checks were successful
缓存序列化结构检查 / cache-schema-check (push) Has been skipped
All checks were successful
缓存序列化结构检查 / cache-schema-check (push) Has been skipped
This commit is contained in:
28
src/test/java/com/codechecker/cache/analyze/GlobMatcherTest.java
vendored
Normal file
28
src/test/java/com/codechecker/cache/analyze/GlobMatcherTest.java
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.codechecker.cache.analyze;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class GlobMatcherTest {
|
||||
|
||||
@Test
|
||||
void matchesPrefixWildcard() {
|
||||
assertTrue(GlobMatcher.matches("tenant:db:content:*", "tenant:db:content:abc"));
|
||||
assertTrue(GlobMatcher.matches("*:lock", "device:add:lock"));
|
||||
assertTrue(GlobMatcher.matches("*lock*", "abTaskDetailUpdate:lock:x"));
|
||||
assertTrue(GlobMatcher.matches("loginCount:*", "loginCount:13800000000"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void matchesDoubleStarPath() {
|
||||
assertTrue(GlobMatcher.matches("**/test/**", "jnpf-x/src/test/java/Foo.java"));
|
||||
assertFalse(GlobMatcher.matches("**/test/**", "jnpf-x/src/main/java/Foo.java"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void literalNoMatch() {
|
||||
assertFalse(GlobMatcher.matches("tenant:db:content:*", "other:key"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user