Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for docstring with escape characters #416

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
SymbolTable(
our_types=[
ConstrainedPrimitive(
name='Non_empty_XML_serializable_string',
inheritances=[],
inheritance_id_set=...,
ancestors=[],
ancestor_id_set=...,
descendant_id_set=...,
constrainee='STR',
is_implementation_specific=False,
invariants=[],
invariant_id_set=...,
description=DescriptionOfOurType(
summary='<paragraph>Represent a string with at least one character.</paragraph>',
remarks=[
textwrap.dedent("""\
<paragraph>The string should also be serializable to XML, which is the background for
the following constraint.</paragraph>""")],
constraints_by_identifier=[
[
'AASd-130',
textwrap.dedent("""\
<field_body><paragraph>An attribute with data type "string" shall consist of these characters only:
<literal>^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\u00010000-\\u0010FFFF]*$</literal>.</paragraph></field_body>""")]],
parsed=...),
parsed=...)],
our_types_topologically_sorted=[
'Reference to our type Non_empty_XML_serializable_string'],
enumerations=[],
constrained_primitives=[
'Reference to our type Non_empty_XML_serializable_string'],
classes=[],
concrete_classes=[],
constants=[],
constants_by_name=...,
verification_functions=[],
verification_functions_by_name=...,
meta_model=MetaModel(
description=None,
version='dummy',
xml_namespace='https://dummy.com'))
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# We test for ``\x09`` and other special characters, and make sure they are represented
# adequately in the string dump of the symbol table.


class Non_empty_XML_serializable_string(str, DBC):
r"""
Represent a string with at least one character.

The string should also be serializable to XML, which is the background for
the following constraint.

:constraint AASd-130:

An attribute with data type "string" shall consist of these characters only:
``^[\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u00010000-\u0010FFFF]*$``.
"""


__version__ = "dummy"
__xml_namespace__ = "https://dummy.com"
Binary file not shown.
Loading