Skip to content

Regex support for missing predefined character classes and negated character classes#1474

Open
lmasroca wants to merge 31 commits intomasterfrom
external-pr-lmasroca
Open

Regex support for missing predefined character classes and negated character classes#1474
lmasroca wants to merge 31 commits intomasterfrom
external-pr-lmasroca

Conversation

@lmasroca
Copy link
Collaborator

Added Java/JS support for negated character classes
Added Java support for missing predefined character classes escapes (\v, \H, etc.) and POSIX character classes (\p{Lower}, etc.)

lmasroca and others added 24 commits October 22, 2025 17:12
…as CI currently fails otherwise"

This reverts commit 56a7462.
@lmasroca lmasroca requested a review from jgaleotti March 17, 2026 16:44
@lmasroca lmasroca requested a review from jgaleotti March 19, 2026 14:51
@lmasroca
Copy link
Collaborator Author

Looking into this failing check, the test generates a SqlCompositeGene which contains a ChoiceGene which contains an ArrayGene which starts empty but its template contains SqlForeignKeyGene. This generates no problems as long as the array is empty, but as soon as the array gets a random element everything stops being globally valid (in this case the new element, SqlForeignKeyGene is not globally valid as none of its parents in the chain are an SqlAction). The test filters globally invalid genes before randomizing but not after.

This happens on GeneRandomizedTest during verifyCopyValueFrom. We could add a globally valid check after randomization the same way it is done with printable checks, this makes the test pass. However, I am not sure if there should be checks in place to make this chain invalid even before randomizing instead.

    private fun verifyCopyValueFrom(
        mutable: List<Gene>,
        rand: Randomness
    ) {
        val printable = mutable.filter { it.isGloballyValid() && it.isPrintable() }

        printable.forEach { root ->

            val x = root.copy()
            val sx = x.getValueAsRawString()

            val y = x.copy().apply { randomize(rand, true) }
            if(!y.isPrintable()){ // we could add a globally valid check here the same way we filter before
                return@forEach
            }
            val sy = y.getValueAsRawString()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants