Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
com.github.simy4.coregex:coregex-core
Advanced tools
A handy utility for generating strings that match given regular expression criteria.
A handy utility for generating strings that match given regular expression criteria.
Include the following dependency into your project:
testImplementation "com.github.simy4.coregex:coregex-jqwik"
Use the provided Regex
annotation to generate a string that would match the regular expression predicate:
class MyTest {
@Property
void myProperty(@ForAll @Regex("[a-zA-Z]{3}") String str) {
assertThat(str).hasLength(3);
}
}
Include the following dependency into your project:
testImplementation "com.github.simy4.coregex:coregex-junit-quickcheck"
Use the provided Regex
annotation to generate a string that would match the regular expression predicate:
@RunWith(JUnitQuickcheck.class)
public class MyTest {
@Property
public void myProperty(@Regex("[a-zA-Z]{3}") String str) {
assertThat(str).hasLength(3);
}
}
Include the following dependency into your project:
testImplementation "com.github.simy4.coregex:coregex-kotest"
Use the provided CoregexArbirary
class to generate a string that would match the regular expression predicate:
class MyTest : DescribeSpec({
describe("my property") {
it("should hold") {
checkAll(CoregexArbitrary.of("[a-zA-Z]{3}")) { str ->
str.length shouldBe 3
}
}
}
})
Include the following dependency into your project:
libraryDependencies ++= Seq("com.github.simy4.coregex" %% "coregex-scalacheck" % Test)
Use the provided CoregexInstances
trait to constrain string arbitraries:
object MySpecification extends Properties("MySpecification") with CoregexInstances {
property("my property") = forAll { (str: String Matching "[a-zA-Z]{3}") =>
3 == str.length
}
}
Include the following dependency into your project:
testImplementation "com.github.simy4.coregex:coregex-vavr-test"
Use the provided CoregexArbirary
class to generate a string that would match the regular expression predicate:
class MyTest {
@Test
void myProperty() {
Property.def("my property")
.forAll(CoregexArbitrary.of("[a-zA-Z]{3}"))
.suchThat(str -> 3 == str.length())
.check();
}
}
FAQs
A handy utility for generating strings that match given regular expression criteria.
We found that com.github.simy4.coregex:coregex-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.