Skip to content

Commit

Permalink
More tests for backslash behaviour (#438)
Browse files Browse the repository at this point in the history
* More tests for baskslash behaviour

* Incorrect example of escaped final newline

* Test with non-literal indent
  • Loading branch information
tjol authored Dec 17, 2024
1 parent b9ddb52 commit 6906771
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_cases/expected_kdl/esc_multiple_newlines.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node "12"
1 change: 1 addition & 0 deletions tests/test_cases/expected_kdl/escline_alone.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions tests/test_cases/expected_kdl/escline_end_of_node.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a
b
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node "a\\ b\na\\b"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node "\"\"\""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node " a"
4 changes: 4 additions & 0 deletions tests/test_cases/input/esc_multiple_newlines.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node "1\


2"
1 change: 1 addition & 0 deletions tests/test_cases/input/escline_alone.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\
3 changes: 3 additions & 0 deletions tests/test_cases/input/escline_end_of_node.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a \

b
1 change: 1 addition & 0 deletions tests/test_cases/input/escline_node.kdl
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node1
\
node2
4 changes: 4 additions & 0 deletions tests/test_cases/input/multiline_string_double_backslash.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node """
a\\ b
a\\\ b
"""
3 changes: 3 additions & 0 deletions tests/test_cases/input/multiline_string_escape_delimiter.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node """
\"""
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node """
a
\
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node """
a
\
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node """
\s escaped prefix
literal prefix
"""

0 comments on commit 6906771

Please sign in to comment.