Skip to content

RegexValue provider throws IllegalArgumentException #2453

Open
@tamarinvs19

Description

@tamarinvs19

Description

RegexValue can throw IllegalArgumentException if maxLength argument less (or default random value less) then minimal length of pattern.

To Reproduce

Steps to reproduce the behavior:

  1. Try to run this code (maxLength less then length of regex pattern):
RegexValue("""COMPLETED:\g<1>T120000Z""", Random(0), 16).valueProvider()

Expected behavior

Valid value provider

Actual behavior

Exception IllegalArgumentException

Visual proofs (screenshots, logs, images)

Exception in thread "main" java.lang.IllegalArgumentException: Length cannot be less than 22
	at org.cornutum.regexpgen.Bounds.clippedTo(Bounds.java:72)
	at org.cornutum.regexpgen.RegExpGen.effectiveLength(RegExpGen.java:89)
	at org.cornutum.regexpgen.js.AbstractRegExpGen.generate(AbstractRegExpGen.java:102)
	at org.cornutum.regexpgen.RegExpGen.generate(RegExpGen.java:61)
	at org.utbot.fuzzing.seeds.RegexValue$1.invoke(RegexValue.kt:16)
	at org.utbot.fuzzing.seeds.RegexValue$1.invoke(RegexValue.kt:14)
	at org.utbot.fuzzing.seeds.RegexValueKt.main(RegexValue.kt:38)
	at org.utbot.fuzzing.seeds.RegexValueKt.main(RegexValue.kt)

Metadata

Metadata

Assignees

Labels

comp-fuzzingIssue is related to the fuzzingctg-bugIssue is a bug

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions