Skip to content

Commit

Permalink
Merge pull request strictdoc-project#1904 from haxtibal/tdmg/uid_rege…
Browse files Browse the repository at this point in the history
…x_parantheses

Add parentheses to UID regex
  • Loading branch information
stanislaw authored Jun 30, 2024
2 parents be1f544 + 68b4eff commit 77465c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion strictdoc/backend/sdoc/grammar/grammar.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
REGEX_UID = r"([\w]+[\w\-. ]*)"
REGEX_UID = r"([\w]+[\w()\-. ]*)"

NEGATIVE_MULTILINE_STRING_START = "(?!>>>\n)"
NEGATIVE_MULTILINE_STRING_END = "(?!^<<<)"
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/strictdoc/backend/sdoc/test_dsl_passthrough.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,13 @@ def test_022_requirement_uid_and_link():
TITLE: Test Doc
[REQUIREMENT]
UID: With spaces and _ and - and . and non latin 特点
UID: With spaces and (_-.) and non latin 特点
STATEMENT: >>>
This is a statement.
[TEXT]
STATEMENT: >>>
[LINK: With spaces and _ and - and . and non latin 特点]
[LINK: With spaces and (_-.) and non latin 特点]
<<<
""".lstrip()

Expand Down Expand Up @@ -976,7 +976,7 @@ def test_edge_case_03_uid_present_but_empty_with_space_character():
_ = reader.read(input_sdoc)

assert exc_info.type is TextXSyntaxError
assert "Expected '([\\w]+[\\w\\-. ]*)'" in exc_info.value.args[0].decode(
assert "Expected '([\\w]+[\\w()\\-. ]*)'" in exc_info.value.args[0].decode(
"utf-8"
)

Expand All @@ -997,7 +997,7 @@ def test_edge_case_04_uid_present_but_empty_with_two_space_characters():
_ = reader.read(input_sdoc)

assert exc_info.type is TextXSyntaxError
assert "Expected '([\\w]+[\\w\\-. ]*)'" in exc_info.value.args[0].decode(
assert "Expected '([\\w]+[\\w()\\-. ]*)'" in exc_info.value.args[0].decode(
"utf-8"
)

Expand All @@ -1021,8 +1021,8 @@ def test_edge_case_10_empty_multiline_field():
assert (
"Expected '^\\[ANCHOR: ' or '[LINK: ' or "
"'(?ms)(?!^<<<)(?!^\\[\\/FREETEXT\\]\\n)(?!\\[LINK: "
"([\\w]+[\\w\\-. ]*))(?!^\\[ANCHOR: "
"([\\w]+[\\w\\-. ]*)).'" in exc_info.value.args[0].decode("utf-8")
"([\\w]+[\\w()\\-. ]*))(?!^\\[ANCHOR: "
"([\\w]+[\\w()\\-. ]*)).'" in exc_info.value.args[0].decode("utf-8")
)


Expand Down

0 comments on commit 77465c7

Please sign in to comment.