haml 3.0.25 → 3.1.0.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of haml might be problematic. Click here for more details.
- data/.yardopts +1 -1
- data/CONTRIBUTING +0 -1
- data/EDGE_GEM_VERSION +1 -0
- data/MIT-LICENSE +1 -1
- data/README.md +10 -175
- data/Rakefile +56 -84
- data/VERSION +1 -1
- data/VERSION_NAME +1 -1
- data/init.rb +1 -1
- data/lib/haml.rb +14 -12
- data/lib/haml/engine.rb +1 -1
- data/lib/haml/exec.rb +19 -316
- data/lib/haml/helpers/action_view_extensions.rb +1 -1
- data/lib/haml/html.rb +69 -76
- data/lib/haml/precompiler.rb +34 -41
- data/lib/haml/railtie.rb +4 -6
- data/lib/haml/template/plugin.rb +6 -16
- data/lib/haml/util.rb +91 -107
- data/lib/haml/version.rb +7 -0
- data/test/benchmark.rb +2 -9
- data/test/haml/engine_test.rb +195 -92
- data/test/haml/html2haml/erb_tests.rb +0 -14
- data/test/haml/util_test.rb +32 -0
- data/test/test_helper.rb +0 -39
- metadata +96 -324
- data/bin/css2sass +0 -13
- data/bin/sass +0 -8
- data/bin/sass-convert +0 -7
- data/extra/haml-mode.el +0 -753
- data/extra/sass-mode.el +0 -207
- data/lib/haml/util/subset_map.rb +0 -101
- data/lib/sass.rb +0 -29
- data/lib/sass/callbacks.rb +0 -52
- data/lib/sass/css.rb +0 -294
- data/lib/sass/engine.rb +0 -720
- data/lib/sass/environment.rb +0 -143
- data/lib/sass/error.rb +0 -198
- data/lib/sass/files.rb +0 -160
- data/lib/sass/less.rb +0 -382
- data/lib/sass/plugin.rb +0 -279
- data/lib/sass/plugin/configuration.rb +0 -221
- data/lib/sass/plugin/generic.rb +0 -15
- data/lib/sass/plugin/merb.rb +0 -37
- data/lib/sass/plugin/rack.rb +0 -47
- data/lib/sass/plugin/rails.rb +0 -32
- data/lib/sass/plugin/staleness_checker.rb +0 -123
- data/lib/sass/repl.rb +0 -58
- data/lib/sass/script.rb +0 -63
- data/lib/sass/script/bool.rb +0 -18
- data/lib/sass/script/color.rb +0 -491
- data/lib/sass/script/css_lexer.rb +0 -29
- data/lib/sass/script/css_parser.rb +0 -31
- data/lib/sass/script/funcall.rb +0 -77
- data/lib/sass/script/functions.rb +0 -861
- data/lib/sass/script/interpolation.rb +0 -70
- data/lib/sass/script/lexer.rb +0 -337
- data/lib/sass/script/literal.rb +0 -236
- data/lib/sass/script/node.rb +0 -112
- data/lib/sass/script/number.rb +0 -423
- data/lib/sass/script/operation.rb +0 -95
- data/lib/sass/script/parser.rb +0 -401
- data/lib/sass/script/string.rb +0 -67
- data/lib/sass/script/string_interpolation.rb +0 -93
- data/lib/sass/script/unary_operation.rb +0 -57
- data/lib/sass/script/variable.rb +0 -48
- data/lib/sass/scss.rb +0 -17
- data/lib/sass/scss/css_parser.rb +0 -46
- data/lib/sass/scss/parser.rb +0 -855
- data/lib/sass/scss/rx.rb +0 -126
- data/lib/sass/scss/sass_parser.rb +0 -11
- data/lib/sass/scss/script_lexer.rb +0 -15
- data/lib/sass/scss/script_parser.rb +0 -25
- data/lib/sass/scss/static_parser.rb +0 -40
- data/lib/sass/selector.rb +0 -361
- data/lib/sass/selector/abstract_sequence.rb +0 -62
- data/lib/sass/selector/comma_sequence.rb +0 -82
- data/lib/sass/selector/sequence.rb +0 -237
- data/lib/sass/selector/simple.rb +0 -113
- data/lib/sass/selector/simple_sequence.rb +0 -136
- data/lib/sass/tree/charset_node.rb +0 -37
- data/lib/sass/tree/comment_node.rb +0 -128
- data/lib/sass/tree/debug_node.rb +0 -36
- data/lib/sass/tree/directive_node.rb +0 -75
- data/lib/sass/tree/extend_node.rb +0 -65
- data/lib/sass/tree/for_node.rb +0 -55
- data/lib/sass/tree/if_node.rb +0 -69
- data/lib/sass/tree/import_node.rb +0 -102
- data/lib/sass/tree/mixin_def_node.rb +0 -48
- data/lib/sass/tree/mixin_node.rb +0 -111
- data/lib/sass/tree/node.rb +0 -464
- data/lib/sass/tree/prop_node.rb +0 -220
- data/lib/sass/tree/root_node.rb +0 -163
- data/lib/sass/tree/rule_node.rb +0 -261
- data/lib/sass/tree/variable_node.rb +0 -39
- data/lib/sass/tree/warn_node.rb +0 -42
- data/lib/sass/tree/while_node.rb +0 -36
- data/test/haml/util/subset_map_test.rb +0 -91
- data/test/sass/callbacks_test.rb +0 -61
- data/test/sass/conversion_test.rb +0 -1218
- data/test/sass/css2sass_test.rb +0 -364
- data/test/sass/data/hsl-rgb.txt +0 -319
- data/test/sass/engine_test.rb +0 -2267
- data/test/sass/extend_test.rb +0 -1348
- data/test/sass/functions_test.rb +0 -556
- data/test/sass/less_conversion_test.rb +0 -653
- data/test/sass/more_results/more1.css +0 -9
- data/test/sass/more_results/more1_with_line_comments.css +0 -26
- data/test/sass/more_results/more_import.css +0 -29
- data/test/sass/more_templates/_more_partial.sass +0 -2
- data/test/sass/more_templates/more1.sass +0 -23
- data/test/sass/more_templates/more_import.sass +0 -11
- data/test/sass/plugin_test.rb +0 -433
- data/test/sass/results/alt.css +0 -4
- data/test/sass/results/basic.css +0 -9
- data/test/sass/results/compact.css +0 -5
- data/test/sass/results/complex.css +0 -86
- data/test/sass/results/compressed.css +0 -1
- data/test/sass/results/expanded.css +0 -19
- data/test/sass/results/import.css +0 -31
- data/test/sass/results/import_charset.css +0 -4
- data/test/sass/results/import_charset_1_8.css +0 -4
- data/test/sass/results/import_charset_ibm866.css +0 -4
- data/test/sass/results/line_numbers.css +0 -49
- data/test/sass/results/mixins.css +0 -95
- data/test/sass/results/multiline.css +0 -24
- data/test/sass/results/nested.css +0 -22
- data/test/sass/results/options.css +0 -1
- data/test/sass/results/parent_ref.css +0 -13
- data/test/sass/results/script.css +0 -16
- data/test/sass/results/scss_import.css +0 -31
- data/test/sass/results/scss_importee.css +0 -2
- data/test/sass/results/subdir/nested_subdir/nested_subdir.css +0 -1
- data/test/sass/results/subdir/subdir.css +0 -3
- data/test/sass/results/units.css +0 -11
- data/test/sass/results/warn.css +0 -0
- data/test/sass/results/warn_imported.css +0 -0
- data/test/sass/script_conversion_test.rb +0 -314
- data/test/sass/script_test.rb +0 -470
- data/test/sass/scss/css_test.rb +0 -916
- data/test/sass/scss/rx_test.rb +0 -156
- data/test/sass/scss/scss_test.rb +0 -1122
- data/test/sass/scss/test_helper.rb +0 -37
- data/test/sass/templates/_imported_charset_ibm866.sass +0 -4
- data/test/sass/templates/_imported_charset_utf8.sass +0 -4
- data/test/sass/templates/_partial.sass +0 -2
- data/test/sass/templates/alt.sass +0 -16
- data/test/sass/templates/basic.sass +0 -23
- data/test/sass/templates/bork1.sass +0 -2
- data/test/sass/templates/bork2.sass +0 -2
- data/test/sass/templates/bork3.sass +0 -2
- data/test/sass/templates/bork4.sass +0 -2
- data/test/sass/templates/compact.sass +0 -17
- data/test/sass/templates/complex.sass +0 -305
- data/test/sass/templates/compressed.sass +0 -15
- data/test/sass/templates/expanded.sass +0 -17
- data/test/sass/templates/import.sass +0 -12
- data/test/sass/templates/import_charset.sass +0 -7
- data/test/sass/templates/import_charset_1_8.sass +0 -4
- data/test/sass/templates/import_charset_ibm866.sass +0 -9
- data/test/sass/templates/importee.less +0 -2
- data/test/sass/templates/importee.sass +0 -19
- data/test/sass/templates/line_numbers.sass +0 -13
- data/test/sass/templates/mixin_bork.sass +0 -5
- data/test/sass/templates/mixins.sass +0 -76
- data/test/sass/templates/multiline.sass +0 -20
- data/test/sass/templates/nested.sass +0 -25
- data/test/sass/templates/nested_bork1.sass +0 -2
- data/test/sass/templates/nested_bork2.sass +0 -2
- data/test/sass/templates/nested_bork3.sass +0 -2
- data/test/sass/templates/nested_bork4.sass +0 -2
- data/test/sass/templates/nested_mixin_bork.sass +0 -6
- data/test/sass/templates/options.sass +0 -2
- data/test/sass/templates/parent_ref.sass +0 -25
- data/test/sass/templates/script.sass +0 -101
- data/test/sass/templates/scss_import.scss +0 -11
- data/test/sass/templates/scss_importee.scss +0 -1
- data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +0 -2
- data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +0 -3
- data/test/sass/templates/subdir/subdir.sass +0 -6
- data/test/sass/templates/units.sass +0 -11
- data/test/sass/templates/warn.sass +0 -3
- data/test/sass/templates/warn_imported.sass +0 -4
- data/vendor/fssm/LICENSE +0 -20
- data/vendor/fssm/README.markdown +0 -55
- data/vendor/fssm/Rakefile +0 -59
- data/vendor/fssm/VERSION.yml +0 -5
- data/vendor/fssm/example.rb +0 -9
- data/vendor/fssm/fssm.gemspec +0 -77
- data/vendor/fssm/lib/fssm.rb +0 -33
- data/vendor/fssm/lib/fssm/backends/fsevents.rb +0 -36
- data/vendor/fssm/lib/fssm/backends/inotify.rb +0 -26
- data/vendor/fssm/lib/fssm/backends/polling.rb +0 -25
- data/vendor/fssm/lib/fssm/backends/rubycocoa/fsevents.rb +0 -131
- data/vendor/fssm/lib/fssm/monitor.rb +0 -26
- data/vendor/fssm/lib/fssm/path.rb +0 -91
- data/vendor/fssm/lib/fssm/pathname.rb +0 -502
- data/vendor/fssm/lib/fssm/state/directory.rb +0 -57
- data/vendor/fssm/lib/fssm/state/file.rb +0 -24
- data/vendor/fssm/lib/fssm/support.rb +0 -63
- data/vendor/fssm/lib/fssm/tree.rb +0 -176
- data/vendor/fssm/profile/prof-cache.rb +0 -40
- data/vendor/fssm/profile/prof-fssm-pathname.html +0 -1231
- data/vendor/fssm/profile/prof-pathname.rb +0 -68
- data/vendor/fssm/profile/prof-plain-pathname.html +0 -988
- data/vendor/fssm/profile/prof.html +0 -2379
- data/vendor/fssm/spec/path_spec.rb +0 -75
- data/vendor/fssm/spec/root/duck/quack.txt +0 -0
- data/vendor/fssm/spec/root/file.css +0 -0
- data/vendor/fssm/spec/root/file.rb +0 -0
- data/vendor/fssm/spec/root/file.yml +0 -0
- data/vendor/fssm/spec/root/moo/cow.txt +0 -0
- data/vendor/fssm/spec/spec_helper.rb +0 -14
data/test/sass/css2sass_test.rb
DELETED
@@ -1,364 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'test/unit'
|
3
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
4
|
-
require 'sass/css'
|
5
|
-
|
6
|
-
class CSS2SassTest < Test::Unit::TestCase
|
7
|
-
def test_basic
|
8
|
-
css = <<CSS
|
9
|
-
h1 {
|
10
|
-
color: red;
|
11
|
-
}
|
12
|
-
CSS
|
13
|
-
assert_equal(<<SASS, css2sass(css))
|
14
|
-
h1
|
15
|
-
color: red
|
16
|
-
SASS
|
17
|
-
assert_equal(<<SASS, css2sass(css, :old => true))
|
18
|
-
h1
|
19
|
-
:color red
|
20
|
-
SASS
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_nesting
|
24
|
-
assert_equal(<<SASS, css2sass(<<CSS))
|
25
|
-
li
|
26
|
-
display: none
|
27
|
-
a
|
28
|
-
text-decoration: none
|
29
|
-
span
|
30
|
-
color: yellow
|
31
|
-
&:hover
|
32
|
-
text-decoration: underline
|
33
|
-
SASS
|
34
|
-
li {
|
35
|
-
display: none;
|
36
|
-
}
|
37
|
-
|
38
|
-
li a {
|
39
|
-
text-decoration: none;
|
40
|
-
}
|
41
|
-
|
42
|
-
li a span {
|
43
|
-
color: yellow;
|
44
|
-
}
|
45
|
-
|
46
|
-
li a:hover {
|
47
|
-
text-decoration: underline;
|
48
|
-
}
|
49
|
-
CSS
|
50
|
-
end
|
51
|
-
|
52
|
-
def test_no_nesting_around_rules
|
53
|
-
assert_equal(<<SASS, css2sass(<<CSS))
|
54
|
-
div .warning
|
55
|
-
color: #d21a19
|
56
|
-
|
57
|
-
span .debug
|
58
|
-
cursor: crosshair
|
59
|
-
|
60
|
-
div .debug
|
61
|
-
cursor: default
|
62
|
-
SASS
|
63
|
-
div .warning {
|
64
|
-
color: #d21a19; }
|
65
|
-
span .debug {
|
66
|
-
cursor: crosshair;}
|
67
|
-
div .debug {
|
68
|
-
cursor: default; }
|
69
|
-
CSS
|
70
|
-
end
|
71
|
-
|
72
|
-
def test_comments_multiline
|
73
|
-
css = <<CSS
|
74
|
-
/* comment */
|
75
|
-
elephant.rawr {
|
76
|
-
rampages: excessively;
|
77
|
-
}
|
78
|
-
|
79
|
-
/* actual multiline
|
80
|
-
comment */
|
81
|
-
span.turkey {
|
82
|
-
isdinner: true;
|
83
|
-
}
|
84
|
-
|
85
|
-
.turducken {
|
86
|
-
/* Sounds funny
|
87
|
-
doesn't it */
|
88
|
-
chimera: not_really;
|
89
|
-
}
|
90
|
-
|
91
|
-
#overhere {
|
92
|
-
bored: sorta; /* it's for a good
|
93
|
-
cause */
|
94
|
-
better_than: thread_pools;
|
95
|
-
}
|
96
|
-
|
97
|
-
#one_more {
|
98
|
-
finally: srsly;
|
99
|
-
} /* just a line here */
|
100
|
-
CSS
|
101
|
-
sass = <<SASS
|
102
|
-
/* comment
|
103
|
-
|
104
|
-
elephant.rawr
|
105
|
-
rampages: excessively
|
106
|
-
|
107
|
-
/* actual multiline
|
108
|
-
*comment
|
109
|
-
|
110
|
-
span.turkey
|
111
|
-
isdinner: true
|
112
|
-
|
113
|
-
.turducken
|
114
|
-
/* Sounds funny
|
115
|
-
* doesn't it
|
116
|
-
chimera: not_really
|
117
|
-
|
118
|
-
#overhere
|
119
|
-
bored: sorta
|
120
|
-
/* it's for a good
|
121
|
-
* cause
|
122
|
-
better_than: thread_pools
|
123
|
-
|
124
|
-
#one_more
|
125
|
-
finally: srsly
|
126
|
-
|
127
|
-
/* just a line here
|
128
|
-
SASS
|
129
|
-
assert_equal(sass, css2sass(css))
|
130
|
-
end
|
131
|
-
|
132
|
-
def test_fold_commas
|
133
|
-
assert_equal(<<SASS, css2sass(<<CSS))
|
134
|
-
li
|
135
|
-
.one, .two
|
136
|
-
color: red
|
137
|
-
SASS
|
138
|
-
li .one {
|
139
|
-
color: red;
|
140
|
-
}
|
141
|
-
li .two {
|
142
|
-
color: red;
|
143
|
-
}
|
144
|
-
CSS
|
145
|
-
|
146
|
-
assert_equal(<<SASS, css2sass(<<CSS))
|
147
|
-
.one
|
148
|
-
color: green
|
149
|
-
|
150
|
-
.two
|
151
|
-
color: green
|
152
|
-
color: red
|
153
|
-
|
154
|
-
.three
|
155
|
-
color: red
|
156
|
-
SASS
|
157
|
-
.one, .two {
|
158
|
-
color: green;
|
159
|
-
}
|
160
|
-
|
161
|
-
.two, .three {
|
162
|
-
color: red;
|
163
|
-
}
|
164
|
-
CSS
|
165
|
-
end
|
166
|
-
|
167
|
-
def test_bad_formatting
|
168
|
-
assert_equal(<<SASS, css2sass(<<CSS))
|
169
|
-
hello
|
170
|
-
parent: true
|
171
|
-
there
|
172
|
-
parent: false
|
173
|
-
who
|
174
|
-
hoo: false
|
175
|
-
why
|
176
|
-
y: true
|
177
|
-
when
|
178
|
-
wen: nao
|
179
|
-
|
180
|
-
down_here
|
181
|
-
yeah: true
|
182
|
-
SASS
|
183
|
-
hello {
|
184
|
-
parent: true;
|
185
|
-
}
|
186
|
-
|
187
|
-
hello there {
|
188
|
-
parent: false;
|
189
|
-
}
|
190
|
-
hello who {
|
191
|
-
hoo: false;
|
192
|
-
}
|
193
|
-
hello why {
|
194
|
-
y: true;
|
195
|
-
}
|
196
|
-
hello when {
|
197
|
-
wen: nao;
|
198
|
-
}
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
down_here { yeah: true; }
|
203
|
-
CSS
|
204
|
-
end
|
205
|
-
|
206
|
-
def test_comments_in_selectors
|
207
|
-
assert_equal(<<SASS, css2sass(<<CSS))
|
208
|
-
.js
|
209
|
-
#location-navigation-form .form-submit, #business-listing-form .form-submit, #detailTabs ul, #detailsEnhanced #addTags, #locationSearchList, #moreHoods
|
210
|
-
display: none
|
211
|
-
|
212
|
-
#navListLeft
|
213
|
-
display: none
|
214
|
-
SASS
|
215
|
-
.js #location-navigation-form .form-submit,
|
216
|
-
.js #business-listing-form .form-submit,
|
217
|
-
.js #detailTabs ul,
|
218
|
-
/* .js #addReview, */
|
219
|
-
/* .js #addTags, */
|
220
|
-
.js #detailsEnhanced #addTags,
|
221
|
-
.js #locationSearchList,
|
222
|
-
.js #moreHoods,
|
223
|
-
#navListLeft
|
224
|
-
{ display: none; }
|
225
|
-
CSS
|
226
|
-
end
|
227
|
-
|
228
|
-
def test_pseudo_classes_are_escaped
|
229
|
-
assert_equal(<<SASS, css2sass(<<CSS))
|
230
|
-
\\:focus
|
231
|
-
a: b
|
232
|
-
\\:foo
|
233
|
-
bar: baz
|
234
|
-
SASS
|
235
|
-
:focus {a: b;}
|
236
|
-
:focus :foo {bar: baz;}
|
237
|
-
CSS
|
238
|
-
end
|
239
|
-
|
240
|
-
# Regressions
|
241
|
-
|
242
|
-
def test_nesting_within_media
|
243
|
-
assert_equal(<<SASS, css2sass(<<CSS))
|
244
|
-
@media all
|
245
|
-
.next .vevent
|
246
|
-
padding-left: 0
|
247
|
-
padding-right: 0
|
248
|
-
SASS
|
249
|
-
@media all {
|
250
|
-
.next .vevent {
|
251
|
-
padding-left: 0;
|
252
|
-
padding-right: 0; } }
|
253
|
-
CSS
|
254
|
-
end
|
255
|
-
|
256
|
-
def test_multiline_selector_within_media_and_with_child_selector
|
257
|
-
assert_equal(<<SASS, css2sass(<<CSS))
|
258
|
-
@media all
|
259
|
-
foo bar, baz
|
260
|
-
padding-left: 0
|
261
|
-
padding-right: 0
|
262
|
-
SASS
|
263
|
-
@media all {
|
264
|
-
foo bar,
|
265
|
-
baz {
|
266
|
-
padding-left: 0;
|
267
|
-
padding-right: 0; } }
|
268
|
-
CSS
|
269
|
-
end
|
270
|
-
|
271
|
-
# Error reporting
|
272
|
-
|
273
|
-
def test_error_reporting
|
274
|
-
css2sass("foo")
|
275
|
-
assert(false, "Expected exception")
|
276
|
-
rescue Sass::SyntaxError => err
|
277
|
-
assert_equal(1, err.sass_line)
|
278
|
-
assert_equal('Invalid CSS after "foo": expected "{", was ""', err.message)
|
279
|
-
end
|
280
|
-
|
281
|
-
def test_error_reporting_in_line
|
282
|
-
css2sass("foo\nbar }\nbaz")
|
283
|
-
assert(false, "Expected exception")
|
284
|
-
rescue Sass::SyntaxError => err
|
285
|
-
assert_equal(2, err.sass_line)
|
286
|
-
assert_equal('Invalid CSS after "bar ": expected "{", was "}"', err.message)
|
287
|
-
end
|
288
|
-
|
289
|
-
def test_error_truncate_after
|
290
|
-
css2sass("#{"a" * 16}foo")
|
291
|
-
assert(false, "Expected exception")
|
292
|
-
rescue Sass::SyntaxError => err
|
293
|
-
assert_equal(1, err.sass_line)
|
294
|
-
assert_equal('Invalid CSS after "...aaaaaaaaaaaafoo": expected "{", was ""', err.message)
|
295
|
-
end
|
296
|
-
|
297
|
-
def test_error_truncate_was
|
298
|
-
css2sass("foo }foo#{"a" * 15}")
|
299
|
-
assert(false, "Expected exception")
|
300
|
-
rescue Sass::SyntaxError => err
|
301
|
-
assert_equal(1, err.sass_line)
|
302
|
-
assert_equal('Invalid CSS after "foo ": expected "{", was "}fooaaaaaaaaaaa..."', err.message)
|
303
|
-
end
|
304
|
-
|
305
|
-
def test_error_doesnt_truncate_after_when_elipsis_would_add_length
|
306
|
-
css2sass("#{"a" * 15}foo")
|
307
|
-
assert(false, "Expected exception")
|
308
|
-
rescue Sass::SyntaxError => err
|
309
|
-
assert_equal(1, err.sass_line)
|
310
|
-
assert_equal('Invalid CSS after "aaaaaaaaaaaaaaafoo": expected "{", was ""', err.message)
|
311
|
-
end
|
312
|
-
|
313
|
-
def test_error_doesnt_truncate_was_when_elipsis_would_add_length
|
314
|
-
css2sass("foo }foo#{"a" * 14}")
|
315
|
-
assert(false, "Expected exception")
|
316
|
-
rescue Sass::SyntaxError => err
|
317
|
-
assert_equal(1, err.sass_line)
|
318
|
-
assert_equal('Invalid CSS after "foo ": expected "{", was "}fooaaaaaaaaaaaaaa"', err.message)
|
319
|
-
end
|
320
|
-
|
321
|
-
def test_error_gets_rid_of_trailing_newline_for_after
|
322
|
-
css2sass("foo \n ")
|
323
|
-
assert(false, "Expected exception")
|
324
|
-
rescue Sass::SyntaxError => err
|
325
|
-
assert_equal(2, err.sass_line)
|
326
|
-
assert_equal('Invalid CSS after "foo": expected "{", was ""', err.message)
|
327
|
-
end
|
328
|
-
|
329
|
-
def test_error_gets_rid_of_trailing_newline_for_was
|
330
|
-
css2sass("foo \n }foo")
|
331
|
-
assert(false, "Expected exception")
|
332
|
-
rescue Sass::SyntaxError => err
|
333
|
-
assert_equal(2, err.sass_line)
|
334
|
-
assert_equal('Invalid CSS after "foo": expected "{", was "}foo"', err.message)
|
335
|
-
end
|
336
|
-
|
337
|
-
# Encodings
|
338
|
-
|
339
|
-
unless Haml::Util.ruby1_8?
|
340
|
-
def test_encoding_error
|
341
|
-
css2sass("foo\nbar\nb\xFEaz".force_encoding("utf-8"))
|
342
|
-
assert(false, "Expected exception")
|
343
|
-
rescue Sass::SyntaxError => e
|
344
|
-
assert_equal(3, e.sass_line)
|
345
|
-
assert_equal('Invalid UTF-8 character "\xFE"', e.message)
|
346
|
-
end
|
347
|
-
|
348
|
-
def test_ascii_incompatible_encoding_error
|
349
|
-
template = "foo\nbar\nb_z".encode("utf-16le")
|
350
|
-
template[9] = "\xFE".force_encoding("utf-16le")
|
351
|
-
css2sass(template)
|
352
|
-
assert(false, "Expected exception")
|
353
|
-
rescue Sass::SyntaxError => e
|
354
|
-
assert_equal(3, e.sass_line)
|
355
|
-
assert_equal('Invalid UTF-16LE character "\xFE"', e.message)
|
356
|
-
end
|
357
|
-
end
|
358
|
-
|
359
|
-
private
|
360
|
-
|
361
|
-
def css2sass(string, opts={})
|
362
|
-
Sass::CSS.new(string, opts).render
|
363
|
-
end
|
364
|
-
end
|
data/test/sass/data/hsl-rgb.txt
DELETED
@@ -1,319 +0,0 @@
|
|
1
|
-
hsl(0, 100%, 50%)
|
2
|
-
hsl(60, 100%, 50%)
|
3
|
-
hsl(120, 100%, 50%)
|
4
|
-
hsl(180, 100%, 50%)
|
5
|
-
hsl(240, 100%, 50%)
|
6
|
-
hsl(300, 100%, 50%)
|
7
|
-
====
|
8
|
-
rgb(255, 0, 0)
|
9
|
-
rgb(255, 255, 0)
|
10
|
-
rgb(0, 255, 0)
|
11
|
-
rgb(0, 255, 255)
|
12
|
-
rgb(0, 0, 255)
|
13
|
-
rgb(255, 0, 255)
|
14
|
-
|
15
|
-
hsl(-360, 100%, 50%)
|
16
|
-
hsl(-300, 100%, 50%)
|
17
|
-
hsl(-240, 100%, 50%)
|
18
|
-
hsl(-180, 100%, 50%)
|
19
|
-
hsl(-120, 100%, 50%)
|
20
|
-
hsl(-60, 100%, 50%)
|
21
|
-
====
|
22
|
-
rgb(255, 0, 0)
|
23
|
-
rgb(255, 255, 0)
|
24
|
-
rgb(0, 255, 0)
|
25
|
-
rgb(0, 255, 255)
|
26
|
-
rgb(0, 0, 255)
|
27
|
-
rgb(255, 0, 255)
|
28
|
-
|
29
|
-
hsl(360, 100%, 50%)
|
30
|
-
hsl(420, 100%, 50%)
|
31
|
-
hsl(480, 100%, 50%)
|
32
|
-
hsl(540, 100%, 50%)
|
33
|
-
hsl(600, 100%, 50%)
|
34
|
-
hsl(660, 100%, 50%)
|
35
|
-
====
|
36
|
-
rgb(255, 0, 0)
|
37
|
-
rgb(255, 255, 0)
|
38
|
-
rgb(0, 255, 0)
|
39
|
-
rgb(0, 255, 255)
|
40
|
-
rgb(0, 0, 255)
|
41
|
-
rgb(255, 0, 255)
|
42
|
-
|
43
|
-
hsl(6120, 100%, 50%)
|
44
|
-
hsl(-9660, 100%, 50%)
|
45
|
-
hsl(99840, 100%, 50%)
|
46
|
-
hsl(-900, 100%, 50%)
|
47
|
-
hsl(-104880, 100%, 50%)
|
48
|
-
hsl(2820, 100%, 50%)
|
49
|
-
====
|
50
|
-
rgb(255, 0, 0)
|
51
|
-
rgb(255, 255, 0)
|
52
|
-
rgb(0, 255, 0)
|
53
|
-
rgb(0, 255, 255)
|
54
|
-
rgb(0, 0, 255)
|
55
|
-
rgb(255, 0, 255)
|
56
|
-
|
57
|
-
hsl(0, 100%, 50%)
|
58
|
-
hsl(12, 100%, 50%)
|
59
|
-
hsl(24, 100%, 50%)
|
60
|
-
hsl(36, 100%, 50%)
|
61
|
-
hsl(48, 100%, 50%)
|
62
|
-
hsl(60, 100%, 50%)
|
63
|
-
hsl(72, 100%, 50%)
|
64
|
-
hsl(84, 100%, 50%)
|
65
|
-
hsl(96, 100%, 50%)
|
66
|
-
hsl(108, 100%, 50%)
|
67
|
-
hsl(120, 100%, 50%)
|
68
|
-
====
|
69
|
-
rgb(255, 0, 0)
|
70
|
-
rgb(255, 51, 0)
|
71
|
-
rgb(255, 102, 0)
|
72
|
-
rgb(255, 153, 0)
|
73
|
-
rgb(255, 204, 0)
|
74
|
-
rgb(255, 255, 0)
|
75
|
-
rgb(204, 255, 0)
|
76
|
-
rgb(153, 255, 0)
|
77
|
-
rgb(102, 255, 0)
|
78
|
-
rgb(51, 255, 0)
|
79
|
-
rgb(0, 255, 0)
|
80
|
-
|
81
|
-
hsl(120, 100%, 50%)
|
82
|
-
hsl(132, 100%, 50%)
|
83
|
-
hsl(144, 100%, 50%)
|
84
|
-
hsl(156, 100%, 50%)
|
85
|
-
hsl(168, 100%, 50%)
|
86
|
-
hsl(180, 100%, 50%)
|
87
|
-
hsl(192, 100%, 50%)
|
88
|
-
hsl(204, 100%, 50%)
|
89
|
-
hsl(216, 100%, 50%)
|
90
|
-
hsl(228, 100%, 50%)
|
91
|
-
hsl(240, 100%, 50%)
|
92
|
-
====
|
93
|
-
rgb(0, 255, 0)
|
94
|
-
rgb(0, 255, 51)
|
95
|
-
rgb(0, 255, 102)
|
96
|
-
rgb(0, 255, 153)
|
97
|
-
rgb(0, 255, 204)
|
98
|
-
rgb(0, 255, 255)
|
99
|
-
rgb(0, 204, 255)
|
100
|
-
rgb(0, 153, 255)
|
101
|
-
rgb(0, 102, 255)
|
102
|
-
rgb(0, 51, 255)
|
103
|
-
rgb(0, 0, 255)
|
104
|
-
|
105
|
-
hsl(240, 100%, 50%)
|
106
|
-
hsl(252, 100%, 50%)
|
107
|
-
hsl(264, 100%, 50%)
|
108
|
-
hsl(276, 100%, 50%)
|
109
|
-
hsl(288, 100%, 50%)
|
110
|
-
hsl(300, 100%, 50%)
|
111
|
-
hsl(312, 100%, 50%)
|
112
|
-
hsl(324, 100%, 50%)
|
113
|
-
hsl(336, 100%, 50%)
|
114
|
-
hsl(348, 100%, 50%)
|
115
|
-
hsl(360, 100%, 50%)
|
116
|
-
====
|
117
|
-
rgb(0, 0, 255)
|
118
|
-
rgb(51, 0, 255)
|
119
|
-
rgb(102, 0, 255)
|
120
|
-
rgb(153, 0, 255)
|
121
|
-
rgb(204, 0, 255)
|
122
|
-
rgb(255, 0, 255)
|
123
|
-
rgb(255, 0, 204)
|
124
|
-
rgb(255, 0, 153)
|
125
|
-
rgb(255, 0, 102)
|
126
|
-
rgb(255, 0, 51)
|
127
|
-
rgb(255, 0, 0)
|
128
|
-
|
129
|
-
hsl(0, 20%, 50%)
|
130
|
-
hsl(0, 60%, 50%)
|
131
|
-
hsl(0, 100%, 50%)
|
132
|
-
====
|
133
|
-
rgb(153, 102, 102)
|
134
|
-
rgb(204, 51, 51)
|
135
|
-
rgb(255, 0, 0)
|
136
|
-
|
137
|
-
hsl(60, 20%, 50%)
|
138
|
-
hsl(60, 60%, 50%)
|
139
|
-
hsl(60, 100%, 50%)
|
140
|
-
====
|
141
|
-
rgb(153, 153, 102)
|
142
|
-
rgb(204, 204, 51)
|
143
|
-
rgb(255, 255, 0)
|
144
|
-
|
145
|
-
hsl(120, 20%, 50%)
|
146
|
-
hsl(120, 60%, 50%)
|
147
|
-
hsl(120, 100%, 50%)
|
148
|
-
====
|
149
|
-
rgb(102, 153, 102)
|
150
|
-
rgb(51, 204, 51)
|
151
|
-
rgb(0, 255, 0)
|
152
|
-
|
153
|
-
hsl(180, 20%, 50%)
|
154
|
-
hsl(180, 60%, 50%)
|
155
|
-
hsl(180, 100%, 50%)
|
156
|
-
====
|
157
|
-
rgb(102, 153, 153)
|
158
|
-
rgb(51, 204, 204)
|
159
|
-
rgb(0, 255, 255)
|
160
|
-
|
161
|
-
hsl(240, 20%, 50%)
|
162
|
-
hsl(240, 60%, 50%)
|
163
|
-
hsl(240, 100%, 50%)
|
164
|
-
====
|
165
|
-
rgb(102, 102, 153)
|
166
|
-
rgb(51, 51, 204)
|
167
|
-
rgb(0, 0, 255)
|
168
|
-
|
169
|
-
hsl(300, 20%, 50%)
|
170
|
-
hsl(300, 60%, 50%)
|
171
|
-
hsl(300, 100%, 50%)
|
172
|
-
====
|
173
|
-
rgb(153, 102, 153)
|
174
|
-
rgb(204, 51, 204)
|
175
|
-
rgb(255, 0, 255)
|
176
|
-
|
177
|
-
hsl(0, 100%, 0%)
|
178
|
-
hsl(0, 100%, 10%)
|
179
|
-
hsl(0, 100%, 20%)
|
180
|
-
hsl(0, 100%, 30%)
|
181
|
-
hsl(0, 100%, 40%)
|
182
|
-
hsl(0, 100%, 50%)
|
183
|
-
hsl(0, 100%, 60%)
|
184
|
-
hsl(0, 100%, 70%)
|
185
|
-
hsl(0, 100%, 80%)
|
186
|
-
hsl(0, 100%, 90%)
|
187
|
-
hsl(0, 100%, 100%)
|
188
|
-
====
|
189
|
-
rgb(0, 0, 0)
|
190
|
-
rgb(51, 0, 0)
|
191
|
-
rgb(102, 0, 0)
|
192
|
-
rgb(153, 0, 0)
|
193
|
-
rgb(204, 0, 0)
|
194
|
-
rgb(255, 0, 0)
|
195
|
-
rgb(255, 51, 51)
|
196
|
-
rgb(255, 102, 102)
|
197
|
-
rgb(255, 153, 153)
|
198
|
-
rgb(255, 204, 204)
|
199
|
-
rgb(255, 255, 255)
|
200
|
-
|
201
|
-
hsl(60, 100%, 0%)
|
202
|
-
hsl(60, 100%, 10%)
|
203
|
-
hsl(60, 100%, 20%)
|
204
|
-
hsl(60, 100%, 30%)
|
205
|
-
hsl(60, 100%, 40%)
|
206
|
-
hsl(60, 100%, 50%)
|
207
|
-
hsl(60, 100%, 60%)
|
208
|
-
hsl(60, 100%, 70%)
|
209
|
-
hsl(60, 100%, 80%)
|
210
|
-
hsl(60, 100%, 90%)
|
211
|
-
hsl(60, 100%, 100%)
|
212
|
-
====
|
213
|
-
rgb(0, 0, 0)
|
214
|
-
rgb(51, 51, 0)
|
215
|
-
rgb(102, 102, 0)
|
216
|
-
rgb(153, 153, 0)
|
217
|
-
rgb(204, 204, 0)
|
218
|
-
rgb(255, 255, 0)
|
219
|
-
rgb(255, 255, 51)
|
220
|
-
rgb(255, 255, 102)
|
221
|
-
rgb(255, 255, 153)
|
222
|
-
rgb(255, 255, 204)
|
223
|
-
rgb(255, 255, 255)
|
224
|
-
|
225
|
-
hsl(120, 100%, 0%)
|
226
|
-
hsl(120, 100%, 10%)
|
227
|
-
hsl(120, 100%, 20%)
|
228
|
-
hsl(120, 100%, 30%)
|
229
|
-
hsl(120, 100%, 40%)
|
230
|
-
hsl(120, 100%, 50%)
|
231
|
-
hsl(120, 100%, 60%)
|
232
|
-
hsl(120, 100%, 70%)
|
233
|
-
hsl(120, 100%, 80%)
|
234
|
-
hsl(120, 100%, 90%)
|
235
|
-
hsl(120, 100%, 100%)
|
236
|
-
====
|
237
|
-
rgb(0, 0, 0)
|
238
|
-
rgb(0, 51, 0)
|
239
|
-
rgb(0, 102, 0)
|
240
|
-
rgb(0, 153, 0)
|
241
|
-
rgb(0, 204, 0)
|
242
|
-
rgb(0, 255, 0)
|
243
|
-
rgb(51, 255, 51)
|
244
|
-
rgb(102, 255, 102)
|
245
|
-
rgb(153, 255, 153)
|
246
|
-
rgb(204, 255, 204)
|
247
|
-
rgb(255, 255, 255)
|
248
|
-
|
249
|
-
hsl(180, 100%, 0%)
|
250
|
-
hsl(180, 100%, 10%)
|
251
|
-
hsl(180, 100%, 20%)
|
252
|
-
hsl(180, 100%, 30%)
|
253
|
-
hsl(180, 100%, 40%)
|
254
|
-
hsl(180, 100%, 50%)
|
255
|
-
hsl(180, 100%, 60%)
|
256
|
-
hsl(180, 100%, 70%)
|
257
|
-
hsl(180, 100%, 80%)
|
258
|
-
hsl(180, 100%, 90%)
|
259
|
-
hsl(180, 100%, 100%)
|
260
|
-
====
|
261
|
-
rgb(0, 0, 0)
|
262
|
-
rgb(0, 51, 51)
|
263
|
-
rgb(0, 102, 102)
|
264
|
-
rgb(0, 153, 153)
|
265
|
-
rgb(0, 204, 204)
|
266
|
-
rgb(0, 255, 255)
|
267
|
-
rgb(51, 255, 255)
|
268
|
-
rgb(102, 255, 255)
|
269
|
-
rgb(153, 255, 255)
|
270
|
-
rgb(204, 255, 255)
|
271
|
-
rgb(255, 255, 255)
|
272
|
-
|
273
|
-
hsl(240, 100%, 0%)
|
274
|
-
hsl(240, 100%, 10%)
|
275
|
-
hsl(240, 100%, 20%)
|
276
|
-
hsl(240, 100%, 30%)
|
277
|
-
hsl(240, 100%, 40%)
|
278
|
-
hsl(240, 100%, 50%)
|
279
|
-
hsl(240, 100%, 60%)
|
280
|
-
hsl(240, 100%, 70%)
|
281
|
-
hsl(240, 100%, 80%)
|
282
|
-
hsl(240, 100%, 90%)
|
283
|
-
hsl(240, 100%, 100%)
|
284
|
-
====
|
285
|
-
rgb(0, 0, 0)
|
286
|
-
rgb(0, 0, 51)
|
287
|
-
rgb(0, 0, 102)
|
288
|
-
rgb(0, 0, 153)
|
289
|
-
rgb(0, 0, 204)
|
290
|
-
rgb(0, 0, 255)
|
291
|
-
rgb(51, 51, 255)
|
292
|
-
rgb(102, 102, 255)
|
293
|
-
rgb(153, 153, 255)
|
294
|
-
rgb(204, 204, 255)
|
295
|
-
rgb(255, 255, 255)
|
296
|
-
|
297
|
-
hsl(300, 100%, 0%)
|
298
|
-
hsl(300, 100%, 10%)
|
299
|
-
hsl(300, 100%, 20%)
|
300
|
-
hsl(300, 100%, 30%)
|
301
|
-
hsl(300, 100%, 40%)
|
302
|
-
hsl(300, 100%, 50%)
|
303
|
-
hsl(300, 100%, 60%)
|
304
|
-
hsl(300, 100%, 70%)
|
305
|
-
hsl(300, 100%, 80%)
|
306
|
-
hsl(300, 100%, 90%)
|
307
|
-
hsl(300, 100%, 100%)
|
308
|
-
====
|
309
|
-
rgb(0, 0, 0)
|
310
|
-
rgb(51, 0, 51)
|
311
|
-
rgb(102, 0, 102)
|
312
|
-
rgb(153, 0, 153)
|
313
|
-
rgb(204, 0, 204)
|
314
|
-
rgb(255, 0, 255)
|
315
|
-
rgb(255, 51, 255)
|
316
|
-
rgb(255, 102, 255)
|
317
|
-
rgb(255, 153, 255)
|
318
|
-
rgb(255, 204, 255)
|
319
|
-
rgb(255, 255, 255)
|