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.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/README.md +1 -1
  4. data/Rakefile +40 -11
  5. data/VERSION +1 -1
  6. data/VERSION_DATE +1 -1
  7. data/extra/sass-spec-ref.sh +32 -0
  8. data/lib/sass.rb +3 -3
  9. data/lib/sass/css.rb +1 -1
  10. data/lib/sass/deprecation.rb +55 -0
  11. data/lib/sass/engine.rb +16 -12
  12. data/lib/sass/environment.rb +1 -1
  13. data/lib/sass/error.rb +3 -3
  14. data/lib/sass/exec/base.rb +1 -1
  15. data/lib/sass/plugin.rb +1 -1
  16. data/lib/sass/plugin/compiler.rb +1 -1
  17. data/lib/sass/plugin/configuration.rb +2 -2
  18. data/lib/sass/plugin/rack.rb +3 -3
  19. data/lib/sass/plugin/staleness_checker.rb +3 -3
  20. data/lib/sass/script.rb +3 -3
  21. data/lib/sass/script/functions.rb +23 -22
  22. data/lib/sass/script/lexer.rb +17 -8
  23. data/lib/sass/script/parser.rb +8 -7
  24. data/lib/sass/script/tree/node.rb +2 -2
  25. data/lib/sass/script/tree/operation.rb +43 -16
  26. data/lib/sass/script/value/base.rb +3 -3
  27. data/lib/sass/script/value/color.rb +15 -10
  28. data/lib/sass/script/value/helpers.rb +13 -2
  29. data/lib/sass/script/value/list.rb +2 -2
  30. data/lib/sass/script/value/number.rb +4 -4
  31. data/lib/sass/script/value/string.rb +5 -12
  32. data/lib/sass/scss/parser.rb +7 -4
  33. data/lib/sass/scss/rx.rb +1 -1
  34. data/lib/sass/scss/static_parser.rb +12 -24
  35. data/lib/sass/selector/abstract_sequence.rb +12 -11
  36. data/lib/sass/selector/comma_sequence.rb +18 -3
  37. data/lib/sass/selector/pseudo.rb +15 -2
  38. data/lib/sass/selector/sequence.rb +9 -7
  39. data/lib/sass/selector/simple.rb +5 -4
  40. data/lib/sass/selector/simple_sequence.rb +7 -3
  41. data/lib/sass/shared.rb +5 -3
  42. data/lib/sass/source/map.rb +2 -2
  43. data/lib/sass/source/position.rb +4 -4
  44. data/lib/sass/tree/comment_node.rb +1 -1
  45. data/lib/sass/tree/node.rb +3 -3
  46. data/lib/sass/tree/prop_node.rb +1 -1
  47. data/lib/sass/tree/rule_node.rb +15 -6
  48. data/lib/sass/tree/visitors/cssize.rb +3 -5
  49. data/lib/sass/tree/visitors/deep_copy.rb +1 -1
  50. data/lib/sass/tree/visitors/extend.rb +2 -8
  51. data/lib/sass/tree/visitors/perform.rb +3 -2
  52. data/lib/sass/tree/visitors/to_css.rb +3 -3
  53. data/lib/sass/util.rb +32 -5
  54. data/lib/sass/version.rb +2 -4
  55. data/test/sass/cache_test.rb +0 -1
  56. data/test/sass/callbacks_test.rb +0 -1
  57. data/test/sass/compiler_test.rb +0 -1
  58. data/test/sass/conversion_test.rb +3 -4
  59. data/test/sass/css2sass_test.rb +1 -2
  60. data/test/sass/css_variable_test.rb +0 -1
  61. data/test/sass/encoding_test.rb +0 -1
  62. data/test/sass/engine_test.rb +63 -60
  63. data/test/sass/exec_test.rb +0 -1
  64. data/test/sass/extend_test.rb +40 -81
  65. data/test/sass/functions_test.rb +8 -6
  66. data/test/sass/importer_test.rb +0 -1
  67. data/test/sass/logger_test.rb +0 -1
  68. data/test/sass/more_templates/more1.sass +10 -10
  69. data/test/sass/more_templates/more_import.sass +2 -2
  70. data/test/sass/plugin_test.rb +3 -4
  71. data/test/sass/results/script.css +1 -1
  72. data/test/sass/results/units.css +2 -2
  73. data/test/sass/script_conversion_test.rb +1 -2
  74. data/test/sass/script_test.rb +55 -47
  75. data/test/sass/scss/css_test.rb +2 -3
  76. data/test/sass/scss/rx_test.rb +0 -1
  77. data/test/sass/scss/scss_test.rb +26 -12
  78. data/test/sass/source_map_test.rb +13 -14
  79. data/test/sass/superselector_test.rb +0 -1
  80. data/test/sass/templates/_partial.sass +1 -1
  81. data/test/sass/templates/basic.sass +10 -10
  82. data/test/sass/templates/bork1.sass +1 -1
  83. data/test/sass/templates/bork5.sass +1 -1
  84. data/test/sass/templates/compact.sass +10 -10
  85. data/test/sass/templates/complex.sass +187 -187
  86. data/test/sass/templates/compressed.sass +10 -10
  87. data/test/sass/templates/expanded.sass +10 -10
  88. data/test/sass/templates/import.sass +2 -2
  89. data/test/sass/templates/importee.sass +3 -3
  90. data/test/sass/templates/mixins.sass +22 -22
  91. data/test/sass/templates/multiline.sass +4 -4
  92. data/test/sass/templates/nested.sass +13 -13
  93. data/test/sass/templates/parent_ref.sass +12 -12
  94. data/test/sass/templates/script.sass +70 -70
  95. data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +1 -1
  96. data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +2 -2
  97. data/test/sass/templates/subdir/subdir.sass +3 -3
  98. data/test/sass/templates/units.sass +10 -10
  99. data/test/sass/util/multibyte_string_scanner_test.rb +10 -3
  100. data/test/sass/util/normalized_map_test.rb +0 -1
  101. data/test/sass/util/subset_map_test.rb +0 -1
  102. data/test/sass/util_test.rb +4 -3
  103. data/test/sass/value_helpers_test.rb +0 -1
  104. metadata +15 -13
@@ -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("transparent", evaluate("fade_out(rgba(0, 0, 0, 0.2), 0.2)"))
417
- assert_equal("transparent", evaluate("transparentize(rgba(0, 0, 0, 0.2), 1)"))
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.41702", evaluate("random()")
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
- assert_equal(".foo.bar", evaluate("selector-replace('.foo.bar', '.baz.bar', '.qux')"))
1890
- assert_equal(".bar.qux", evaluate("selector-replace('.foo.bar.baz', '.foo.baz', '.qux')"))
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')"))
@@ -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 'mock_importer'
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env ruby
2
1
  require File.dirname(__FILE__) + '/../test_helper'
3
2
  require 'pathname'
4
3
 
@@ -1,23 +1,23 @@
1
1
 
2
2
 
3
3
  body
4
- :font Arial
5
- :background blue
4
+ font: Arial
5
+ background: blue
6
6
 
7
7
  #page
8
- :width 700px
9
- :height 100
8
+ width: 700px
9
+ height: 100
10
10
  #header
11
- :height 300px
11
+ height: 300px
12
12
  h1
13
- :font-size 50px
14
- :color blue
13
+ font-size: 50px
14
+ color: blue
15
15
 
16
16
  #content.user.show
17
17
  #container.top
18
18
  #column.left
19
- :width 100px
19
+ width: 100px
20
20
  #column.right
21
- :width 600px
21
+ width: 600px
22
22
  #container.bottom
23
- :background brown
23
+ background: brown
@@ -6,6 +6,6 @@ $preconst: hello
6
6
  @import importee, basic, basic.css, ../results/complex.css, more_partial
7
7
 
8
8
  nonimported
9
- :myconst $preconst
10
- :otherconst $postconst
9
+ myconst: $preconst
10
+ otherconst: $postconst
11
11
  +postmixin
@@ -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: :bork $bork
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: :bork $bork
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.33333; num-num2: 3.33333; col-num: #092345; col-col: #0b0e10; comp: 1px; }
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
 
@@ -1,11 +1,11 @@
1
1
  b {
2
2
  foo: 5px;
3
3
  bar: 24px;
4
- baz: 66.66667%;
4
+ baz: 66.6666666667%;
5
5
  many-units: 32em;
6
6
  mm: 15mm;
7
7
  pc: 2pc;
8
8
  pt: -72pt;
9
9
  inches: 2in;
10
10
  more-inches: 3.5in;
11
- mixed: 2.04167in; }
11
+ mixed: 2.0416666667in; }
@@ -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.34568", render("12.345678901")
25
+ assert_equal "12.3456789013", render("12.34567890129")
27
26
  end
28
27
 
29
28
  def test_string
@@ -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 "transparent", resolve("rgba(0, 0, 0, 0)")
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.12346)", resolve("rgba(10.0, 1.23456789, 0.0, 0.1234567)")
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
- assert_warning(<<WARNING) {assert_equal "true", resolve("1 == 1cm")}
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
- assert_warning(<<WARNING) {assert_equal "false", resolve("1 != 1cm")}
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.3622", resolve("(1cm/1pc)")
537
- assert_equal "4.23333", resolve("(1pc/1mm)")
538
- assert_equal "2.83465", resolve("(1mm/1pt)")
539
- assert_equal "1.33333", resolve("(1pt/1px)")
540
- assert_equal "0.01042", resolve("(1px/1in)")
541
- assert_equal "1.05833", resolve("(1px/1q)")
542
- assert_equal "0.05906", resolve("(1q/1pc)")
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.11111", resolve("(1deg/1grad)")
547
- assert_equal "0.01571", resolve("(1grad/1rad)")
548
- assert_equal "0.15915", resolve("(1rad/1turn)")
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 "2.54", resolve("(1dpi/1dpcm)")
562
- assert_equal "37.79528", resolve("(1dpcm/1dppx)")
563
- assert_equal "0.01042", resolve("(1dppx/1dpi)")
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 + #00f")
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.12121", resolve("1.121214")
1179
- assert_equal "1.12122", resolve("1.121215")
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
- assert_equal "1, 2, 3", resolve_with_lazy_interp_warning('quote((1, #{2}, 3))', '"1, 2, 3"')
1310
- assert_equal "1", resolve_with_lazy_interp_warning('length((1, #{2}, 3))', '"1, 2, 3"')
1311
- assert_equal "1, 2, 3", resolve_with_lazy_interp_warning('inspect((1, #{2}, 3))', '"1, 2, 3"')
1312
- assert_equal "string", resolve_with_lazy_interp_warning('type-of((1, #{2}, 3))', '"1, 2, 3"')
1313
-
1314
- assert_equal "+1 2 3", resolve_with_lazy_interp_warning('quote((+#{1} 2 3))', '"+1 #{2 3}"')
1315
- assert_equal "/1 2 3", resolve_with_lazy_interp_warning('quote((/#{1} 2 3))', '"/1 #{2 3}"')
1316
- assert_equal "-1 2 3", resolve_with_lazy_interp_warning('quote((-#{1} 2 3))', '"-1 #{2 3}"')
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
- assert_warning(<<WARNING) do
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
- assert_equal "true", resolve("10 == 2 * 5px")
1327
- end
1328
- assert_warning(<<WARNING) do
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
- assert_equal "true", resolve("10 == 2px * 5px")
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}: \#{} interpolation near operators will be simplified
1345
- in a future version of Sass. To preserve the current behavior, use quotes:
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}: \#{} interpolation near operators will be simplified
1357
- in a future version of Sass. To preserve the current behavior, use quotes:
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
 
@@ -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)')
@@ -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'
@@ -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
- assert_warning(<<WARNING) {render(<<SCSS)}
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
- assert_warning(<<WARNING) {render(<<SCSS)}
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
- assert_warning(<<WARNING) {render(<<SCSS)}
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
- assert_warning(<<WARNING) {render(<<SCSS)}
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
- assert_warning(<<WARNING) {render(<<SCSS)}
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
- assert_warning(<<WARNING) {render(<<SCSS)}
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}: \#{} interpolation near operators will be simplified
3670
- in a future version of Sass. To preserve the current behavior, use quotes:
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.21053% 4.21053% 5.63158%; }
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