Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iterateUnique() does not consider "a?b|c" equivalent to "(a?b)|c" #61

Closed
Kaljurand opened this issue Dec 26, 2020 · 0 comments · Fixed by #62
Closed

iterateUnique() does not consider "a?b|c" equivalent to "(a?b)|c" #61

Kaljurand opened this issue Dec 26, 2020 · 0 comments · Fixed by #62
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Kaljurand
Copy link

The optional "a" in the first pattern seems to confuse the generator to miss the "b". Adding brackets (2nd pattern) avoids the error.

import com.github.curiousoddman.rgxgen.RgxGen;

public class MyClass {
    
    public static void main(String args[]) {
        // "": WRONG
        System.out.println(new RgxGen("a?b|c").iterateUnique().next());
        // "b": OK
        System.out.println(new RgxGen("(a?b)|c").iterateUnique().next());
    }
}
@Kaljurand Kaljurand added the bug Something isn't working label Dec 26, 2020
@curious-odd-man curious-odd-man added this to the Version 1.4 milestone Dec 27, 2020
curious-odd-man added a commit that referenced this issue Dec 27, 2020
Fixed. Sequence was incorrectly visited for unique generation.
@curious-odd-man curious-odd-man linked a pull request Dec 27, 2020 that will close this issue
curious-odd-man added a commit that referenced this issue Jan 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants