org.pitest.util.Glob.matches()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中org.pitest.util.Glob.matches()方法的一些代码示例,展示了Glob.matches()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Glob.matches()方法的具体详情如下:
包路径:org.pitest.util.Glob
类名称:Glob
方法名:matches

Glob.matches介绍

暂无

代码示例

代码示例来源:origin: hcoles/pitest

@Override
public boolean test(final String value) {
 return matches(value);
}

代码示例来源:origin: hcoles/pitest

@Test
public void shouldMatchEverythingAfterAStar() {
 final Glob glob = new Glob("org.foo.*");
 assertTrue(glob.matches("org.foo.foo"));
 assertTrue(glob.matches("org.foo."));
 assertTrue(glob.matches("org.foo.bar"));
}

代码示例来源:origin: hcoles/pitest

@Test
public void shouldSupportMultipleWildcards() {
 final Glob glob = new Glob("foo*bar*car");
 assertTrue(glob.matches("foo!!!bar!!!car"));
 assertFalse(glob.matches("foo!!!!!car"));
}

代码示例来源:origin: hcoles/pitest

@Test
public void shouldSupportQuestionMarkWildCard() {
 final Glob glob = new Glob("org?foo?bar");
 assertTrue(glob.matches("org.foo.bar"));
 assertTrue(glob.matches("orgafooabar"));
}

代码示例来源:origin: hcoles/pitest

@Test
public void shouldBeCaseSensitice() {
 final Glob glob = new Glob("foo*bar*car");
 assertTrue(glob.matches("foo!!!bar!!!car"));
 assertFalse(glob.matches("foo!!!Bar!!!car"));
}

代码示例来源:origin: hcoles/pitest

@Test
public void shouldEscapeEscapesInGeneratedRegex() {
 final Glob glob = new Glob("org.\\bar");
 assertTrue(glob.matches("org.\\bar"));
 assertFalse(glob.matches("org.bar"));
}

代码示例来源:origin: hcoles/pitest

@Test
public void shouldHandleEmptyStrings() {
 final Glob glob = new Glob("");
 assertTrue(glob.matches(""));
}

代码示例来源:origin: hcoles/pitest

@Test
public void shouldNotMatchIfContentDiffersBeforeAStar() {
 final Glob glob = new Glob("org.foo.*");
 assertFalse(glob.matches("org.fo"));
}

代码示例来源:origin: hcoles/pitest

@Test
public void shouldEscapeDotsInGeneratedRegex() {
 final Glob glob = new Glob("org.foo.bar");
 assertFalse(glob.matches("orgafooabar"));
}

代码示例来源:origin: hcoles/pitest

@Test
public void shouldFindExactMatches() {
 final String value = "org.foo.foo";
 final Glob glob = new Glob(value);
 assertTrue(glob.matches(value));
}

代码示例来源:origin: hcoles/pitest

@Test
public void shouldNotMatchNonMatchingStringWhenNoWildcardsPresent() {
 final String value = "org.foo.foo";
 final Glob glob = new Glob("org.foo");
 assertFalse(glob.matches(value));
}

代码示例来源:origin: org.pitest/pitest

@Override
public boolean test(final String value) {
 return matches(value);
}

相关文章