sass 3.5.0.pre.rc.1 → 3.5.0
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 +40 -11
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/extra/sass-spec-ref.sh +32 -0
- 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 +16 -12
- data/lib/sass/environment.rb +1 -1
- data/lib/sass/error.rb +3 -3
- data/lib/sass/exec/base.rb +1 -1
- data/lib/sass/plugin.rb +1 -1
- data/lib/sass/plugin/compiler.rb +1 -1
- data/lib/sass/plugin/configuration.rb +2 -2
- data/lib/sass/plugin/rack.rb +3 -3
- data/lib/sass/plugin/staleness_checker.rb +3 -3
- data/lib/sass/script.rb +3 -3
- data/lib/sass/script/functions.rb +23 -22
- data/lib/sass/script/lexer.rb +17 -8
- data/lib/sass/script/parser.rb +8 -7
- data/lib/sass/script/tree/node.rb +2 -2
- data/lib/sass/script/tree/operation.rb +43 -16
- data/lib/sass/script/value/base.rb +3 -3
- data/lib/sass/script/value/color.rb +15 -10
- data/lib/sass/script/value/helpers.rb +13 -2
- data/lib/sass/script/value/list.rb +2 -2
- data/lib/sass/script/value/number.rb +4 -4
- data/lib/sass/script/value/string.rb +5 -12
- data/lib/sass/scss/parser.rb +7 -4
- data/lib/sass/scss/rx.rb +1 -1
- data/lib/sass/scss/static_parser.rb +12 -24
- data/lib/sass/selector/abstract_sequence.rb +12 -11
- data/lib/sass/selector/comma_sequence.rb +18 -3
- data/lib/sass/selector/pseudo.rb +15 -2
- data/lib/sass/selector/sequence.rb +9 -7
- data/lib/sass/selector/simple.rb +5 -4
- data/lib/sass/selector/simple_sequence.rb +7 -3
- data/lib/sass/shared.rb +5 -3
- data/lib/sass/source/map.rb +2 -2
- data/lib/sass/source/position.rb +4 -4
- data/lib/sass/tree/comment_node.rb +1 -1
- data/lib/sass/tree/node.rb +3 -3
- data/lib/sass/tree/prop_node.rb +1 -1
- data/lib/sass/tree/rule_node.rb +15 -6
- data/lib/sass/tree/visitors/cssize.rb +3 -5
- data/lib/sass/tree/visitors/deep_copy.rb +1 -1
- data/lib/sass/tree/visitors/extend.rb +2 -8
- data/lib/sass/tree/visitors/perform.rb +3 -2
- data/lib/sass/tree/visitors/to_css.rb +3 -3
- data/lib/sass/util.rb +32 -5
- data/lib/sass/version.rb +2 -4
- data/test/sass/cache_test.rb +0 -1
- data/test/sass/callbacks_test.rb +0 -1
- data/test/sass/compiler_test.rb +0 -1
- data/test/sass/conversion_test.rb +3 -4
- data/test/sass/css2sass_test.rb +1 -2
- data/test/sass/css_variable_test.rb +0 -1
- data/test/sass/encoding_test.rb +0 -1
- data/test/sass/engine_test.rb +63 -60
- data/test/sass/exec_test.rb +0 -1
- data/test/sass/extend_test.rb +40 -81
- data/test/sass/functions_test.rb +8 -6
- data/test/sass/importer_test.rb +0 -1
- data/test/sass/logger_test.rb +0 -1
- 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 -4
- data/test/sass/results/script.css +1 -1
- data/test/sass/results/units.css +2 -2
- data/test/sass/script_conversion_test.rb +1 -2
- data/test/sass/script_test.rb +55 -47
- data/test/sass/scss/css_test.rb +2 -3
- data/test/sass/scss/rx_test.rb +0 -1
- data/test/sass/scss/scss_test.rb +26 -12
- data/test/sass/source_map_test.rb +13 -14
- data/test/sass/superselector_test.rb +0 -1
- 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 -3
- data/test/sass/util/normalized_map_test.rb +0 -1
- data/test/sass/util/subset_map_test.rb +0 -1
- data/test/sass/util_test.rb +4 -3
- data/test/sass/value_helpers_test.rb +0 -1
- metadata +15 -13
data/test/sass/functions_test.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
1
|
require 'minitest/autorun'
|
3
2
|
require File.dirname(__FILE__) + '/../test_helper'
|
4
3
|
require File.dirname(__FILE__) + '/test_helper'
|
@@ -413,8 +412,8 @@ WARNING
|
|
413
412
|
assert_equal("rgba(0, 0, 0, 0.3)", evaluate("transparentize(rgba(0, 0, 0, 0.5), 0.2)"))
|
414
413
|
assert_equal("rgba(0, 0, 0, 0.1)", evaluate("transparentize(rgba(0, 0, 0, 0.2), 0.1)"))
|
415
414
|
assert_equal("rgba(0, 0, 0, 0.2)", evaluate("fade-out(rgba(0, 0, 0, 0.5), 0.3px)"))
|
416
|
-
assert_equal("
|
417
|
-
assert_equal("
|
415
|
+
assert_equal("rgba(0, 0, 0, 0)", evaluate("fade_out(rgba(0, 0, 0, 0.2), 0.2)"))
|
416
|
+
assert_equal("rgba(0, 0, 0, 0)", evaluate("transparentize(rgba(0, 0, 0, 0.2), 1)"))
|
418
417
|
assert_equal("rgba(0, 0, 0, 0.2)", evaluate("transparentize(rgba(0, 0, 0, 0.2), 0)"))
|
419
418
|
assert_equal("rgba(0, 0, 0, 0.2)", evaluate("transparentize($color: rgba(0, 0, 0, 0.2), $amount: 0)"))
|
420
419
|
assert_equal("rgba(0, 0, 0, 0.2)", evaluate("fade-out($color: rgba(0, 0, 0, 0.2), $amount: 0)"))
|
@@ -1682,7 +1681,7 @@ SCSS
|
|
1682
1681
|
|
1683
1682
|
def test_random
|
1684
1683
|
Sass::Script::Functions.random_seed = 1
|
1685
|
-
assert_equal "0.
|
1684
|
+
assert_equal "0.4170220047", evaluate("random()")
|
1686
1685
|
assert_equal "13", evaluate("random(100)")
|
1687
1686
|
end
|
1688
1687
|
|
@@ -1886,8 +1885,11 @@ WARNING
|
|
1886
1885
|
assert_equal(".bar", evaluate("selector-replace('.foo', '.foo', '.bar')"))
|
1887
1886
|
assert_equal(".foo.baz", evaluate("selector-replace('.foo.bar', '.bar', '.baz')"))
|
1888
1887
|
assert_equal(".a .foo.baz", evaluate("selector-replace('.foo.bar', '.bar', '.a .baz')"))
|
1889
|
-
|
1890
|
-
|
1888
|
+
|
1889
|
+
# These shouldn't warn since we still support componud targets for selector
|
1890
|
+
# functions.
|
1891
|
+
assert_no_warning {assert_equal(".foo.bar", evaluate("selector-replace('.foo.bar', '.baz.bar', '.qux')"))}
|
1892
|
+
assert_no_warning {assert_equal(".bar.qux", evaluate("selector-replace('.foo.bar.baz', '.foo.baz', '.qux')"))}
|
1891
1893
|
|
1892
1894
|
assert_equal(":not(.bar)", evaluate("selector-replace(':not(.foo)', '.foo', '.bar')"))
|
1893
1895
|
assert_equal(".bar", evaluate("selector-replace(':not(.foo)', ':not(.foo)', '.bar')"))
|
data/test/sass/importer_test.rb
CHANGED
data/test/sass/logger_test.rb
CHANGED
@@ -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
@@ -1,4 +1,3 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
1
|
require File.dirname(__FILE__) + '/../test_helper'
|
3
2
|
require File.dirname(__FILE__) + '/test_helper'
|
4
3
|
require 'sass/plugin'
|
@@ -44,7 +43,7 @@ class SassPluginTest < MiniTest::Test
|
|
44
43
|
|
45
44
|
@@templates.each do |name|
|
46
45
|
define_method("test_template_renders_correctly (#{name})") do
|
47
|
-
assert_renders_correctly(name)
|
46
|
+
silence_warnings {assert_renders_correctly(name)}
|
48
47
|
end
|
49
48
|
end
|
50
49
|
|
@@ -116,7 +115,7 @@ Error: Undefined variable: "$bork".
|
|
116
115
|
on line 2 of #{template_loc('bork1')}
|
117
116
|
|
118
117
|
1: bork
|
119
|
-
2: :
|
118
|
+
2: bork: $bork
|
120
119
|
CSS
|
121
120
|
end
|
122
121
|
File.delete(tempfile_loc('bork1'))
|
@@ -133,7 +132,7 @@ Error: Undefined variable: "$bork".
|
|
133
132
|
|
134
133
|
1: bork
|
135
134
|
2: /* foo *\\/
|
136
|
-
3: :
|
135
|
+
3: bork: $bork
|
137
136
|
CSS
|
138
137
|
end
|
139
138
|
File.delete(tempfile_loc('bork1'))
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
#times { num-num: 7; num-col: #7496b8; col-num: #092345; col-col: #243648; }
|
9
9
|
|
10
|
-
#div { num-num: 3.
|
10
|
+
#div { num-num: 3.3333333333; num-num2: 3.3333333333; col-num: #092345; col-col: #0b0e10; comp: 1px; }
|
11
11
|
|
12
12
|
#mod { num-num: 2; col-col: #0f0e05; col-num: #020001; }
|
13
13
|
|
data/test/sass/results/units.css
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
1
|
# -*- coding: utf-8 -*-
|
3
2
|
require File.dirname(__FILE__) + '/../test_helper'
|
4
3
|
require 'sass/engine'
|
@@ -23,7 +22,7 @@ class SassScriptConversionTest < MiniTest::Test
|
|
23
22
|
assert_renders "12px"
|
24
23
|
assert_renders "12.45px"
|
25
24
|
|
26
|
-
assert_equal "12.
|
25
|
+
assert_equal "12.3456789013", render("12.34567890129")
|
27
26
|
end
|
28
27
|
|
29
28
|
def test_string
|
data/test/sass/script_test.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
1
|
# -*- coding: utf-8 -*-
|
3
2
|
require File.dirname(__FILE__) + '/../test_helper'
|
4
3
|
require 'sass/engine'
|
@@ -78,9 +77,9 @@ class SassScriptTest < MiniTest::Test
|
|
78
77
|
def test_color_names
|
79
78
|
assert_equal "white", resolve("white")
|
80
79
|
assert_equal "#ffffff", resolve("#ffffff")
|
81
|
-
assert_equal "#fffffe", resolve("white - #000001")
|
80
|
+
silence_warnings {assert_equal "#fffffe", resolve("white - #000001")}
|
82
81
|
assert_equal "transparent", resolve("transparent")
|
83
|
-
assert_equal "
|
82
|
+
assert_equal "rgba(0, 0, 0, 0)", resolve("rgba(0, 0, 0, 0)")
|
84
83
|
end
|
85
84
|
|
86
85
|
def test_rgba_color_literals
|
@@ -97,27 +96,27 @@ class SassScriptTest < MiniTest::Test
|
|
97
96
|
end
|
98
97
|
|
99
98
|
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)")
|
99
|
+
silence_warnings {assert_equal "rgba(50, 50, 100, 0.35)", resolve("rgba(1, 1, 2, 0.35) * rgba(50, 50, 50, 0.35)")}
|
100
|
+
silence_warnings {assert_equal "rgba(52, 52, 52, 0.25)", resolve("rgba(2, 2, 2, 0.25) + rgba(50, 50, 50, 0.25)")}
|
102
101
|
|
103
102
|
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)")
|
103
|
+
silence_warnings {resolve("rgba(1, 2, 3, 0.15) + rgba(50, 50, 50, 0.75)")}
|
105
104
|
end
|
106
105
|
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)")
|
106
|
+
silence_warnings {resolve("#123456 * rgba(50, 50, 50, 0.75)")}
|
108
107
|
end
|
109
108
|
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")
|
109
|
+
silence_warnings {resolve("rgba(50, 50, 50, 0.75) / #123456")}
|
111
110
|
end
|
112
111
|
end
|
113
112
|
|
114
113
|
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")
|
114
|
+
silence_warnings {assert_equal "rgba(49, 49, 49, 0.75)", resolve("rgba(50, 50, 50, 0.75) - 1")}
|
115
|
+
silence_warnings {assert_equal "rgba(100, 100, 100, 0.75)", resolve("rgba(50, 50, 50, 0.75) * 2")}
|
117
116
|
end
|
118
117
|
|
119
118
|
def test_rgba_rounding
|
120
|
-
assert_equal "rgba(10, 1, 0, 0.
|
119
|
+
assert_equal "rgba(10, 1, 0, 0.1234567892)", resolve("rgba(10.0, 1.23456789, 0.0, 0.12345678919)")
|
121
120
|
end
|
122
121
|
|
123
122
|
def test_rgb_calc
|
@@ -504,7 +503,7 @@ SASS
|
|
504
503
|
|
505
504
|
def test_functions
|
506
505
|
assert_equal "#80ff80", resolve("hsl(120, 100%, 75%)")
|
507
|
-
assert_equal "#81ff81", resolve("hsl(120, 100%, 75%) + #010001")
|
506
|
+
silence_warnings {assert_equal "#81ff81", resolve("hsl(120, 100%, 75%) + #010001")}
|
508
507
|
end
|
509
508
|
|
510
509
|
def test_operator_unit_conversion
|
@@ -518,34 +517,36 @@ SASS
|
|
518
517
|
assert_equal "true", resolve("2mm == 8q")
|
519
518
|
assert_equal "false", resolve("2px > 3q")
|
520
519
|
|
521
|
-
|
520
|
+
Sass::Deprecation.allow_double_warnings do
|
521
|
+
assert_warning(<<WARNING) {assert_equal "true", resolve("1 == 1cm")}
|
522
522
|
DEPRECATION WARNING on line 1 of test_operator_unit_conversion_inline.sass:
|
523
523
|
The result of `1 == 1cm` will be `false` in future releases of Sass.
|
524
524
|
Unitless numbers will no longer be equal to the same numbers with units.
|
525
525
|
WARNING
|
526
526
|
|
527
|
-
|
527
|
+
assert_warning(<<WARNING) {assert_equal "false", resolve("1 != 1cm")}
|
528
528
|
DEPRECATION WARNING on line 1 of test_operator_unit_conversion_inline.sass:
|
529
529
|
The result of `1 != 1cm` will be `true` in future releases of Sass.
|
530
530
|
Unitless numbers will no longer be equal to the same numbers with units.
|
531
531
|
WARNING
|
532
|
+
end
|
532
533
|
end
|
533
534
|
|
534
535
|
def test_length_units
|
535
536
|
assert_equal "2.54", resolve("(1in/1cm)")
|
536
|
-
assert_equal "2.
|
537
|
-
assert_equal "4.
|
538
|
-
assert_equal "2.
|
539
|
-
assert_equal "1.
|
540
|
-
assert_equal "0.
|
541
|
-
assert_equal "1.
|
542
|
-
assert_equal "0.
|
537
|
+
assert_equal "2.3622047244", resolve("(1cm/1pc)")
|
538
|
+
assert_equal "4.2333333333", resolve("(1pc/1mm)")
|
539
|
+
assert_equal "2.8346456693", resolve("(1mm/1pt)")
|
540
|
+
assert_equal "1.3333333333", resolve("(1pt/1px)")
|
541
|
+
assert_equal "0.0104166667", resolve("(1px/1in)")
|
542
|
+
assert_equal "1.0583333333", resolve("(1px/1q)")
|
543
|
+
assert_equal "0.0590551181", resolve("(1q/1pc)")
|
543
544
|
end
|
544
545
|
|
545
546
|
def test_angle_units
|
546
|
-
assert_equal "1.
|
547
|
-
assert_equal "0.
|
548
|
-
assert_equal "0.
|
547
|
+
assert_equal "1.1111111111", resolve("(1deg/1grad)")
|
548
|
+
assert_equal "0.0157079633", resolve("(1grad/1rad)")
|
549
|
+
assert_equal "0.1591549431", resolve("(1rad/1turn)")
|
549
550
|
assert_equal "360", resolve("(1turn/1deg)")
|
550
551
|
end
|
551
552
|
|
@@ -558,9 +559,9 @@ WARNING
|
|
558
559
|
end
|
559
560
|
|
560
561
|
def test_resolution_units
|
561
|
-
assert_equal "
|
562
|
-
assert_equal "
|
563
|
-
assert_equal "
|
562
|
+
assert_equal "0.3937007874", resolve("(1dpi/1dpcm)")
|
563
|
+
assert_equal "0.0264583333", resolve("(1dpcm/1dppx)")
|
564
|
+
assert_equal "96", resolve("(1dppx/1dpi)")
|
564
565
|
end
|
565
566
|
|
566
567
|
def test_operations_have_options
|
@@ -988,7 +989,7 @@ SCSS
|
|
988
989
|
end
|
989
990
|
|
990
991
|
def test_color_format_isnt_preserved_when_modified
|
991
|
-
assert_equal "magenta", resolve("#f00
|
992
|
+
assert_equal "magenta", resolve("change-color(#f00, $blue: 255)")
|
992
993
|
end
|
993
994
|
|
994
995
|
def test_ids
|
@@ -1175,8 +1176,8 @@ SASS
|
|
1175
1176
|
assert_equal "1", resolve("1.0")
|
1176
1177
|
assert_equal "1000000000", resolve("1000000000")
|
1177
1178
|
assert_equal "0.00001", resolve("0.00001")
|
1178
|
-
assert_equal "1.
|
1179
|
-
assert_equal "1.
|
1179
|
+
assert_equal "1.1212121212", resolve("1.12121212124")
|
1180
|
+
assert_equal "1.1212121213", resolve("1.12121212125")
|
1180
1181
|
assert_equal "Infinity", resolve("(1.0/0.0)")
|
1181
1182
|
assert_equal "-Infinity", resolve("(-1.0/0.0)")
|
1182
1183
|
assert_equal "NaN", resolve("(0.0/0.0)")
|
@@ -1306,32 +1307,37 @@ SASS
|
|
1306
1307
|
end
|
1307
1308
|
|
1308
1309
|
def test_active_lazy_interpolation_deprecation_warning
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1310
|
+
Sass::Deprecation.allow_double_warnings do
|
1311
|
+
assert_equal "1, 2, 3", resolve_with_lazy_interp_warning('quote((1, #{2}, 3))', '"1, 2, 3"')
|
1312
|
+
assert_equal "1", resolve_with_lazy_interp_warning('length((1, #{2}, 3))', '"1, 2, 3"')
|
1313
|
+
assert_equal "1, 2, 3", resolve_with_lazy_interp_warning('inspect((1, #{2}, 3))', '"1, 2, 3"')
|
1314
|
+
assert_equal "string", resolve_with_lazy_interp_warning('type-of((1, #{2}, 3))', '"1, 2, 3"')
|
1315
|
+
|
1316
|
+
assert_equal "+1 2 3", resolve_with_lazy_interp_warning('quote((+#{1} 2 3))', '"+1 #{2 3}"')
|
1317
|
+
assert_equal "/1 2 3", resolve_with_lazy_interp_warning('quote((/#{1} 2 3))', '"/1 #{2 3}"')
|
1318
|
+
assert_equal "-1 2 3", resolve_with_lazy_interp_warning('quote((-#{1} 2 3))', '"-1 #{2 3}"')
|
1319
|
+
end
|
1317
1320
|
end
|
1318
1321
|
|
1319
1322
|
def test_comparison_of_complex_units
|
1320
1323
|
# Tests for issue #1960
|
1321
|
-
|
1324
|
+
Sass::Deprecation.allow_double_warnings do
|
1325
|
+
assert_warning(<<WARNING) do
|
1322
1326
|
DEPRECATION WARNING on line 1 of test_comparison_of_complex_units_inline.sass:
|
1323
1327
|
The result of `10 == 10px` will be `false` in future releases of Sass.
|
1324
1328
|
Unitless numbers will no longer be equal to the same numbers with units.
|
1325
1329
|
WARNING
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1330
|
+
assert_equal "true", resolve("10 == 2 * 5px")
|
1331
|
+
end
|
1332
|
+
assert_warning(<<WARNING) do
|
1329
1333
|
DEPRECATION WARNING on line 1 of test_comparison_of_complex_units_inline.sass:
|
1330
1334
|
The result of `10 == 10px*px` will be `false` in future releases of Sass.
|
1331
1335
|
Unitless numbers will no longer be equal to the same numbers with units.
|
1332
1336
|
WARNING
|
1333
|
-
|
1337
|
+
assert_equal "true", resolve("10 == 2px * 5px")
|
1338
|
+
end
|
1334
1339
|
end
|
1340
|
+
|
1335
1341
|
assert_equal "true", resolve("10px * 1px == 2px * 5px")
|
1336
1342
|
assert_equal "true", resolve("5px * 1px < 2px * 5px")
|
1337
1343
|
end
|
@@ -1341,8 +1347,9 @@ WARNING
|
|
1341
1347
|
def resolve_with_lazy_interp_warning(str, contents = nil, environment = env)
|
1342
1348
|
contents ||= "\"#{str}\""
|
1343
1349
|
result = assert_warning(<<WARNING) {resolve(str, {}, environment)}
|
1344
|
-
DEPRECATION WARNING on line 1 of #{filename_for_test}:
|
1345
|
-
in a future version of Sass.
|
1350
|
+
DEPRECATION WARNING on line 1 of #{filename_for_test}:
|
1351
|
+
\#{} interpolation near operators will be simplified in a future version of Sass.
|
1352
|
+
To preserve the current behavior, use quotes:
|
1346
1353
|
|
1347
1354
|
unquote(#{contents})
|
1348
1355
|
WARNING
|
@@ -1353,8 +1360,9 @@ WARNING
|
|
1353
1360
|
def resolve_with_interp_warning(str, contents = nil, environment = env)
|
1354
1361
|
contents ||= "\"#{str}\""
|
1355
1362
|
assert_warning(<<WARNING) {resolve(str, {}, environment)}
|
1356
|
-
DEPRECATION WARNING on line 1 of #{filename_for_test}:
|
1357
|
-
in a future version of Sass.
|
1363
|
+
DEPRECATION WARNING on line 1 of #{filename_for_test}:
|
1364
|
+
\#{} interpolation near operators will be simplified in a future version of Sass.
|
1365
|
+
To preserve the current behavior, use quotes:
|
1358
1366
|
|
1359
1367
|
unquote(#{contents})
|
1360
1368
|
|
data/test/sass/scss/css_test.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
1
|
# -*- coding: utf-8 -*-
|
3
2
|
require File.dirname(__FILE__) + '/test_helper'
|
4
3
|
require 'sass/scss/css_parser'
|
@@ -805,10 +804,10 @@ SCSS
|
|
805
804
|
assert_selector_parses('E > F')
|
806
805
|
assert_selector_parses('E + F')
|
807
806
|
assert_selector_parses('E ~ F')
|
808
|
-
assert_selector_parses('E /foo/ F')
|
807
|
+
silence_warnings {assert_selector_parses('E /foo/ F')}
|
809
808
|
silence_warnings {assert_selector_parses('E! > F')}
|
810
809
|
|
811
|
-
assert_selector_parses('E /ns|foo/ F')
|
810
|
+
silence_warnings {assert_selector_parses('E /ns|foo/ F')}
|
812
811
|
|
813
812
|
# From http://dev.w3.org/csswg/css-scoping-1/
|
814
813
|
assert_selector_parses('E:host(s)')
|
data/test/sass/scss/rx_test.rb
CHANGED
data/test/sass/scss/scss_test.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
1
|
# -*- coding: utf-8 -*-
|
3
2
|
require File.dirname(__FILE__) + '/test_helper'
|
4
3
|
|
@@ -1015,7 +1014,8 @@ SASS
|
|
1015
1014
|
end
|
1016
1015
|
|
1017
1016
|
def test_disallowed_function_names
|
1018
|
-
|
1017
|
+
Sass::Deprecation.allow_double_warnings do
|
1018
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1019
1019
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1020
1020
|
Naming a function "calc" is disallowed and will be an error in future versions of Sass.
|
1021
1021
|
This name conflicts with an existing CSS function with special parse rules.
|
@@ -1023,7 +1023,7 @@ WARNING
|
|
1023
1023
|
@function calc() {}
|
1024
1024
|
SCSS
|
1025
1025
|
|
1026
|
-
|
1026
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1027
1027
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1028
1028
|
Naming a function "-my-calc" is disallowed and will be an error in future versions of Sass.
|
1029
1029
|
This name conflicts with an existing CSS function with special parse rules.
|
@@ -1031,7 +1031,7 @@ WARNING
|
|
1031
1031
|
@function -my-calc() {}
|
1032
1032
|
SCSS
|
1033
1033
|
|
1034
|
-
|
1034
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1035
1035
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1036
1036
|
Naming a function "element" is disallowed and will be an error in future versions of Sass.
|
1037
1037
|
This name conflicts with an existing CSS function with special parse rules.
|
@@ -1039,7 +1039,7 @@ WARNING
|
|
1039
1039
|
@function element() {}
|
1040
1040
|
SCSS
|
1041
1041
|
|
1042
|
-
|
1042
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1043
1043
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1044
1044
|
Naming a function "-my-element" is disallowed and will be an error in future versions of Sass.
|
1045
1045
|
This name conflicts with an existing CSS function with special parse rules.
|
@@ -1047,7 +1047,7 @@ WARNING
|
|
1047
1047
|
@function -my-element() {}
|
1048
1048
|
SCSS
|
1049
1049
|
|
1050
|
-
|
1050
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1051
1051
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1052
1052
|
Naming a function "expression" is disallowed and will be an error in future versions of Sass.
|
1053
1053
|
This name conflicts with an existing CSS function with special parse rules.
|
@@ -1055,13 +1055,14 @@ WARNING
|
|
1055
1055
|
@function expression() {}
|
1056
1056
|
SCSS
|
1057
1057
|
|
1058
|
-
|
1058
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1059
1059
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1060
1060
|
Naming a function "url" is disallowed and will be an error in future versions of Sass.
|
1061
1061
|
This name conflicts with an existing CSS function with special parse rules.
|
1062
1062
|
WARNING
|
1063
1063
|
@function url() {}
|
1064
1064
|
SCSS
|
1065
|
+
end
|
1065
1066
|
end
|
1066
1067
|
|
1067
1068
|
def test_allowed_function_names
|
@@ -2172,7 +2173,7 @@ SCSS
|
|
2172
2173
|
end
|
2173
2174
|
|
2174
2175
|
def test_selector_interpolation_in_reference_combinator
|
2175
|
-
assert_equal <<CSS, render(<<SCSS)
|
2176
|
+
silence_warnings {assert_equal <<CSS, render(<<SCSS)}
|
2176
2177
|
.foo /a/ .bar /b|c/ .baz {
|
2177
2178
|
a: b; }
|
2178
2179
|
CSS
|
@@ -3666,8 +3667,9 @@ SCSS
|
|
3666
3667
|
# Ensures that the fix for #2031 doesn't hide legitimate warnings.
|
3667
3668
|
def test_interpolation_warning_in_selector_like_property
|
3668
3669
|
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.
|
3670
|
+
DEPRECATION WARNING on line 2 of #{filename_for_test :scss}:
|
3671
|
+
\#{} interpolation near operators will be simplified in a future version of Sass.
|
3672
|
+
To preserve the current behavior, use quotes:
|
3671
3673
|
|
3672
3674
|
unquote("n+1")
|
3673
3675
|
|
@@ -3824,7 +3826,7 @@ SCSS
|
|
3824
3826
|
def test_parsing_decimals_followed_by_comments_doesnt_take_forever
|
3825
3827
|
assert_equal(<<CSS, render(<<SCSS))
|
3826
3828
|
.foo {
|
3827
|
-
padding: 4.
|
3829
|
+
padding: 4.2105263158% 4.2105263158% 5.6315789474%; }
|
3828
3830
|
CSS
|
3829
3831
|
.foo {
|
3830
3832
|
padding: 4.21052631578947% 4.21052631578947% 5.631578947368421% /**/
|
@@ -3857,7 +3859,19 @@ SCSS
|
|
3857
3859
|
end
|
3858
3860
|
|
3859
3861
|
def test_reference_combinator_with_parent_ref
|
3860
|
-
assert_equal <<CSS, render(<<SCSS)
|
3862
|
+
silence_warnings {assert_equal <<CSS, render(<<SCSS)}
|
3863
|
+
a /foo/ b {
|
3864
|
+
c: d; }
|
3865
|
+
CSS
|
3866
|
+
a {& /foo/ b {c: d}}
|
3867
|
+
SCSS
|
3868
|
+
end
|
3869
|
+
|
3870
|
+
def test_reference_combinator_warning
|
3871
|
+
assert_warning(<<WARNING) {assert_equal <<CSS, render(<<SCSS)}
|
3872
|
+
DEPRECATION WARNING on line 1, column 8 of test_reference_combinator_warning_inline.scss:
|
3873
|
+
The reference combinator /foo/ is deprecated and will be removed in a future release.
|
3874
|
+
WARNING
|
3861
3875
|
a /foo/ b {
|
3862
3876
|
c: d; }
|
3863
3877
|
CSS
|