Skip to content

Commit f5503cc

Browse files
committed
Update tests to backslash escape changes
1 parent f96d9a5 commit f5503cc

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

tinycsscheme/tests/test_dumper.py

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def test_datafy_errors(stylesheet, expected_error):
9292

9393

9494
@pytest.mark.parametrize(('ruleset', 'expected_data'), [
95+
# declarations
9596
(RS('*', [DC('foreground', "#123456"),
9697
DC('someSetting', "yeah"),
9798
DC('anInteger', "2"),
@@ -107,16 +108,43 @@ def test_datafy_errors(stylesheet, expected_error):
107108
}}
108109
),
109110
110-
(RS("some other \nruleset '-' subtract \- more subtract",
111+
# string rules
112+
(RS("source",
111113
[DC('fontStyle', "bold"),
112114
],
113-
[SR('@name', "\"Test name\"")
115+
[SR('@name', "\"Test name\""),
116+
SR('@arbitrary', "\"just some string\"")
114117
]),
115118
{'name': "Test name",
116-
'scope': "some other ruleset - subtract - more subtract",
119+
'arbitrary': "just some string",
120+
'scope': "source",
117121
'settings': {
118122
'fontStyle': "bold",
119123
}}
124+
),
125+
126+
# whitespace stripping of selector
127+
(RS("some other \nruleset with.blank.lines",
128+
[]),
129+
{'scope': "some other ruleset with.blank.lines",
130+
'settings': {
131+
}}
132+
),
133+
134+
# escaped subtract operator (with legacy test)
135+
(RS("not '-' subtract, real \- subtract",
136+
[]),
137+
{'scope': "not '-' subtract, real - subtract",
138+
'settings': {
139+
}}
140+
),
141+
142+
# other escaped operators
143+
(RS(R"\(a \| b\) \- \(c \& b.f, j.\1\)",
144+
[]),
145+
{'scope': "(a | b) - (c & b.f, j.1)",
146+
'settings': {
147+
}}
120148
),
121149
])
122150
def test_datafy_ruleset(ruleset, expected_data):

0 commit comments

Comments
 (0)