Skip to content

Commit

Permalink
Add additional migration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
schuellc-nvidia committed Nov 29, 2024
1 parent 9a6c95e commit fafaa24
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/test_cli_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ def test_flow_start_uid_replacement(self):
expected_output = ["flow_instance_uid: 12345"]
assert convert_colang_2alpha_syntax(input_lines) == expected_output

def test_regex_replacement(self):
def test_regex_replacement_1(self):
input_lines = ['r"(?i).*({{$text}})((\s*\w+\s*){0,2})\W*$"']
expected_output = ['regex("((?i).*({{$text}})((\\s*\\w+\\s*){0,2})\\W*$)")']
assert convert_colang_2alpha_syntax(input_lines) == expected_output

def test_regex_replacement_2(self):
input_lines = ["r'(?i).*({{$text}})((\s*\w+\s*){0,2})\W*$'"]
expected_output = ["regex('((?i).*({{$text}})((\\s*\\w+\\s*){0,2})\\W*$)')"]
assert convert_colang_2alpha_syntax(input_lines) == expected_output

def test_curly_braces_replacement(self):
input_lines = ['"{{variable}}"']
expected_output = ['"{variable}"']
Expand All @@ -49,11 +54,16 @@ def test_findall_replacement(self):
expected_output = ["find_all matches"]
assert convert_colang_2alpha_syntax(input_lines) == expected_output

def test_triple_quotes_replacement(self):
def test_triple_quotes_replacement_1(self):
input_lines = ['$ """some text"""']
expected_output = ['$ ..."some text"']
assert convert_colang_2alpha_syntax(input_lines) == expected_output

def test_triple_quotes_replacement_2(self):
input_lines = ["$ '''some text'''"]
expected_output = ["$ ...'some text'"]
assert convert_colang_2alpha_syntax(input_lines) == expected_output

def test_specific_phrases_replacement(self):
input_lines = [
"catch colang errors",
Expand Down

0 comments on commit fafaa24

Please sign in to comment.