From fafaa24bdd522453dc915309acca64deceee5e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Sch=C3=BCller?= Date: Fri, 29 Nov 2024 11:58:33 +0100 Subject: [PATCH] Add additional migration tests --- tests/test_cli_migration.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/test_cli_migration.py b/tests/test_cli_migration.py index df676ccfa..7acf05ab8 100644 --- a/tests/test_cli_migration.py +++ b/tests/test_cli_migration.py @@ -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}"'] @@ -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",