@@ -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 \n ruleset '-' 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 \n ruleset 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])
122150def test_datafy_ruleset (ruleset , expected_data ):
0 commit comments