sass 3.4.24 → 3.4.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +39 -10
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/lib/sass.rb +3 -3
- data/lib/sass/css.rb +1 -1
- data/lib/sass/deprecation.rb +55 -0
- data/lib/sass/engine.rb +13 -5
- data/lib/sass/environment.rb +1 -1
- data/lib/sass/plugin.rb +1 -1
- data/lib/sass/plugin/compiler.rb +1 -1
- data/lib/sass/plugin/configuration.rb +1 -1
- data/lib/sass/plugin/rack.rb +2 -2
- data/lib/sass/plugin/staleness_checker.rb +1 -1
- data/lib/sass/script.rb +1 -1
- data/lib/sass/script/functions.rb +2 -2
- data/lib/sass/script/lexer.rb +1 -1
- data/lib/sass/script/parser.rb +4 -3
- data/lib/sass/script/tree/node.rb +1 -1
- data/lib/sass/script/tree/operation.rb +43 -16
- data/lib/sass/script/value/base.rb +1 -1
- data/lib/sass/script/value/string.rb +5 -12
- data/lib/sass/scss/static_parser.rb +7 -0
- data/lib/sass/selector/comma_sequence.rb +13 -1
- data/lib/sass/selector/simple.rb +1 -0
- data/lib/sass/tree/node.rb +2 -2
- data/lib/sass/tree/rule_node.rb +13 -4
- data/lib/sass/tree/visitors/deep_copy.rb +1 -1
- data/lib/sass/tree/visitors/perform.rb +3 -2
- data/test/sass/conversion_test.rb +3 -3
- data/test/sass/css2sass_test.rb +1 -1
- data/test/sass/engine_test.rb +56 -50
- data/test/sass/extend_test.rb +14 -8
- data/test/sass/functions_test.rb +5 -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 +3 -3
- data/test/sass/script_test.rb +38 -29
- data/test/sass/scss/css_test.rb +2 -2
- data/test/sass/scss/scss_test.rb +25 -10
- data/test/sass/source_map_test.rb +13 -13
- 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 +10 -2
- metadata +25 -24
data/test/sass/functions_test.rb
CHANGED
@@ -1841,8 +1841,11 @@ WARNING
|
|
1841
1841
|
assert_equal(".bar", evaluate("selector-replace('.foo', '.foo', '.bar')"))
|
1842
1842
|
assert_equal(".foo.baz", evaluate("selector-replace('.foo.bar', '.bar', '.baz')"))
|
1843
1843
|
assert_equal(".a .foo.baz", evaluate("selector-replace('.foo.bar', '.bar', '.a .baz')"))
|
1844
|
-
|
1845
|
-
|
1844
|
+
|
1845
|
+
# These shouldn't warn since we still support componud targets for selector
|
1846
|
+
# functions.
|
1847
|
+
assert_no_warning {assert_equal(".foo.bar", evaluate("selector-replace('.foo.bar', '.baz.bar', '.qux')"))}
|
1848
|
+
assert_no_warning {assert_equal(".bar.qux", evaluate("selector-replace('.foo.bar.baz', '.foo.baz', '.qux')"))}
|
1846
1849
|
|
1847
1850
|
assert_equal(":not(.bar)", evaluate("selector-replace(':not(.foo)', '.foo', '.bar')"))
|
1848
1851
|
assert_equal(".bar", evaluate("selector-replace(':not(.foo)', ':not(.foo)', '.bar')"))
|
@@ -1,23 +1,23 @@
|
|
1
1
|
|
2
2
|
|
3
3
|
body
|
4
|
-
:
|
5
|
-
:
|
4
|
+
font: Arial
|
5
|
+
background: blue
|
6
6
|
|
7
7
|
#page
|
8
|
-
:
|
9
|
-
:
|
8
|
+
width: 700px
|
9
|
+
height: 100
|
10
10
|
#header
|
11
|
-
:
|
11
|
+
height: 300px
|
12
12
|
h1
|
13
|
-
|
14
|
-
:
|
13
|
+
font-size: 50px
|
14
|
+
color: blue
|
15
15
|
|
16
16
|
#content.user.show
|
17
17
|
#container.top
|
18
18
|
#column.left
|
19
|
-
:
|
19
|
+
width: 100px
|
20
20
|
#column.right
|
21
|
-
:
|
21
|
+
width: 600px
|
22
22
|
#container.bottom
|
23
|
-
:
|
23
|
+
background: brown
|
data/test/sass/plugin_test.rb
CHANGED
@@ -45,7 +45,7 @@ class SassPluginTest < MiniTest::Test
|
|
45
45
|
|
46
46
|
@@templates.each do |name|
|
47
47
|
define_method("test_template_renders_correctly (#{name})") do
|
48
|
-
assert_renders_correctly(name)
|
48
|
+
silence_warnings {assert_renders_correctly(name)}
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -117,7 +117,7 @@ Error: Undefined variable: "$bork".
|
|
117
117
|
on line 2 of #{template_loc('bork1')}
|
118
118
|
|
119
119
|
1: bork
|
120
|
-
2: :
|
120
|
+
2: bork: $bork
|
121
121
|
CSS
|
122
122
|
end
|
123
123
|
File.delete(tempfile_loc('bork1'))
|
@@ -134,7 +134,7 @@ Error: Undefined variable: "$bork".
|
|
134
134
|
|
135
135
|
1: bork
|
136
136
|
2: /* foo *\\/
|
137
|
-
3: :
|
137
|
+
3: bork: $bork
|
138
138
|
CSS
|
139
139
|
end
|
140
140
|
File.delete(tempfile_loc('bork1'))
|
data/test/sass/script_test.rb
CHANGED
@@ -78,7 +78,7 @@ class SassScriptTest < MiniTest::Test
|
|
78
78
|
def test_color_names
|
79
79
|
assert_equal "white", resolve("white")
|
80
80
|
assert_equal "#ffffff", resolve("#ffffff")
|
81
|
-
assert_equal "#fffffe", resolve("white - #000001")
|
81
|
+
silence_warnings {assert_equal "#fffffe", resolve("white - #000001")}
|
82
82
|
assert_equal "transparent", resolve("transparent")
|
83
83
|
assert_equal "transparent", resolve("rgba(0, 0, 0, 0)")
|
84
84
|
end
|
@@ -97,23 +97,23 @@ class SassScriptTest < MiniTest::Test
|
|
97
97
|
end
|
98
98
|
|
99
99
|
def test_rgba_color_math
|
100
|
-
assert_equal "rgba(50, 50, 100, 0.35)", resolve("rgba(1, 1, 2, 0.35) * rgba(50, 50, 50, 0.35)")
|
101
|
-
assert_equal "rgba(52, 52, 52, 0.25)", resolve("rgba(2, 2, 2, 0.25) + rgba(50, 50, 50, 0.25)")
|
100
|
+
silence_warnings {assert_equal "rgba(50, 50, 100, 0.35)", resolve("rgba(1, 1, 2, 0.35) * rgba(50, 50, 50, 0.35)")}
|
101
|
+
silence_warnings {assert_equal "rgba(52, 52, 52, 0.25)", resolve("rgba(2, 2, 2, 0.25) + rgba(50, 50, 50, 0.25)")}
|
102
102
|
|
103
103
|
assert_raise_message(Sass::SyntaxError, "Alpha channels must be equal: rgba(1, 2, 3, 0.15) + rgba(50, 50, 50, 0.75)") do
|
104
|
-
resolve("rgba(1, 2, 3, 0.15) + rgba(50, 50, 50, 0.75)")
|
104
|
+
silence_warnings {resolve("rgba(1, 2, 3, 0.15) + rgba(50, 50, 50, 0.75)")}
|
105
105
|
end
|
106
106
|
assert_raise_message(Sass::SyntaxError, "Alpha channels must be equal: #123456 * rgba(50, 50, 50, 0.75)") do
|
107
|
-
resolve("#123456 * rgba(50, 50, 50, 0.75)")
|
107
|
+
silence_warnings {resolve("#123456 * rgba(50, 50, 50, 0.75)")}
|
108
108
|
end
|
109
109
|
assert_raise_message(Sass::SyntaxError, "Alpha channels must be equal: rgba(50, 50, 50, 0.75) / #123456") do
|
110
|
-
resolve("rgba(50, 50, 50, 0.75) / #123456")
|
110
|
+
silence_warnings {resolve("rgba(50, 50, 50, 0.75) / #123456")}
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
114
114
|
def test_rgba_number_math
|
115
|
-
assert_equal "rgba(49, 49, 49, 0.75)", resolve("rgba(50, 50, 50, 0.75) - 1")
|
116
|
-
assert_equal "rgba(100, 100, 100, 0.75)", resolve("rgba(50, 50, 50, 0.75) * 2")
|
115
|
+
silence_warnings {assert_equal "rgba(49, 49, 49, 0.75)", resolve("rgba(50, 50, 50, 0.75) - 1")}
|
116
|
+
silence_warnings {assert_equal "rgba(100, 100, 100, 0.75)", resolve("rgba(50, 50, 50, 0.75) * 2")}
|
117
117
|
end
|
118
118
|
|
119
119
|
def test_rgba_rounding
|
@@ -504,7 +504,7 @@ SASS
|
|
504
504
|
|
505
505
|
def test_functions
|
506
506
|
assert_equal "#80ff80", resolve("hsl(120, 100%, 75%)")
|
507
|
-
assert_equal "#81ff81", resolve("hsl(120, 100%, 75%) + #010001")
|
507
|
+
silence_warnings {assert_equal "#81ff81", resolve("hsl(120, 100%, 75%) + #010001")}
|
508
508
|
end
|
509
509
|
|
510
510
|
def test_operator_unit_conversion
|
@@ -518,17 +518,19 @@ SASS
|
|
518
518
|
assert_equal "true", resolve("2mm == 8q")
|
519
519
|
assert_equal "false", resolve("2px > 3q")
|
520
520
|
|
521
|
-
|
521
|
+
Sass::Deprecation.allow_double_warnings do
|
522
|
+
assert_warning(<<WARNING) {assert_equal "true", resolve("1 == 1cm")}
|
522
523
|
DEPRECATION WARNING on line 1 of test_operator_unit_conversion_inline.sass:
|
523
524
|
The result of `1 == 1cm` will be `false` in future releases of Sass.
|
524
525
|
Unitless numbers will no longer be equal to the same numbers with units.
|
525
526
|
WARNING
|
526
527
|
|
527
|
-
|
528
|
+
assert_warning(<<WARNING) {assert_equal "false", resolve("1 != 1cm")}
|
528
529
|
DEPRECATION WARNING on line 1 of test_operator_unit_conversion_inline.sass:
|
529
530
|
The result of `1 != 1cm` will be `true` in future releases of Sass.
|
530
531
|
Unitless numbers will no longer be equal to the same numbers with units.
|
531
532
|
WARNING
|
533
|
+
end
|
532
534
|
end
|
533
535
|
|
534
536
|
def test_length_units
|
@@ -988,7 +990,7 @@ SCSS
|
|
988
990
|
end
|
989
991
|
|
990
992
|
def test_color_format_isnt_preserved_when_modified
|
991
|
-
assert_equal "magenta", resolve("#f00
|
993
|
+
assert_equal "magenta", resolve("change-color(#f00, $blue: 255)")
|
992
994
|
end
|
993
995
|
|
994
996
|
def test_ids
|
@@ -1307,32 +1309,37 @@ SASS
|
|
1307
1309
|
end
|
1308
1310
|
|
1309
1311
|
def test_active_lazy_interpolation_deprecation_warning
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1312
|
+
Sass::Deprecation.allow_double_warnings do
|
1313
|
+
assert_equal "1, 2, 3", resolve_with_lazy_interp_warning('quote((1, #{2}, 3))', '"1, 2, 3"')
|
1314
|
+
assert_equal "1", resolve_with_lazy_interp_warning('length((1, #{2}, 3))', '"1, 2, 3"')
|
1315
|
+
assert_equal "1, 2, 3", resolve_with_lazy_interp_warning('inspect((1, #{2}, 3))', '"1, 2, 3"')
|
1316
|
+
assert_equal "string", resolve_with_lazy_interp_warning('type-of((1, #{2}, 3))', '"1, 2, 3"')
|
1317
|
+
|
1318
|
+
assert_equal "+1 2 3", resolve_with_lazy_interp_warning('quote((+#{1} 2 3))', '"+1 #{2 3}"')
|
1319
|
+
assert_equal "/1 2 3", resolve_with_lazy_interp_warning('quote((/#{1} 2 3))', '"/1 #{2 3}"')
|
1320
|
+
assert_equal "-1 2 3", resolve_with_lazy_interp_warning('quote((-#{1} 2 3))', '"-1 #{2 3}"')
|
1321
|
+
end
|
1318
1322
|
end
|
1319
1323
|
|
1320
1324
|
def test_comparison_of_complex_units
|
1321
1325
|
# Tests for issue #1960
|
1322
|
-
|
1326
|
+
Sass::Deprecation.allow_double_warnings do
|
1327
|
+
assert_warning(<<WARNING) do
|
1323
1328
|
DEPRECATION WARNING on line 1 of test_comparison_of_complex_units_inline.sass:
|
1324
1329
|
The result of `10 == 10px` will be `false` in future releases of Sass.
|
1325
1330
|
Unitless numbers will no longer be equal to the same numbers with units.
|
1326
1331
|
WARNING
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1332
|
+
assert_equal "true", resolve("10 == 2 * 5px")
|
1333
|
+
end
|
1334
|
+
assert_warning(<<WARNING) do
|
1330
1335
|
DEPRECATION WARNING on line 1 of test_comparison_of_complex_units_inline.sass:
|
1331
1336
|
The result of `10 == 10px*px` will be `false` in future releases of Sass.
|
1332
1337
|
Unitless numbers will no longer be equal to the same numbers with units.
|
1333
1338
|
WARNING
|
1334
|
-
|
1339
|
+
assert_equal "true", resolve("10 == 2px * 5px")
|
1340
|
+
end
|
1335
1341
|
end
|
1342
|
+
|
1336
1343
|
assert_equal "true", resolve("10px * 1px == 2px * 5px")
|
1337
1344
|
assert_equal "true", resolve("5px * 1px < 2px * 5px")
|
1338
1345
|
end
|
@@ -1342,8 +1349,9 @@ WARNING
|
|
1342
1349
|
def resolve_with_lazy_interp_warning(str, contents = nil, environment = env)
|
1343
1350
|
contents ||= "\"#{str}\""
|
1344
1351
|
result = assert_warning(<<WARNING) {resolve(str, {}, environment)}
|
1345
|
-
DEPRECATION WARNING on line 1 of #{filename_for_test}:
|
1346
|
-
in a future version of Sass.
|
1352
|
+
DEPRECATION WARNING on line 1 of #{filename_for_test}:
|
1353
|
+
\#{} interpolation near operators will be simplified in a future version of Sass.
|
1354
|
+
To preserve the current behavior, use quotes:
|
1347
1355
|
|
1348
1356
|
unquote(#{contents})
|
1349
1357
|
WARNING
|
@@ -1354,8 +1362,9 @@ WARNING
|
|
1354
1362
|
def resolve_with_interp_warning(str, contents = nil, environment = env)
|
1355
1363
|
contents ||= "\"#{str}\""
|
1356
1364
|
assert_warning(<<WARNING) {resolve(str, {}, environment)}
|
1357
|
-
DEPRECATION WARNING on line 1 of #{filename_for_test}:
|
1358
|
-
in a future version of Sass.
|
1365
|
+
DEPRECATION WARNING on line 1 of #{filename_for_test}:
|
1366
|
+
\#{} interpolation near operators will be simplified in a future version of Sass.
|
1367
|
+
To preserve the current behavior, use quotes:
|
1359
1368
|
|
1360
1369
|
unquote(#{contents})
|
1361
1370
|
|
data/test/sass/scss/css_test.rb
CHANGED
@@ -819,10 +819,10 @@ SCSS
|
|
819
819
|
assert_selector_parses('E > F')
|
820
820
|
assert_selector_parses('E + F')
|
821
821
|
assert_selector_parses('E ~ F')
|
822
|
-
assert_selector_parses('E /foo/ F')
|
822
|
+
silence_warnings {assert_selector_parses('E /foo/ F')}
|
823
823
|
silence_warnings {assert_selector_parses('E! > F')}
|
824
824
|
|
825
|
-
assert_selector_parses('E /ns|foo/ F')
|
825
|
+
silence_warnings {assert_selector_parses('E /ns|foo/ F')}
|
826
826
|
|
827
827
|
# From http://dev.w3.org/csswg/css-scoping-1/
|
828
828
|
assert_selector_parses('E:host(s)')
|
data/test/sass/scss/scss_test.rb
CHANGED
@@ -1015,7 +1015,8 @@ SASS
|
|
1015
1015
|
end
|
1016
1016
|
|
1017
1017
|
def test_disallowed_function_names
|
1018
|
-
|
1018
|
+
Sass::Deprecation.allow_double_warnings do
|
1019
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1019
1020
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1020
1021
|
Naming a function "calc" is disallowed and will be an error in future versions of Sass.
|
1021
1022
|
This name conflicts with an existing CSS function with special parse rules.
|
@@ -1023,7 +1024,7 @@ WARNING
|
|
1023
1024
|
@function calc() {}
|
1024
1025
|
SCSS
|
1025
1026
|
|
1026
|
-
|
1027
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1027
1028
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1028
1029
|
Naming a function "-my-calc" is disallowed and will be an error in future versions of Sass.
|
1029
1030
|
This name conflicts with an existing CSS function with special parse rules.
|
@@ -1031,7 +1032,7 @@ WARNING
|
|
1031
1032
|
@function -my-calc() {}
|
1032
1033
|
SCSS
|
1033
1034
|
|
1034
|
-
|
1035
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1035
1036
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1036
1037
|
Naming a function "element" is disallowed and will be an error in future versions of Sass.
|
1037
1038
|
This name conflicts with an existing CSS function with special parse rules.
|
@@ -1039,7 +1040,7 @@ WARNING
|
|
1039
1040
|
@function element() {}
|
1040
1041
|
SCSS
|
1041
1042
|
|
1042
|
-
|
1043
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1043
1044
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1044
1045
|
Naming a function "-my-element" is disallowed and will be an error in future versions of Sass.
|
1045
1046
|
This name conflicts with an existing CSS function with special parse rules.
|
@@ -1047,7 +1048,7 @@ WARNING
|
|
1047
1048
|
@function -my-element() {}
|
1048
1049
|
SCSS
|
1049
1050
|
|
1050
|
-
|
1051
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1051
1052
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1052
1053
|
Naming a function "expression" is disallowed and will be an error in future versions of Sass.
|
1053
1054
|
This name conflicts with an existing CSS function with special parse rules.
|
@@ -1055,13 +1056,14 @@ WARNING
|
|
1055
1056
|
@function expression() {}
|
1056
1057
|
SCSS
|
1057
1058
|
|
1058
|
-
|
1059
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1059
1060
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1060
1061
|
Naming a function "url" is disallowed and will be an error in future versions of Sass.
|
1061
1062
|
This name conflicts with an existing CSS function with special parse rules.
|
1062
1063
|
WARNING
|
1063
1064
|
@function url() {}
|
1064
1065
|
SCSS
|
1066
|
+
end
|
1065
1067
|
end
|
1066
1068
|
|
1067
1069
|
def test_allowed_function_names
|
@@ -2172,7 +2174,7 @@ SCSS
|
|
2172
2174
|
end
|
2173
2175
|
|
2174
2176
|
def test_selector_interpolation_in_reference_combinator
|
2175
|
-
assert_equal <<CSS, render(<<SCSS)
|
2177
|
+
silence_warnings {assert_equal <<CSS, render(<<SCSS)}
|
2176
2178
|
.foo /a/ .bar /b|c/ .baz {
|
2177
2179
|
a: b; }
|
2178
2180
|
CSS
|
@@ -3666,8 +3668,9 @@ SCSS
|
|
3666
3668
|
# Ensures that the fix for #2031 doesn't hide legitimate warnings.
|
3667
3669
|
def test_interpolation_warning_in_selector_like_property
|
3668
3670
|
assert_warning(<<WARNING) {assert_equal(<<CSS, render(<<SCSS))}
|
3669
|
-
DEPRECATION WARNING on line 2 of #{filename_for_test :scss}:
|
3670
|
-
in a future version of Sass.
|
3671
|
+
DEPRECATION WARNING on line 2 of #{filename_for_test :scss}:
|
3672
|
+
\#{} interpolation near operators will be simplified in a future version of Sass.
|
3673
|
+
To preserve the current behavior, use quotes:
|
3671
3674
|
|
3672
3675
|
unquote("n+1")
|
3673
3676
|
|
@@ -3857,7 +3860,19 @@ SCSS
|
|
3857
3860
|
end
|
3858
3861
|
|
3859
3862
|
def test_reference_combinator_with_parent_ref
|
3860
|
-
assert_equal <<CSS, render(<<SCSS)
|
3863
|
+
silence_warnings {assert_equal <<CSS, render(<<SCSS)}
|
3864
|
+
a /foo/ b {
|
3865
|
+
c: d; }
|
3866
|
+
CSS
|
3867
|
+
a {& /foo/ b {c: d}}
|
3868
|
+
SCSS
|
3869
|
+
end
|
3870
|
+
|
3871
|
+
def test_reference_combinator_warning
|
3872
|
+
assert_warning(<<WARNING) {assert_equal <<CSS, render(<<SCSS)}
|
3873
|
+
DEPRECATION WARNING on line 1, column 8 of test_reference_combinator_warning_inline.scss:
|
3874
|
+
The reference combinator /foo/ is deprecated and will be removed in a future release.
|
3875
|
+
WARNING
|
3861
3876
|
a /foo/ b {
|
3862
3877
|
c: d; }
|
3863
3878
|
CSS
|
@@ -37,7 +37,7 @@ JSON
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def test_simple_mapping_sass
|
40
|
-
assert_parses_with_sourcemap <<SASS, <<CSS, <<JSON, :syntax => :sass
|
40
|
+
silence_warnings {assert_parses_with_sourcemap <<SASS, <<CSS, <<JSON, :syntax => :sass}
|
41
41
|
a
|
42
42
|
foo: bar
|
43
43
|
/* SOME COMMENT */
|
@@ -114,7 +114,7 @@ JSON
|
|
114
114
|
|
115
115
|
def test_mapping_with_directory_sass
|
116
116
|
options = {:filename => "sass/style.sass", :output => "css/style.css", :syntax => :sass}
|
117
|
-
assert_parses_with_sourcemap <<SASS, <<CSS, <<JSON, options
|
117
|
+
silence_warnings {assert_parses_with_sourcemap <<SASS, <<CSS, <<JSON, options}
|
118
118
|
a
|
119
119
|
foo: bar
|
120
120
|
/* SOME COMMENT */
|
@@ -362,8 +362,7 @@ $translucent-red: rgba(255, 0, 0, 0.5);
|
|
362
362
|
}
|
363
363
|
}
|
364
364
|
{{22}}&:active {{/22}}{
|
365
|
-
{{23}}
|
366
|
-
{{25}}border{{/25}}: {{26}}$width solid black{{/26}};
|
365
|
+
{{23}}border{{/23}}: {{24}}$width solid black{{/24}};
|
367
366
|
}
|
368
367
|
{{2}}/* SOME COMMENT */{{/2}}
|
369
368
|
{{3}}font{{/3}}: {{4}}2px/3px {{/4}}{
|
@@ -386,8 +385,7 @@ SCSS
|
|
386
385
|
{{19}}a .special:after{{/19}} {
|
387
386
|
{{20}}content{{/20}}: {{21}}"I ate 15 pies 2px thick!"{{/21}}; }
|
388
387
|
{{22}}a:active{{/22}} {
|
389
|
-
{{23}}
|
390
|
-
{{25}}border{{/25}}: {{26}}2px solid black{{/26}}; }
|
388
|
+
{{23}}border{{/23}}: {{24}}2px solid black{{/24}}; }
|
391
389
|
|
392
390
|
/*# sourceMappingURL=test.css.map */
|
393
391
|
CSS
|
@@ -407,8 +405,7 @@ $translucent-red: rgba(255, 0, 0, 0.5)
|
|
407
405
|
{{19}}&:after{{/19}}
|
408
406
|
{{20}}content{{/20}}: {{21}}"I ate #{5 + 10} pies #{$width} thick!"{{/21}}
|
409
407
|
{{22}}&:active{{/22}}
|
410
|
-
{{23}}
|
411
|
-
{{25}}border{{/25}}: {{26}}$width solid black{{/26}}
|
408
|
+
{{23}}border{{/23}}: {{24}}$width solid black{{/24}}
|
412
409
|
|
413
410
|
{{2}}/* SOME COMMENT */{{/2}}
|
414
411
|
{{3}}font{{/3}}: {{4}}2px/3px{{/4}}
|
@@ -429,8 +426,7 @@ SASS
|
|
429
426
|
{{19}}a .special:after{{/19}} {
|
430
427
|
{{20}}content{{/20}}: {{21}}"I ate 15 pies 2px thick!"{{/21}}; }
|
431
428
|
{{22}}a:active{{/22}} {
|
432
|
-
{{23}}
|
433
|
-
{{25}}border{{/25}}: {{26}}2px solid black{{/26}}; }
|
429
|
+
{{23}}border{{/23}}: {{24}}2px solid black{{/24}}; }
|
434
430
|
|
435
431
|
/*# sourceMappingURL=test.css.map */
|
436
432
|
CSS
|
@@ -667,7 +663,7 @@ CSS
|
|
667
663
|
end
|
668
664
|
|
669
665
|
def test_mixin_sourcemap_sass
|
670
|
-
assert_parses_with_mapping <<'SASS', <<'CSS', :syntax => :sass
|
666
|
+
silence_warnings {assert_parses_with_mapping <<'SASS', <<'CSS', :syntax => :sass}
|
671
667
|
=large-text
|
672
668
|
:font
|
673
669
|
{{2}}size{{/2}}: {{3}}20px{{/3}}
|
@@ -761,7 +757,7 @@ CSS
|
|
761
757
|
# Regression tests
|
762
758
|
|
763
759
|
def test_properties_sass
|
764
|
-
assert_parses_with_mapping <<SASS, <<CSS, :syntax => :sass
|
760
|
+
silence_warnings {assert_parses_with_mapping <<SASS, <<CSS, :syntax => :sass}
|
765
761
|
{{1}}.foo{{/1}}
|
766
762
|
:{{2}}name{{/2}} {{3}}value{{/3}}
|
767
763
|
{{4}}name{{/4}}: {{5}}value{{/5}}
|
@@ -988,7 +984,11 @@ CSS
|
|
988
984
|
def assert_ranges_equal(expected, actual, lines, prefix)
|
989
985
|
assert_positions_equal(expected.start_pos, actual.start_pos, lines, prefix + " start position")
|
990
986
|
assert_positions_equal(expected.end_pos, actual.end_pos, lines, prefix + " end position")
|
991
|
-
|
987
|
+
if expected.file.nil?
|
988
|
+
assert_nil(actual.file)
|
989
|
+
else
|
990
|
+
assert_equal(expected.file, actual.file)
|
991
|
+
end
|
992
992
|
end
|
993
993
|
|
994
994
|
def assert_sourcemaps_equal(source, css, expected, actual)
|
@@ -1,2 +1,2 @@
|
|
1
1
|
#foo
|
2
|
-
|
2
|
+
background-color: #baf
|
@@ -1,23 +1,23 @@
|
|
1
1
|
|
2
2
|
|
3
3
|
body
|
4
|
-
:
|
5
|
-
:
|
4
|
+
font: Arial
|
5
|
+
background: blue
|
6
6
|
|
7
7
|
#page
|
8
|
-
:
|
9
|
-
:
|
8
|
+
width: 700px
|
9
|
+
height: 100
|
10
10
|
#header
|
11
|
-
:
|
11
|
+
height: 300px
|
12
12
|
h1
|
13
|
-
|
14
|
-
:
|
13
|
+
font-size: 50px
|
14
|
+
color: blue
|
15
15
|
|
16
16
|
#content.user.show
|
17
17
|
#container.top
|
18
18
|
#column.left
|
19
|
-
:
|
19
|
+
width: 100px
|
20
20
|
#column.right
|
21
|
-
:
|
21
|
+
width: 600px
|
22
22
|
#container.bottom
|
23
|
-
:
|
23
|
+
background: brown
|