fix: resolve CI/CD issues and linting errors
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
"""Test case generator for regex patterns."""
|
|
||||||
|
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
from typing import Optional, Callable
|
from typing import Optional
|
||||||
from .parser import parse_regex, RegexNode, NodeType
|
from .parser import parse_regex, RegexNode, NodeType
|
||||||
|
|
||||||
|
|
||||||
@@ -120,12 +118,13 @@ class TestCaseGenerator:
|
|||||||
"""Generate strings that do NOT match the pattern."""
|
"""Generate strings that do NOT match the pattern."""
|
||||||
try:
|
try:
|
||||||
ast = parse_regex(pattern, self.flavor)
|
ast = parse_regex(pattern, self.flavor)
|
||||||
return self._generate_non_matching_from_ast(ast, count, max_length)
|
return self._generate_non_matching_from_ast(pattern, ast, count, max_length)
|
||||||
except Exception:
|
except Exception:
|
||||||
return self._generate_fallback_non_matching(pattern, count)
|
return self._generate_fallback_non_matching(pattern, count)
|
||||||
|
|
||||||
def _generate_non_matching_from_ast(
|
def _generate_non_matching_from_ast(
|
||||||
self,
|
self,
|
||||||
|
pattern: str,
|
||||||
node: RegexNode,
|
node: RegexNode,
|
||||||
count: int,
|
count: int,
|
||||||
max_length: int
|
max_length: int
|
||||||
|
|||||||
Reference in New Issue
Block a user