From 0c5604b462bfa5955edeac4a9bcb8d960ee39519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Sun, 15 Dec 2024 15:29:42 -0800 Subject: [PATCH] fix multiline string tests --- .../multiline_string_whitespace_only.kdl | 11 ++++++----- ...itespace_only_non_matching_prefix_fail.kdl | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 tests/test_cases/input/multiline_string_whitespace_only_non_matching_prefix_fail.kdl diff --git a/tests/test_cases/input/multiline_string_whitespace_only.kdl b/tests/test_cases/input/multiline_string_whitespace_only.kdl index d3bd045..db8fee5 100644 --- a/tests/test_cases/input/multiline_string_whitespace_only.kdl +++ b/tests/test_cases/input/multiline_string_whitespace_only.kdl @@ -1,18 +1,19 @@ // This file deliberately contains unusual whitespace -// The first two strings are empty +// The first three strings are empty, because whitespace-only lines collapse to +// just `\n`. node """   """ """    \ -    +        """ """ -    +      """\ \ // The next two strings contains only whitespace """    - +       \s    """ #""" -     +      """# diff --git a/tests/test_cases/input/multiline_string_whitespace_only_non_matching_prefix_fail.kdl b/tests/test_cases/input/multiline_string_whitespace_only_non_matching_prefix_fail.kdl new file mode 100644 index 0000000..29e36df --- /dev/null +++ b/tests/test_cases/input/multiline_string_whitespace_only_non_matching_prefix_fail.kdl @@ -0,0 +1,19 @@ +// This file deliberately contains unusual whitespace +// Parsing should fail because not all strings have a matching multiline prefix, +// which must be exact, down to the codepoint, _before_ newline normalization. +node """ +  """ """ +   \ +    +   """ """ +    + """\ + \ // The next two strings contains only whitespace + """ +    + +    \s +    """ #""" +     + + """#