sass 3.4.25 → 3.5.0.pre.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/README.md +1 -1
- data/Rakefile +13 -157
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/VERSION_NAME +1 -1
- data/lib/sass.rb +3 -10
- data/lib/sass/cache_stores/filesystem.rb +1 -1
- data/lib/sass/css.rb +2 -3
- data/lib/sass/engine.rb +46 -32
- data/lib/sass/environment.rb +27 -6
- data/lib/sass/error.rb +5 -5
- data/lib/sass/exec/base.rb +3 -12
- data/lib/sass/features.rb +1 -0
- data/lib/sass/importers/filesystem.rb +2 -2
- data/lib/sass/plugin.rb +1 -1
- data/lib/sass/plugin/compiler.rb +21 -51
- data/lib/sass/plugin/configuration.rb +1 -1
- data/lib/sass/plugin/rack.rb +3 -3
- data/lib/sass/plugin/staleness_checker.rb +3 -3
- data/lib/sass/railtie.rb +1 -1
- data/lib/sass/script.rb +3 -3
- data/lib/sass/script/functions.rb +238 -47
- data/lib/sass/script/lexer.rb +8 -6
- data/lib/sass/script/parser.rb +76 -75
- data/lib/sass/script/tree/funcall.rb +35 -30
- data/lib/sass/script/tree/list_literal.rb +23 -8
- data/lib/sass/script/tree/map_literal.rb +2 -2
- data/lib/sass/script/tree/node.rb +2 -10
- data/lib/sass/script/tree/operation.rb +16 -50
- data/lib/sass/script/value.rb +2 -0
- data/lib/sass/script/value/arg_list.rb +1 -1
- data/lib/sass/script/value/base.rb +20 -3
- data/lib/sass/script/value/callable.rb +25 -0
- data/lib/sass/script/value/color.rb +10 -10
- data/lib/sass/script/value/function.rb +19 -0
- data/lib/sass/script/value/helpers.rb +16 -7
- data/lib/sass/script/value/list.rb +33 -12
- data/lib/sass/script/value/map.rb +2 -2
- data/lib/sass/script/value/number.rb +3 -3
- data/lib/sass/script/value/string.rb +12 -5
- data/lib/sass/scss/parser.rb +101 -45
- data/lib/sass/scss/rx.rb +5 -11
- data/lib/sass/scss/static_parser.rb +0 -7
- data/lib/sass/selector.rb +4 -0
- data/lib/sass/selector/abstract_sequence.rb +5 -5
- data/lib/sass/selector/comma_sequence.rb +3 -15
- data/lib/sass/selector/pseudo.rb +4 -0
- data/lib/sass/selector/sequence.rb +30 -3
- data/lib/sass/selector/simple.rb +13 -7
- data/lib/sass/selector/simple_sequence.rb +1 -1
- data/lib/sass/shared.rb +3 -5
- data/lib/sass/source/map.rb +4 -4
- data/lib/sass/source/position.rb +4 -4
- data/lib/sass/stack.rb +21 -1
- data/lib/sass/tree/charset_node.rb +1 -1
- data/lib/sass/tree/comment_node.rb +1 -1
- data/lib/sass/tree/node.rb +3 -3
- data/lib/sass/tree/prop_node.rb +46 -54
- data/lib/sass/tree/rule_node.rb +7 -15
- data/lib/sass/tree/visitors/check_nesting.rb +1 -1
- data/lib/sass/tree/visitors/convert.rb +2 -3
- data/lib/sass/tree/visitors/cssize.rb +1 -10
- data/lib/sass/tree/visitors/deep_copy.rb +2 -2
- data/lib/sass/tree/visitors/perform.rb +23 -12
- data/lib/sass/tree/visitors/set_options.rb +1 -1
- data/lib/sass/tree/visitors/to_css.rb +46 -12
- data/lib/sass/util.rb +16 -321
- data/lib/sass/util/multibyte_string_scanner.rb +127 -131
- data/lib/sass/util/normalized_map.rb +1 -8
- data/lib/sass/version.rb +2 -2
- data/test/sass-spec.yml +1 -1
- data/test/sass/compiler_test.rb +4 -14
- data/test/sass/conversion_test.rb +113 -162
- data/test/sass/css2sass_test.rb +17 -19
- data/test/sass/css_variable_test.rb +176 -70
- data/test/sass/encoding_test.rb +2 -32
- data/test/sass/engine_test.rb +114 -65
- data/test/sass/extend_test.rb +37 -51
- data/test/sass/functions_test.rb +57 -15
- data/test/sass/importer_test.rb +2 -2
- data/test/sass/more_templates/more1.sass +10 -10
- data/test/sass/more_templates/more_import.sass +2 -2
- data/test/sass/plugin_test.rb +9 -12
- data/test/sass/script_conversion_test.rb +9 -0
- data/test/sass/script_test.rb +38 -48
- data/test/sass/scss/css_test.rb +5 -19
- data/test/sass/scss/scss_test.rb +58 -39
- data/test/sass/source_map_test.rb +26 -28
- data/test/sass/templates/_partial.sass +1 -1
- data/test/sass/templates/basic.sass +10 -10
- data/test/sass/templates/bork1.sass +1 -1
- data/test/sass/templates/bork5.sass +1 -1
- data/test/sass/templates/compact.sass +10 -10
- data/test/sass/templates/complex.sass +187 -187
- data/test/sass/templates/compressed.sass +10 -10
- data/test/sass/templates/expanded.sass +10 -10
- data/test/sass/templates/import.sass +2 -2
- data/test/sass/templates/importee.sass +3 -3
- data/test/sass/templates/mixins.sass +22 -22
- data/test/sass/templates/multiline.sass +4 -4
- data/test/sass/templates/nested.sass +13 -13
- data/test/sass/templates/parent_ref.sass +12 -12
- data/test/sass/templates/script.sass +70 -70
- data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +1 -1
- data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +2 -2
- data/test/sass/templates/subdir/subdir.sass +3 -3
- data/test/sass/templates/units.sass +10 -10
- data/test/sass/util/multibyte_string_scanner_test.rb +139 -149
- data/test/sass/util_test.rb +0 -36
- data/test/test_helper.rb +39 -0
- metadata +30 -57
- data/extra/sass-spec-ref.sh +0 -32
- data/lib/sass/deprecation.rb +0 -55
- data/lib/sass/script/css_variable_warning.rb +0 -52
- data/lib/sass/util/cross_platform_random.rb +0 -19
- data/lib/sass/util/ordered_hash.rb +0 -192
- data/test/sass/results/import_charset_1_8.css +0 -5
- data/test/sass/templates/import_charset_1_8.sass +0 -6
- data/vendor/listen/CHANGELOG.md +0 -1
- data/vendor/listen/CONTRIBUTING.md +0 -38
- data/vendor/listen/Gemfile +0 -20
- data/vendor/listen/Guardfile +0 -8
- data/vendor/listen/LICENSE +0 -20
- data/vendor/listen/README.md +0 -349
- data/vendor/listen/Rakefile +0 -5
- data/vendor/listen/Vagrantfile +0 -96
- data/vendor/listen/lib/listen.rb +0 -54
- data/vendor/listen/lib/listen/adapter.rb +0 -327
- data/vendor/listen/lib/listen/adapters/bsd.rb +0 -75
- data/vendor/listen/lib/listen/adapters/darwin.rb +0 -48
- data/vendor/listen/lib/listen/adapters/linux.rb +0 -81
- data/vendor/listen/lib/listen/adapters/polling.rb +0 -58
- data/vendor/listen/lib/listen/adapters/windows.rb +0 -91
- data/vendor/listen/lib/listen/directory_record.rb +0 -406
- data/vendor/listen/lib/listen/listener.rb +0 -323
- data/vendor/listen/lib/listen/turnstile.rb +0 -32
- data/vendor/listen/lib/listen/version.rb +0 -3
- data/vendor/listen/listen.gemspec +0 -28
- data/vendor/listen/spec/listen/adapter_spec.rb +0 -149
- data/vendor/listen/spec/listen/adapters/bsd_spec.rb +0 -36
- data/vendor/listen/spec/listen/adapters/darwin_spec.rb +0 -37
- data/vendor/listen/spec/listen/adapters/linux_spec.rb +0 -47
- data/vendor/listen/spec/listen/adapters/polling_spec.rb +0 -68
- data/vendor/listen/spec/listen/adapters/windows_spec.rb +0 -30
- data/vendor/listen/spec/listen/directory_record_spec.rb +0 -1250
- data/vendor/listen/spec/listen/listener_spec.rb +0 -258
- data/vendor/listen/spec/listen/turnstile_spec.rb +0 -56
- data/vendor/listen/spec/listen_spec.rb +0 -67
- data/vendor/listen/spec/spec_helper.rb +0 -25
- data/vendor/listen/spec/support/adapter_helper.rb +0 -666
- data/vendor/listen/spec/support/directory_record_helper.rb +0 -57
- data/vendor/listen/spec/support/fixtures_helper.rb +0 -29
- data/vendor/listen/spec/support/listeners_helper.rb +0 -179
- data/vendor/listen/spec/support/platform_helper.rb +0 -15
data/test/sass/css2sass_test.rb
CHANGED
@@ -14,7 +14,7 @@ CSS
|
|
14
14
|
h1
|
15
15
|
color: red
|
16
16
|
SASS
|
17
|
-
|
17
|
+
assert_equal(<<SASS, css2sass(css, :old => true))
|
18
18
|
h1
|
19
19
|
:color red
|
20
20
|
SASS
|
@@ -498,24 +498,22 @@ CSS
|
|
498
498
|
|
499
499
|
# Encodings
|
500
500
|
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
assert_equal('Invalid UTF-16LE character "\xFE"', e.message)
|
518
|
-
end
|
501
|
+
def test_encoding_error
|
502
|
+
css2sass("foo\nbar\nb\xFEaz".force_encoding("utf-8"))
|
503
|
+
assert(false, "Expected exception")
|
504
|
+
rescue Sass::SyntaxError => e
|
505
|
+
assert_equal(3, e.sass_line)
|
506
|
+
assert_equal('Invalid UTF-8 character "\xFE"', e.message)
|
507
|
+
end
|
508
|
+
|
509
|
+
def test_ascii_incompatible_encoding_error
|
510
|
+
template = "foo\nbar\nb_z".encode("utf-16le")
|
511
|
+
template[9] = "\xFE".force_encoding("utf-16le")
|
512
|
+
css2sass(template)
|
513
|
+
assert(false, "Expected exception")
|
514
|
+
rescue Sass::SyntaxError => e
|
515
|
+
assert_equal(3, e.sass_line)
|
516
|
+
assert_equal('Invalid UTF-16LE character "\xFE"', e.message)
|
519
517
|
end
|
520
518
|
|
521
519
|
private
|
@@ -3,103 +3,209 @@
|
|
3
3
|
require File.dirname(__FILE__) + '/../test_helper'
|
4
4
|
require 'sass/engine'
|
5
5
|
|
6
|
+
# Most CSS variable tests are in sass-spec, but a few relate to formatting or
|
7
|
+
# conversion and so belong here.
|
6
8
|
class CssVariableTest < MiniTest::Test
|
7
|
-
def
|
8
|
-
|
9
|
-
|
10
|
-
resolve_with_variable_warning("1 < 2")
|
11
|
-
resolve_with_variable_warning("1 <= 2")
|
12
|
-
resolve_with_variable_warning("1 > 2")
|
13
|
-
resolve_with_variable_warning("1 >= 2")
|
14
|
-
resolve_with_variable_warning("1 + 1")
|
15
|
-
resolve_with_variable_warning("1 - 1")
|
16
|
-
resolve_with_variable_warning("1 * 1")
|
17
|
-
resolve_with_variable_warning("1 % 1")
|
9
|
+
def test_folded_inline_whitespace
|
10
|
+
assert_variable_value "foo bar baz", "foo bar baz"
|
11
|
+
assert_variable_value "foo bar", "foo \t bar"
|
18
12
|
end
|
19
13
|
|
20
|
-
def
|
21
|
-
|
14
|
+
def test_folded_multiline_whitespace
|
15
|
+
# We don't want to reformat newlines in nested and expanded mode, so we just
|
16
|
+
# remove trailing whitespace before them.
|
17
|
+
assert_equal <<CSS, render(<<SCSS)
|
22
18
|
.foo {
|
23
|
-
|
24
|
-
|
19
|
+
--multiline: foo
|
20
|
+
bar; }
|
21
|
+
CSS
|
22
|
+
.foo {
|
23
|
+
--multiline: foo\s
|
24
|
+
bar;
|
25
25
|
}
|
26
26
|
SCSS
|
27
|
-
end
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
assert_equal <<CSS, render(<<SCSS)
|
29
|
+
.foo {
|
30
|
+
--multiline: foo
|
31
|
+
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
bar; }
|
34
|
+
CSS
|
35
|
+
.foo {
|
36
|
+
--multiline: foo\s
|
37
|
+
|
38
|
+
|
39
|
+
bar;
|
40
|
+
}
|
37
41
|
SCSS
|
38
|
-
end
|
39
42
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
43
|
+
assert_equal <<CSS, render(<<SCSS, style: :expanded)
|
44
|
+
.foo {
|
45
|
+
--multiline: foo
|
46
|
+
bar;
|
47
|
+
}
|
48
|
+
CSS
|
49
|
+
.foo {
|
50
|
+
--multiline: foo\s
|
51
|
+
bar;
|
52
|
+
}
|
53
|
+
SCSS
|
54
|
+
|
55
|
+
assert_equal <<CSS, render(<<SCSS, style: :expanded)
|
56
|
+
.foo {
|
57
|
+
--multiline: foo
|
58
|
+
|
44
59
|
|
45
|
-
|
46
|
-
|
60
|
+
bar;
|
61
|
+
}
|
62
|
+
CSS
|
63
|
+
.foo {
|
64
|
+
--multiline: foo\s
|
65
|
+
|
66
|
+
|
67
|
+
bar;
|
68
|
+
}
|
69
|
+
SCSS
|
70
|
+
|
71
|
+
# In compact and compressed mode, we fold all whitespace around newlines
|
72
|
+
# together.
|
73
|
+
assert_equal <<CSS, render(<<SCSS, style: :compact)
|
74
|
+
.foo { --multiline: foo bar; }
|
75
|
+
CSS
|
76
|
+
.foo {
|
77
|
+
--multiline: foo\s
|
78
|
+
bar;
|
79
|
+
}
|
80
|
+
SCSS
|
81
|
+
|
82
|
+
assert_equal <<CSS, render(<<SCSS, style: :compact)
|
83
|
+
.foo { --multiline: foo bar; }
|
84
|
+
CSS
|
85
|
+
.foo {
|
86
|
+
--multiline: foo\s
|
87
|
+
|
88
|
+
|
89
|
+
bar;
|
90
|
+
}
|
91
|
+
SCSS
|
92
|
+
|
93
|
+
assert_equal <<CSS, render(<<SCSS, style: :compressed)
|
94
|
+
.foo{--multiline: foo bar}
|
95
|
+
CSS
|
96
|
+
.foo {
|
97
|
+
--multiline: foo\s
|
98
|
+
bar;
|
99
|
+
}
|
100
|
+
SCSS
|
101
|
+
|
102
|
+
assert_equal <<CSS, render(<<SCSS, style: :compressed)
|
103
|
+
.foo{--multiline: foo bar}
|
104
|
+
CSS
|
105
|
+
.foo {
|
106
|
+
--multiline: foo\s
|
107
|
+
|
108
|
+
|
109
|
+
bar;
|
110
|
+
}
|
111
|
+
SCSS
|
47
112
|
end
|
48
113
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
114
|
+
# Conversion.
|
115
|
+
|
116
|
+
def test_static_values_convert
|
117
|
+
assert_converts <<SASS, <<SCSS
|
118
|
+
.foo
|
119
|
+
--bar: baz
|
120
|
+
SASS
|
55
121
|
.foo {
|
56
|
-
--
|
57
|
-
|
58
|
-
|
122
|
+
--bar: baz;
|
123
|
+
}
|
124
|
+
SCSS
|
125
|
+
|
126
|
+
assert_converts <<SASS, <<SCSS
|
127
|
+
.foo
|
128
|
+
--bar: [({{([!;])}})]
|
129
|
+
SASS
|
130
|
+
.foo {
|
131
|
+
--bar: [({{([!;])}})];
|
132
|
+
}
|
133
|
+
SCSS
|
134
|
+
|
135
|
+
assert_converts <<SASS, <<SCSS
|
136
|
+
.foo
|
137
|
+
--bar: {a: b; c: d}
|
138
|
+
SASS
|
139
|
+
.foo {
|
140
|
+
--bar: {a: b; c: d};
|
59
141
|
}
|
60
142
|
SCSS
|
61
143
|
end
|
62
144
|
|
63
|
-
def
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
145
|
+
def test_dynamic_values_convert
|
146
|
+
assert_converts <<SASS, <<SCSS
|
147
|
+
.foo
|
148
|
+
--bar: baz \#{bang} qux
|
149
|
+
SASS
|
150
|
+
.foo {
|
151
|
+
--bar: baz \#{bang} qux;
|
152
|
+
}
|
153
|
+
SCSS
|
154
|
+
|
155
|
+
assert_converts <<SASS, <<SCSS
|
156
|
+
.foo
|
157
|
+
--bar: "baz \#{bang} qux"
|
158
|
+
SASS
|
159
|
+
.foo {
|
160
|
+
--bar: "baz \#{bang} qux";
|
161
|
+
}
|
162
|
+
SCSS
|
73
163
|
end
|
74
164
|
|
75
|
-
def
|
76
|
-
|
77
|
-
|
165
|
+
def test_multiline_value_converts
|
166
|
+
assert_scss_to_scss <<SCSS
|
167
|
+
.foo {
|
168
|
+
--bar: {
|
169
|
+
a: b;
|
170
|
+
c: d;
|
171
|
+
};
|
172
|
+
}
|
173
|
+
SCSS
|
174
|
+
|
175
|
+
assert_scss_to_sass <<SASS, <<SCSS
|
176
|
+
.foo
|
177
|
+
--bar: { a: b; c: d; }
|
178
|
+
SASS
|
179
|
+
.foo {
|
180
|
+
--bar: {
|
181
|
+
a: b;
|
182
|
+
c: d;
|
183
|
+
};
|
184
|
+
}
|
185
|
+
SCSS
|
78
186
|
end
|
79
187
|
|
80
188
|
private
|
81
189
|
|
82
|
-
def
|
83
|
-
|
84
|
-
|
85
|
-
|
190
|
+
def assert_variable_value(expected, source)
|
191
|
+
expected = <<CSS
|
192
|
+
x {
|
193
|
+
--variable: #{expected}; }
|
194
|
+
CSS
|
86
195
|
|
87
|
-
|
88
|
-
|
89
|
-
render_with_variable_warning(
|
90
|
-
"a\n --var: #{str}", expression || str, 2, :syntax => :sass)
|
196
|
+
assert_equal expected, render_variable(source)
|
197
|
+
assert_equal expected, render_variable(source, syntax: :sass)
|
91
198
|
end
|
92
199
|
|
93
|
-
def
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
WARNING
|
200
|
+
def render_variable(source, syntax: :scss)
|
201
|
+
render(syntax == :scss ? <<SCSS : <<SASS, :syntax => syntax)
|
202
|
+
x {
|
203
|
+
--variable: #{source};
|
204
|
+
}
|
205
|
+
SCSS
|
206
|
+
x
|
207
|
+
--variable: #{source}
|
208
|
+
SASS
|
103
209
|
end
|
104
210
|
|
105
211
|
def render(sass, options = {})
|
data/test/sass/encoding_test.rb
CHANGED
@@ -8,8 +8,6 @@ class EncodingTest < MiniTest::Test
|
|
8
8
|
include Sass::Util::Test
|
9
9
|
|
10
10
|
def test_encoding_error
|
11
|
-
return skip "Can't be run on Ruby 1.8." if Sass::Util.ruby1_8?
|
12
|
-
|
13
11
|
render("foo\nbar\nb\xFEaz".force_encoding("utf-8"))
|
14
12
|
assert(false, "Expected exception")
|
15
13
|
rescue Sass::SyntaxError => e
|
@@ -18,8 +16,6 @@ class EncodingTest < MiniTest::Test
|
|
18
16
|
end
|
19
17
|
|
20
18
|
def test_ascii_incompatible_encoding_error
|
21
|
-
return skip "Can't be run on Ruby 1.8." if Sass::Util.ruby1_8?
|
22
|
-
|
23
19
|
template = "foo\nbar\nb_z".encode("utf-16le")
|
24
20
|
template[9] = "\xFE".force_encoding("utf-16le")
|
25
21
|
render(template)
|
@@ -30,8 +26,6 @@ class EncodingTest < MiniTest::Test
|
|
30
26
|
end
|
31
27
|
|
32
28
|
def test_prefers_charset_to_ruby_encoding
|
33
|
-
return skip "Can't be run on Ruby 1.8." if Sass::Util.ruby1_8?
|
34
|
-
|
35
29
|
assert_renders_encoded(<<CSS, <<SASS.encode("IBM866").force_encoding("UTF-8"))
|
36
30
|
@charset "UTF-8";
|
37
31
|
fЖЖ {
|
@@ -44,8 +38,6 @@ SASS
|
|
44
38
|
end
|
45
39
|
|
46
40
|
def test_uses_ruby_encoding_without_charset
|
47
|
-
return skip "Can't be run on Ruby 1.8." if Sass::Util.ruby1_8?
|
48
|
-
|
49
41
|
assert_renders_encoded(<<CSS, <<SASS.encode("IBM866"))
|
50
42
|
@charset "UTF-8";
|
51
43
|
тАЬ {
|
@@ -57,8 +49,6 @@ SASS
|
|
57
49
|
end
|
58
50
|
|
59
51
|
def test_multibyte_charset_without_bom_declared_as_binary
|
60
|
-
return skip "Can't be run on Ruby 1.8." if Sass::Util.ruby1_8?
|
61
|
-
|
62
52
|
engine = Sass::Engine.new(<<SASS.encode("UTF-16LE").force_encoding("BINARY"))
|
63
53
|
@charset "utf-16le"
|
64
54
|
fóó
|
@@ -71,8 +61,6 @@ SASS
|
|
71
61
|
end
|
72
62
|
|
73
63
|
def test_multibyte_charset_without_bom_declared_as_utf_8
|
74
|
-
return skip "Can't be run on Ruby 1.8." if Sass::Util.ruby1_8?
|
75
|
-
|
76
64
|
engine = Sass::Engine.new(<<SASS.encode("UTF-16LE").force_encoding("UTF-8"))
|
77
65
|
@charset "utf-16le"
|
78
66
|
fóó
|
@@ -85,8 +73,6 @@ SASS
|
|
85
73
|
end
|
86
74
|
|
87
75
|
def test_utf_16le_with_bom
|
88
|
-
return skip "Can't be run on Ruby 1.8." if Sass::Util.ruby1_8?
|
89
|
-
|
90
76
|
assert_renders_encoded(<<CSS, <<SASS.encode("UTF-16LE").force_encoding("BINARY"))
|
91
77
|
@charset "UTF-8";
|
92
78
|
fóó {
|
@@ -98,8 +84,6 @@ SASS
|
|
98
84
|
end
|
99
85
|
|
100
86
|
def test_utf_16be_with_bom
|
101
|
-
return skip "Can't be run on Ruby 1.8." if Sass::Util.ruby1_8?
|
102
|
-
|
103
87
|
assert_renders_encoded(<<CSS, <<SASS.encode("UTF-16BE").force_encoding("BINARY"))
|
104
88
|
@charset "UTF-8";
|
105
89
|
fóó {
|
@@ -111,8 +95,6 @@ SASS
|
|
111
95
|
end
|
112
96
|
|
113
97
|
def test_utf_8_with_bom
|
114
|
-
return skip "Can't be run on Ruby 1.8." if Sass::Util.ruby1_8?
|
115
|
-
|
116
98
|
assert_renders_encoded(<<CSS, <<SASS.force_encoding("BINARY"))
|
117
99
|
@charset "UTF-8";
|
118
100
|
fóó {
|
@@ -124,8 +106,6 @@ SASS
|
|
124
106
|
end
|
125
107
|
|
126
108
|
def test_charset_with_multibyte_encoding
|
127
|
-
return skip "Can't be run on Ruby 1.8." if Sass::Util.ruby1_8?
|
128
|
-
|
129
109
|
engine = Sass::Engine.new(<<SASS)
|
130
110
|
@charset "utf-32be"
|
131
111
|
fóó
|
@@ -137,8 +117,6 @@ SASS
|
|
137
117
|
end
|
138
118
|
|
139
119
|
def test_charset_with_special_case_encoding
|
140
|
-
return skip "Can't be run on Ruby 1.8." if Sass::Util.ruby1_8?
|
141
|
-
|
142
120
|
# For some reason, a file with an ASCII-compatible UTF-16 charset
|
143
121
|
# declaration is specced to be parsed as UTF-8.
|
144
122
|
assert_renders_encoded(<<CSS, <<SASS.force_encoding("BINARY"))
|
@@ -153,8 +131,6 @@ SASS
|
|
153
131
|
end
|
154
132
|
|
155
133
|
def test_compressed_output_uses_bom
|
156
|
-
return skip "Can't be run on Ruby 1.8." if Sass::Util.ruby1_8?
|
157
|
-
|
158
134
|
assert_equal("\uFEFFfóó{a:b}\n", render(<<SASS, :style => :compressed))
|
159
135
|
fóó
|
160
136
|
a: b
|
@@ -167,19 +143,15 @@ SASS
|
|
167
143
|
end
|
168
144
|
|
169
145
|
def test_null_normalization
|
170
|
-
return skip "Can't be run on Ruby 1.8." if Sass::Util.ruby1_8?
|
171
|
-
|
172
146
|
assert_equal(<<CSS, render("/* foo\x00bar\x00baz */", :syntax => :scss))
|
173
|
-
|
174
|
-
|
147
|
+
@charset "UTF-8";
|
148
|
+
/* foo�bar�baz */
|
175
149
|
CSS
|
176
150
|
end
|
177
151
|
|
178
152
|
# Regression
|
179
153
|
|
180
154
|
def test_multibyte_prop_name
|
181
|
-
return skip "Can't be run on Ruby 1.8." if Sass::Util.ruby1_8?
|
182
|
-
|
183
155
|
assert_equal(<<CSS, render(<<SASS))
|
184
156
|
@charset "UTF-8";
|
185
157
|
#bar {
|
@@ -191,8 +163,6 @@ SASS
|
|
191
163
|
end
|
192
164
|
|
193
165
|
def test_multibyte_and_interpolation
|
194
|
-
return skip "Can't be run on Ruby 1.8." if Sass::Util.ruby1_8?
|
195
|
-
|
196
166
|
assert_equal(<<CSS, render(<<SCSS, :syntax => :scss))
|
197
167
|
#bar {
|
198
168
|
background: a 0%; }
|