From e78fedc4646059f17c3ca5047053e594ee34f5a2 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Fri, 2 Dec 2022 18:37:15 -0800 Subject: [PATCH 1/9] [Color 4] Update tests for Color Level 4 This updates most tests for the currently-implemented chunk of the Color 4 feature. A few tests that need more thorough reworking (such as being moved out of `error/` for things that are no longer intended to be errors) are marked as "todo" instead. See #1828 See sass/sass#2831 --- .../color/adjust_color/error/args.hrx | 2 +- .../color/adjust_color/error/bounds.hrx | 11 + .../adjust_color/error/mixed_formats.hrx | 14 +- .../core_functions/color/adjust_color/hsl.hrx | 75 +++ .../core_functions/color/adjust_color/hwb.hrx | 8 +- .../color/adjust_color/units.hrx | 21 +- spec/core_functions/color/adjust_hue.hrx | 27 +- spec/core_functions/color/blackness.hrx | 10 +- .../color/change_color/error/args.hrx | 2 +- .../color/change_color/error/bounds.hrx | 11 + .../change_color/error/mixed_formats.hrx | 14 +- .../core_functions/color/change_color/hsl.hrx | 65 +++ .../core_functions/color/change_color/hwb.hrx | 4 +- .../color/change_color/units.hrx | 21 +- spec/core_functions/color/complement.hrx | 9 +- spec/core_functions/color/darken.hrx | 15 + spec/core_functions/color/desaturate.hrx | 25 + spec/core_functions/color/grayscale.hrx | 15 + .../color/hsl/error/one_arg.hrx | 32 +- .../color/hsl/three_args/units.hrx | 2 +- .../color/hsl/three_args/w3c/blue_to_red.hrx | 2 +- .../color/hsl/three_args/w3c/hue.hrx | 36 +- .../color/hwb/error/four_args.hrx | 46 +- .../color/hwb/error/one_arg.hrx | 70 ++- .../color/hwb/error/three_args.hrx | 6 +- spec/core_functions/color/hwb/four_args.hrx | 14 +- spec/core_functions/color/hwb/one_arg.hrx | 18 +- .../color/hwb/three_args/named.hrx | 3 +- .../color/hwb/three_args/units.hrx | 6 +- .../hwb/three_args/w3c/blue_magentas.hrx | 44 +- .../color/hwb/three_args/w3c/blues.hrx | 26 +- .../color/hwb/three_args/w3c/cyan_blues.hrx | 44 +- .../color/hwb/three_args/w3c/cyans.hrx | 26 +- .../color/hwb/three_args/w3c/green_cyans.hrx | 44 +- .../color/hwb/three_args/w3c/greens.hrx | 26 +- .../color/hwb/three_args/w3c/magenta_reds.hrx | 44 +- .../color/hwb/three_args/w3c/magentas.hrx | 26 +- .../color/hwb/three_args/w3c/oranges.hrx | 44 +- .../color/hwb/three_args/w3c/reds.hrx | 26 +- .../hwb/three_args/w3c/yellow_greens.hrx | 44 +- .../color/hwb/three_args/w3c/yellows.hrx | 26 +- spec/core_functions/color/invert.hrx | 9 +- spec/core_functions/color/lighten.hrx | 15 + spec/core_functions/color/mix.hrx | 8 +- .../color/rgb/error/one_arg.hrx | 32 +- .../color/rgb/four_args/clamped.hrx | 12 + .../color/rgb/one_arg/alpha.hrx | 12 + .../color/rgb/one_arg/no_alpha.hrx | 32 +- .../color/rgb/three_args/percents.hrx | 20 +- .../color/rgb/three_args/unitless.hrx | 12 + spec/core_functions/color/saturate.hrx | 10 + .../color/scale_color/error/args.hrx | 2 +- .../color/scale_color/error/mixed_formats.hrx | 15 +- spec/core_functions/color/scale_color/hsl.hrx | 45 ++ spec/core_functions/color/scale_color/hwb.hrx | 20 +- spec/core_functions/color/scale_color/rgb.hrx | 50 ++ spec/core_functions/color/whiteness.hrx | 10 +- spec/core_functions/meta/call.hrx | 2 +- spec/core_functions/meta/keywords.hrx | 2 +- spec/core_functions/modules/color.hrx | 2 +- spec/core_functions/selector/parse/error.hrx | 6 +- spec/core_functions/string/quote.hrx | 2 +- spec/libsass-closed-issues/issue_1101.hrx | 5 + spec/libsass-closed-issues/issue_1240.hrx | 6 +- spec/libsass-closed-issues/issue_1285.hrx | 20 + spec/libsass-closed-issues/issue_1768.hrx | 4 +- spec/libsass-closed-issues/issue_2374.hrx | 85 ++- spec/libsass-closed-issues/issue_238760.hrx | 2 +- spec/libsass-closed-issues/issue_2462.hrx | 5 + spec/libsass-closed-issues/issue_2472.hrx | 15 +- spec/libsass-todo-issues/issue_2818.hrx | 2 +- spec/libsass/bourbon.hrx | 4 +- .../color-functions/other/change-color/h.hrx | 542 +++++++++--------- .../color-functions/other/change-color/l.hrx | 104 ++++ .../color-functions/other/change-color/s.hrx | 105 ++++ spec/libsass/color-functions/rgb/rgb/b.hrx | 198 +++---- spec/libsass/color-functions/rgb/rgb/g.hrx | 198 +++---- spec/libsass/color-functions/rgb/rgb/r.hrx | 198 +++---- spec/libsass/color-functions/rgb/rgba/b.hrx | 198 +++---- spec/libsass/color-functions/rgb/rgba/g.hrx | 198 +++---- spec/libsass/color-functions/rgb/rgba/r.hrx | 198 +++---- spec/libsass/color-functions/saturate.hrx | 103 ++++ spec/libsass/test.hrx | 2 +- spec/non_conformant/colors/basic.hrx | 2 +- spec/non_conformant/colors/change-color.hrx | 8 + .../errors/fn-change-color-1.hrx | 4 +- spec/values/calculation/calc/error/value.hrx | 4 +- 87 files changed, 2267 insertions(+), 1265 deletions(-) diff --git a/spec/core_functions/color/adjust_color/error/args.hrx b/spec/core_functions/color/adjust_color/error/args.hrx index 62998521f1..29f111d8b2 100644 --- a/spec/core_functions/color/adjust_color/error/args.hrx +++ b/spec/core_functions/color/adjust_color/error/args.hrx @@ -44,7 +44,7 @@ Error: Only one positional argument is allowed. All other arguments must be pass a {b: adjust-color(red, $ambience: 10%)} <===> unknown/error -Error: No argument named $ambience. +Error: $ambience: Color space rgb doesn't have a channel with this name. , 1 | a {b: adjust-color(red, $ambience: 10%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/adjust_color/error/bounds.hrx b/spec/core_functions/color/adjust_color/error/bounds.hrx index 03e71f05b1..45348042dc 100644 --- a/spec/core_functions/color/adjust_color/error/bounds.hrx +++ b/spec/core_functions/color/adjust_color/error/bounds.hrx @@ -1,3 +1,14 @@ +<===> README.md +According to the new color space spec, out-of-bounds values should be allowed +(and clamped for strictly bounded spaces). See sass/sass-spec#1828. + +<===> options.yml +--- +:todo: +- dart-sass + +<===> +================================================================================ <===> red/too_low/input.scss a {b: adjust-color(red, $red: -256)} diff --git a/spec/core_functions/color/adjust_color/error/mixed_formats.hrx b/spec/core_functions/color/adjust_color/error/mixed_formats.hrx index aeff43825f..7d5e5f8443 100644 --- a/spec/core_functions/color/adjust_color/error/mixed_formats.hrx +++ b/spec/core_functions/color/adjust_color/error/mixed_formats.hrx @@ -2,7 +2,7 @@ a {b: adjust-color(red, $red: 1, $hue: 1)} <===> red_and_hue/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $hue: Color space rgb doesn't have a channel with this name. , 1 | a {b: adjust-color(red, $red: 1, $hue: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ Error: Cannot specify HSL and RGB values for a color at the same time for `adjus a {b: adjust-color(red, $green: 1, $saturation: 1%)} <===> green_and_saturation/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $saturation: Color space rgb doesn't have a channel with this name. , 1 | a {b: adjust-color(red, $green: 1, $saturation: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -44,7 +44,7 @@ Error: Cannot specify HSL and RGB values for a color at the same time for `adjus a {b: adjust-color(red, $blue: 1, $lightness: 1%)} <===> blue_and_lightness/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $lightness: Color space rgb doesn't have a channel with this name. , 1 | a {b: adjust-color(red, $blue: 1, $lightness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -70,7 +70,7 @@ Error: Cannot specify HSL and RGB values for a color at the same time for `adjus a {b: adjust-color(red, $red: 1, $blackness: 1%)} <===> red_and_blackness/error -Error: RGB parameters may not be passed along with HWB parameters. +Error: $blackness: Color space rgb doesn't have a channel with this name. , 1 | a {b: adjust-color(red, $red: 1, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -88,7 +88,7 @@ Error: RGB parameters may not be passed along with HWB parameters. a {b: adjust-color(red, $green: 1, $whiteness: 1%)} <===> green_and_whiteness/error -Error: RGB parameters may not be passed along with HWB parameters. +Error: $whiteness: Color space rgb doesn't have a channel with this name. , 1 | a {b: adjust-color(red, $green: 1, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -106,7 +106,7 @@ Error: RGB parameters may not be passed along with HWB parameters. a {b: adjust-color(red, $saturation: 1%, $blackness: 1%)} <===> saturation_and_blackness/error -Error: HSL parameters may not be passed along with HWB parameters. +Error: $blackness: Color space hsl doesn't have a channel with this name. , 1 | a {b: adjust-color(red, $saturation: 1%, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -124,7 +124,7 @@ Error: HSL parameters may not be passed along with HWB parameters. a {b: adjust-color(red, $lightness: 1%, $whiteness: 1%)} <===> lightness_and_whiteness/error -Error: HSL parameters may not be passed along with HWB parameters. +Error: $whiteness: Color space hsl doesn't have a channel with this name. , 1 | a {b: adjust-color(red, $lightness: 1%, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/adjust_color/hsl.hrx b/spec/core_functions/color/adjust_color/hsl.hrx index 0f9bb4749f..b2fdf41ad2 100644 --- a/spec/core_functions/color/adjust_color/hsl.hrx +++ b/spec/core_functions/color/adjust_color/hsl.hrx @@ -2,6 +2,11 @@ a {b: adjust-color(red, $hue: 359)} <===> hue/max/output.css +a { + b: rgb(255, 0, 4.25); +} + +<===> hue/max/output-libsass.css a { b: #ff0004; } @@ -52,6 +57,11 @@ a { a {b: adjust-color(red, $hue: 123)} <===> hue/middle/output.css +a { + b: rgb(0, 255, 12.75); +} + +<===> hue/middle/output-libsass.css a { b: #00ff0d; } @@ -62,6 +72,11 @@ a { a {b: adjust-color(red, $hue: 0.5)} <===> hue/fraction/output.css +a { + b: rgb(255, 2.125, 0); +} + +<===> hue/fraction/output-libsass.css a { b: #ff0200; } @@ -102,6 +117,11 @@ a { a {b: adjust-color(plum, $saturation: -100%)} <===> saturation/min/output.css +a { + b: rgb(190.5, 190.5, 190.5); +} + +<===> saturation/min/output-libsass.css a { b: #bfbfbf; } @@ -112,6 +132,11 @@ a { a {b: adjust-color(plum, $saturation: -48%)} <===> saturation/min_remaining/output.css +a { + b: rgb(190.5, 190.5, 190.5); +} + +<===> saturation/min_remaining/output-libsass.css a { b: #bfbfbf; } @@ -122,6 +147,11 @@ a { a {b: adjust-color(plum, $saturation: 14%)} <===> saturation/high/output.css +a { + b: rgb(230.03, 150.97, 230.03); +} + +<===> saturation/high/output-libsass.css a { b: #e697e6; } @@ -132,6 +162,11 @@ a { a {b: adjust-color(plum, $saturation: -14%)} <===> saturation/low/output.css +a { + b: rgb(211.97, 169.03, 211.97); +} + +<===> saturation/low/output-libsass.css a { b: #d4a9d4; } @@ -172,6 +207,11 @@ a { a {b: adjust-color(red, $lightness: 0.5%)} <===> lightness/fraction/output.css +a { + b: rgb(255, 2.55, 2.55); +} + +<===> lightness/fraction/output-libsass.css a { b: #ff0303; } @@ -202,6 +242,11 @@ a { a {b: adjust-color(red, $lightness: 14%)} <===> lightness/high/output.css +a { + b: rgb(255, 71.4, 71.4); +} + +<===> lightness/high/output-libsass.css a { b: #ff4747; } @@ -212,6 +257,11 @@ a { a {b: adjust-color(red, $lightness: -14%)} <===> lightness/low/output.css +a { + b: rgb(183.6, 0, 0); +} + +<===> lightness/low/output-libsass.css a { b: #b80000; } @@ -222,6 +272,11 @@ a { a {b: adjust-color(black, $hue: 12, $saturation: 24%, $lightness: 48%)} <===> all/output.css +a { + b: rgb(151.776, 104.7744, 93.024); +} + +<===> all/output-libsass.css a { b: #98695d; } @@ -232,6 +287,11 @@ a { a {b: adjust-color(rgba(black, 0.7), $hue: 12, $saturation: 24%, $lightness: 48%)} <===> alpha_input/output.css +a { + b: rgba(151.776, 104.7744, 93.024, 0.7); +} + +<===> alpha_input/output-libsass.css a { b: rgba(152, 105, 93, 0.7); } @@ -242,6 +302,11 @@ a { a {b: adjust-color(black, $hue: 12, $saturation: 24%, $lightness: 48%, $alpha: -0.7)} <===> alpha_arg/output.css +a { + b: rgba(151.776, 104.7744, 93.024, 0.3); +} + +<===> alpha_arg/output-libsass.css a { b: rgba(152, 105, 93, 0.3); } @@ -253,6 +318,11 @@ a { a {b: adjust-color(black, $hue: 12, $saturation: 24%, $lightness: 48%, $alpha: 0.7)} <===> alpha_arg_above_max/output.css +a { + b: rgb(151.776, 104.7744, 93.024); +} + +<===> alpha_arg_above_max/output-libsass.css a { b: #98695d; } @@ -263,6 +333,11 @@ a { a {b: adjust-color($color: black, $hue: 12, $saturation: 24%, $lightness: 48%)} <===> named/output.css +a { + b: rgb(151.776, 104.7744, 93.024); +} + +<===> named/output-libsass.css a { b: #98695d; } diff --git a/spec/core_functions/color/adjust_color/hwb.hrx b/spec/core_functions/color/adjust_color/hwb.hrx index 4b75bded41..2777269cba 100644 --- a/spec/core_functions/color/adjust_color/hwb.hrx +++ b/spec/core_functions/color/adjust_color/hwb.hrx @@ -10,7 +10,7 @@ a {b: adjust-color(#cc6666, $whiteness: 100%)} <===> whiteness/max/output.css a { - b: #d5d5d5; + b: rgb(212.5, 212.5, 212.5); } <===> @@ -20,7 +20,7 @@ a {b: adjust-color(#cc6666, $whiteness: 60%)} <===> whiteness/max_remaining/output.css a { - b: #d5d5d5; + b: rgb(212.5, 212.5, 212.5); } <===> @@ -80,7 +80,7 @@ a {b: adjust-color(#993333, $blackness: 100%)} <===> blackness/max/output.css a { - b: #2b2b2b; + b: rgb(42.5, 42.5, 42.5); } <===> @@ -90,7 +90,7 @@ a {b: adjust-color(#993333, $blackness: 60%)} <===> blackness/max_remaining/output.css a { - b: #2b2b2b; + b: rgb(42.5, 42.5, 42.5); } <===> diff --git a/spec/core_functions/color/adjust_color/units.hrx b/spec/core_functions/color/adjust_color/units.hrx index 987319ca38..34d343c0cc 100644 --- a/spec/core_functions/color/adjust_color/units.hrx +++ b/spec/core_functions/color/adjust_color/units.hrx @@ -57,7 +57,7 @@ a {b: adjust-color(red, $hue: 60rad)} <===> hue/angle/output.css a { - b: #00b4ff; + b: rgb(0, 179.576224164, 255); } <===> @@ -66,6 +66,11 @@ a { a {b: adjust-color(red, $saturation: -10%)} <===> saturation/percent/output.css +a { + b: rgb(242.25, 12.75, 12.75); +} + +<===> saturation/percent/output-libsass.css a { b: #f20d0d; } @@ -76,6 +81,11 @@ a { a {b: adjust-color(red, $saturation: -10)} <===> saturation/unitless/output.css +a { + b: rgb(242.25, 12.75, 12.75); +} + +<===> saturation/unitless/output-libsass.css a { b: #f20d0d; } @@ -93,12 +103,19 @@ More info: https://sass-lang.com/d/function-units ' input.scss 1:7 root stylesheet +<===> saturation/unitless/warning-libsass + <===> ================================================================================ <===> saturation/unknown/input.scss a {b: adjust-color(red, $saturation: -10in)} <===> saturation/unknown/output.css +a { + b: rgb(242.25, 12.75, 12.75); +} + +<===> saturation/unknown/output-libsass.css a { b: #f20d0d; } @@ -116,6 +133,8 @@ More info: https://sass-lang.com/d/function-units ' input.scss 1:7 root stylesheet +<===> saturation/unknown/warning-libsass + <===> ================================================================================ <===> lightness/percent/input.scss diff --git a/spec/core_functions/color/adjust_hue.hrx b/spec/core_functions/color/adjust_hue.hrx index 9e34ad835b..0259bda088 100644 --- a/spec/core_functions/color/adjust_hue.hrx +++ b/spec/core_functions/color/adjust_hue.hrx @@ -2,6 +2,11 @@ a {b: adjust-hue(red, 359)} <===> max/output.css +a { + b: rgb(255, 0, 4.25); +} + +<===> max/output-libsass.css a { b: #ff0004; } @@ -52,6 +57,11 @@ a { a {b: adjust-hue(red, 123)} <===> middle/output.css +a { + b: rgb(0, 255, 12.75); +} + +<===> middle/output-libsass.css a { b: #00ff0d; } @@ -62,6 +72,11 @@ a { a {b: adjust-hue(red, 0.5)} <===> fraction/output.css +a { + b: rgb(255, 2.125, 0); +} + +<===> fraction/output-libsass.css a { b: #ff0200; } @@ -72,6 +87,11 @@ a { a {b: adjust-hue(rgba(red, 0.1), 359)} <===> alpha/output.css +a { + b: rgba(255, 0, 4.25, 0.1); +} + +<===> alpha/output-libsass.css a { b: rgba(255, 0, 4, 0.1); } @@ -137,7 +157,7 @@ a {b: adjust-hue(red, 60rad)} <===> units/angle/output.css a { - b: #00b4ff; + b: rgb(0, 179.576224164, 255); } <===> @@ -146,6 +166,11 @@ a { a {b: adjust-hue($color: red, $degrees: 123)} <===> named/output.css +a { + b: rgb(0, 255, 12.75); +} + +<===> named/output-libsass.css a { b: #00ff0d; } diff --git a/spec/core_functions/color/blackness.hrx b/spec/core_functions/color/blackness.hrx index 468d9d2691..cfb0fe2c48 100644 --- a/spec/core_functions/color/blackness.hrx +++ b/spec/core_functions/color/blackness.hrx @@ -33,7 +33,7 @@ a {b: color.blackness(color.hwb(0, 0%, 50%))} <===> middle/zero_whiteness/output.css a { - b: 49.8039215686%; + b: 50%; } <===> @@ -44,7 +44,7 @@ a {b: color.blackness(color.hwb(0, 50%, 50%))} <===> middle/half_whiteness/output.css a { - b: 49.8039215686%; + b: 50%; } <===> @@ -55,7 +55,7 @@ a {b: color.blackness(color.hwb(0, 70%, 70%))} <===> middle/high_whiteness/output.css a { - b: 49.8039215686%; + b: 50%; } <===> @@ -66,7 +66,7 @@ a {b: color.blackness(color.hwb(0, 0%, 0.5%))} <===> fraction/output.css a { - b: 0.3921568627%; + b: 0.5%; } <===> @@ -77,7 +77,7 @@ a {b: color.blackness($color: color.hwb(0, 0%, 42%))} <===> named/output.css a { - b: 41.9607843137%; + b: 42%; } <===> diff --git a/spec/core_functions/color/change_color/error/args.hrx b/spec/core_functions/color/change_color/error/args.hrx index 03fced9034..5344849483 100644 --- a/spec/core_functions/color/change_color/error/args.hrx +++ b/spec/core_functions/color/change_color/error/args.hrx @@ -44,7 +44,7 @@ Error: Only one positional argument is allowed. All other arguments must be pass a {b: change-color(red, $ambience: 10%)} <===> unknown/error -Error: No argument named $ambience. +Error: $ambience: Color space rgb doesn't have a channel with this name. , 1 | a {b: change-color(red, $ambience: 10%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/change_color/error/bounds.hrx b/spec/core_functions/color/change_color/error/bounds.hrx index ae90fcc5d0..1436662ada 100644 --- a/spec/core_functions/color/change_color/error/bounds.hrx +++ b/spec/core_functions/color/change_color/error/bounds.hrx @@ -1,3 +1,14 @@ +<===> README.md +According to the new color space spec, out-of-bounds values should be allowed +(and clamped for strictly bounded spaces). See sass/sass-spec#1828. + +<===> options.yml +--- +:todo: +- dart-sass + +<===> +================================================================================ <===> red/too_low/input.scss a {b: change-color(red, $red: -1)} diff --git a/spec/core_functions/color/change_color/error/mixed_formats.hrx b/spec/core_functions/color/change_color/error/mixed_formats.hrx index e4a874343b..2b7744929e 100644 --- a/spec/core_functions/color/change_color/error/mixed_formats.hrx +++ b/spec/core_functions/color/change_color/error/mixed_formats.hrx @@ -2,7 +2,7 @@ a {b: change-color(red, $red: 1, $hue: 1)} <===> red_and_hue/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $hue: Color space rgb doesn't have a channel with this name. , 1 | a {b: change-color(red, $red: 1, $hue: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ Error: Cannot specify HSL and RGB values for a color at the same time for `chang a {b: change-color(red, $green: 1, $saturation: 1%)} <===> green_and_saturation/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $saturation: Color space rgb doesn't have a channel with this name. , 1 | a {b: change-color(red, $green: 1, $saturation: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -44,7 +44,7 @@ Error: Cannot specify HSL and RGB values for a color at the same time for `chang a {b: change-color(red, $blue: 1, $lightness: 1%)} <===> blue_and_lightness/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $lightness: Color space rgb doesn't have a channel with this name. , 1 | a {b: change-color(red, $blue: 1, $lightness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -70,7 +70,7 @@ Error: Cannot specify HSL and RGB values for a color at the same time for `chang a {b: adjust-color(red, $red: 1, $blackness: 1%)} <===> red_and_blackness/error -Error: RGB parameters may not be passed along with HWB parameters. +Error: $blackness: Color space rgb doesn't have a channel with this name. , 1 | a {b: adjust-color(red, $red: 1, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -88,7 +88,7 @@ Error: RGB parameters may not be passed along with HWB parameters. a {b: change-color(red, $green: 1, $whiteness: 1%)} <===> green_and_whiteness/error -Error: RGB parameters may not be passed along with HWB parameters. +Error: $whiteness: Color space rgb doesn't have a channel with this name. , 1 | a {b: change-color(red, $green: 1, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -106,7 +106,7 @@ Error: RGB parameters may not be passed along with HWB parameters. a {b: change-color(red, $saturation: 1%, $blackness: 1%)} <===> saturation_and_blackness/error -Error: HSL parameters may not be passed along with HWB parameters. +Error: $blackness: Color space hsl doesn't have a channel with this name. , 1 | a {b: change-color(red, $saturation: 1%, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -124,7 +124,7 @@ Error: HSL parameters may not be passed along with HWB parameters. a {b: change-color(red, $lightness: 1%, $whiteness: 1%)} <===> lightness_and_whiteness/error -Error: HSL parameters may not be passed along with HWB parameters. +Error: $whiteness: Color space hsl doesn't have a channel with this name. , 1 | a {b: change-color(red, $lightness: 1%, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/change_color/hsl.hrx b/spec/core_functions/color/change_color/hsl.hrx index 30d597c4ff..bace6cb6c4 100644 --- a/spec/core_functions/color/change_color/hsl.hrx +++ b/spec/core_functions/color/change_color/hsl.hrx @@ -2,6 +2,11 @@ a {b: change-color(red, $hue: 359)} <===> hue/max/output.css +a { + b: rgb(255, 0, 4.25); +} + +<===> hue/max/output-libsass.css a { b: #ff0004; } @@ -52,6 +57,11 @@ a { a {b: change-color(red, $hue: 123)} <===> hue/middle/output.css +a { + b: rgb(0, 255, 12.75); +} + +<===> hue/middle/output-libsass.css a { b: #00ff0d; } @@ -62,6 +72,11 @@ a { a {b: change-color(red, $hue: 0.5)} <===> hue/fraction/output.css +a { + b: rgb(255, 2.125, 0); +} + +<===> hue/fraction/output-libsass.css a { b: #ff0200; } @@ -82,6 +97,11 @@ a { a {b: change-color(plum, $saturation: 0%)} <===> saturation/min/output.css +a { + b: rgb(190.5, 190.5, 190.5); +} + +<===> saturation/min/output-libsass.css a { b: #bfbfbf; } @@ -92,6 +112,11 @@ a { a {b: change-color(plum, $saturation: 76%)} <===> saturation/high/output.css +a { + b: rgb(239.52, 141.48, 239.52); +} + +<===> saturation/high/output-libsass.css a { b: #f08df0; } @@ -102,6 +127,11 @@ a { a {b: change-color(plum, $saturation: 14%)} <===> saturation/low/output.css +a { + b: rgb(199.53, 181.47, 199.53); +} + +<===> saturation/low/output-libsass.css a { b: #c8b5c8; } @@ -122,6 +152,11 @@ a { a {b: change-color(red, $lightness: 0.5%)} <===> lightness/fraction/output.css +a { + b: rgb(2.55, 0, 0); +} + +<===> lightness/fraction/output-libsass.css a { b: #030000; } @@ -142,6 +177,11 @@ a { a {b: change-color(red, $lightness: 63%)} <===> lightness/high/output.css +a { + b: rgb(255, 66.3, 66.3); +} + +<===> lightness/high/output-libsass.css a { b: #ff4242; } @@ -152,6 +192,11 @@ a { a {b: change-color(red, $lightness: 27%)} <===> lightness/low/output.css +a { + b: rgb(137.7, 0, 0); +} + +<===> lightness/low/output-libsass.css a { b: #8a0000; } @@ -162,6 +207,11 @@ a { a {b: change-color(black, $hue: 12, $saturation: 24%, $lightness: 48%)} <===> all/output.css +a { + b: rgb(151.776, 104.7744, 93.024); +} + +<===> all/output-libsass.css a { b: #98695d; } @@ -172,6 +222,11 @@ a { a {b: change-color(rgba(black, 0.7), $hue: 12, $saturation: 24%, $lightness: 48%)} <===> alpha_input/output.css +a { + b: rgba(151.776, 104.7744, 93.024, 0.7); +} + +<===> alpha_input/output-libsass.css a { b: rgba(152, 105, 93, 0.7); } @@ -182,6 +237,11 @@ a { a {b: change-color(black, $hue: 12, $saturation: 24%, $lightness: 48%, $alpha: 0.7)} <===> alpha_arg/output.css +a { + b: rgba(151.776, 104.7744, 93.024, 0.7); +} + +<===> alpha_arg/output-libsass.css a { b: rgba(152, 105, 93, 0.7); } @@ -192,6 +252,11 @@ a { a {b: change-color($color: black, $hue: 12, $saturation: 24%, $lightness: 48%)} <===> named/output.css +a { + b: rgb(151.776, 104.7744, 93.024); +} + +<===> named/output-libsass.css a { b: #98695d; } diff --git a/spec/core_functions/color/change_color/hwb.hrx b/spec/core_functions/color/change_color/hwb.hrx index b0573580a2..7c51983a2d 100644 --- a/spec/core_functions/color/change_color/hwb.hrx +++ b/spec/core_functions/color/change_color/hwb.hrx @@ -10,7 +10,7 @@ a {b: change-color(#cc6666, $whiteness: 100%)} <===> whiteness/max/output.css a { - b: #d5d5d5; + b: rgb(212.5, 212.5, 212.5); } <===> @@ -50,7 +50,7 @@ a {b: change-color(#993333, $blackness: 100%)} <===> blackness/max/output.css a { - b: #2b2b2b; + b: rgb(42.5, 42.5, 42.5); } <===> diff --git a/spec/core_functions/color/change_color/units.hrx b/spec/core_functions/color/change_color/units.hrx index e1abb73bf7..ef5844f94e 100644 --- a/spec/core_functions/color/change_color/units.hrx +++ b/spec/core_functions/color/change_color/units.hrx @@ -57,7 +57,7 @@ a {b: change-color(red, $hue: 60rad)} <===> hue/angle/output.css a { - b: #00b4ff; + b: rgb(0, 179.576224164, 255); } <===> @@ -66,6 +66,11 @@ a { a {b: change-color(red, $saturation: 50%)} <===> saturation/percent/output.css +a { + b: rgb(191.25, 63.75, 63.75); +} + +<===> saturation/percent/output-libsass.css a { b: #bf4040; } @@ -76,6 +81,11 @@ a { a {b: change-color(red, $saturation: 50)} <===> saturation/unitless/output.css +a { + b: rgb(191.25, 63.75, 63.75); +} + +<===> saturation/unitless/output-libsass.css a { b: #bf4040; } @@ -93,12 +103,19 @@ More info: https://sass-lang.com/d/function-units ' input.scss 1:7 root stylesheet +<===> saturation/unitless/warning-libsass + <===> ================================================================================ <===> saturation/unknown/input.scss a {b: change-color(red, $saturation: 50in)} <===> saturation/unknown/output.css +a { + b: rgb(191.25, 63.75, 63.75); +} + +<===> saturation/unknown/output-libsass.css a { b: #bf4040; } @@ -116,6 +133,8 @@ More info: https://sass-lang.com/d/function-units ' input.scss 1:7 root stylesheet +<===> saturation/unknown/warning-libsass + <===> ================================================================================ <===> lightness/percent/input.scss diff --git a/spec/core_functions/color/complement.hrx b/spec/core_functions/color/complement.hrx index 64aa7f8a9b..c64f1d8de0 100644 --- a/spec/core_functions/color/complement.hrx +++ b/spec/core_functions/color/complement.hrx @@ -88,8 +88,8 @@ Error: Missing argument $color. | ^^^^^^^^^^^^ invocation ' ,--> sass:color -1 | @function complement($color) { - | ================== declaration +1 | @function complement($color, $space: null) { + | ================================ declaration ' input.scss 1:7 root stylesheet @@ -102,6 +102,11 @@ Error: Function complement is missing argument $color. <===> ================================================================================ +<===> error/too_many_args/options.yml +--- +:todo: +- dart-sass + <===> error/too_many_args/input.scss a {b: complement(red, 1)} diff --git a/spec/core_functions/color/darken.hrx b/spec/core_functions/color/darken.hrx index ab75a0353f..ee73cb7a93 100644 --- a/spec/core_functions/color/darken.hrx +++ b/spec/core_functions/color/darken.hrx @@ -32,6 +32,11 @@ a { a {b: darken(red, 14%)} <===> middle/output.css +a { + b: rgb(183.6, 0, 0); +} + +<===> middle/output-libsass.css a { b: #b80000; } @@ -42,6 +47,11 @@ a { a {b: darken(red, 0.5%)} <===> fraction/output.css +a { + b: rgb(252.45, 0, 0); +} + +<===> fraction/output-libsass.css a { b: #fc0000; } @@ -62,6 +72,11 @@ a { a {b: darken($color: red, $amount: 14%)} <===> named/output.css +a { + b: rgb(183.6, 0, 0); +} + +<===> named/output-libsass.css a { b: #b80000; } diff --git a/spec/core_functions/color/desaturate.hrx b/spec/core_functions/color/desaturate.hrx index 16edfdb5fb..f9adddf67f 100644 --- a/spec/core_functions/color/desaturate.hrx +++ b/spec/core_functions/color/desaturate.hrx @@ -2,6 +2,11 @@ a {b: desaturate(plum, 100%)} <===> max/output.css +a { + b: rgb(190.5, 190.5, 190.5); +} + +<===> max/output-libsass.css a { b: #bfbfbf; } @@ -12,6 +17,11 @@ a { a {b: desaturate(plum, 48%)} <===> max_remaining/output.css +a { + b: rgb(190.5, 190.5, 190.5); +} + +<===> max_remaining/output-libsass.css a { b: #bfbfbf; } @@ -32,6 +42,11 @@ a { a {b: desaturate(plum, 14%)} <===> middle/output.css +a { + b: rgb(211.97, 169.03, 211.97); +} + +<===> middle/output-libsass.css a { b: #d4a9d4; } @@ -42,6 +57,11 @@ a { a {b: desaturate(rgba(plum, 0.3), 100%)} <===> alpha/output.css +a { + b: rgba(190.5, 190.5, 190.5, 0.3); +} + +<===> alpha/output-libsass.css a { b: rgba(191, 191, 191, 0.3); } @@ -52,6 +72,11 @@ a { a {b: desaturate($color: plum, $amount: 14%)} <===> named/output.css +a { + b: rgb(211.97, 169.03, 211.97); +} + +<===> named/output-libsass.css a { b: #d4a9d4; } diff --git a/spec/core_functions/color/grayscale.hrx b/spec/core_functions/color/grayscale.hrx index b1243b71a1..79d7bcc331 100644 --- a/spec/core_functions/color/grayscale.hrx +++ b/spec/core_functions/color/grayscale.hrx @@ -32,6 +32,11 @@ a { a {b: grayscale(red)} <===> max_saturation/output.css +a { + b: rgb(127.5, 127.5, 127.5); +} + +<===> max_saturation/output-libsass.css a { b: gray; } @@ -42,6 +47,11 @@ a { a {b: grayscale(#633736)} <===> mid_saturation/output.css +a { + b: rgb(76.5, 76.5, 76.5); +} + +<===> mid_saturation/output-libsass.css a { b: #4d4d4d; } @@ -52,6 +62,11 @@ a { a {b: grayscale(rgba(#633736, 0.3))} <===> alpha/output.css +a { + b: rgba(76.5, 76.5, 76.5, 0.3); +} + +<===> alpha/output-libsass.css a { b: rgba(77, 77, 77, 0.3); } diff --git a/spec/core_functions/color/hsl/error/one_arg.hrx b/spec/core_functions/color/hsl/error/one_arg.hrx index f73d8084ea..f34eb43259 100644 --- a/spec/core_functions/color/hsl/error/one_arg.hrx +++ b/spec/core_functions/color/hsl/error/one_arg.hrx @@ -11,7 +11,7 @@ a { } <===> list/empty/error -Error: Missing element $hue. +Error: $channels: Color component list may not be empty. , 2 | b: hsl(()); | ^^^^^^^ @@ -26,7 +26,7 @@ a { } <===> list/comma_separated/error -Error: $channels must be a space-separated list. +Error: $channels: Expected a space- or slash-separated list, was (0, 100%, 50%) , 2 | b: hsl((0, 100%, 50%)); | ^^^^^^^^^^^^^^^^^^^ @@ -41,7 +41,7 @@ a { } <===> list/bracketed/error -Error: $channels must be an unbracketed list. +Error: $channels: Expected an unbracketed list, was [0 100% 50%] , 2 | b: hsl([0 100% 50%]); | ^^^^^^^^^^^^^^^^^ @@ -56,7 +56,7 @@ a { } <===> list/one_element/error -Error: Missing element $saturation. +Error: $channels: The hsl color space has 3 channels but 0 has 1. , 2 | b: hsl(0); | ^^^^^^ @@ -71,7 +71,7 @@ a { } <===> list/two_elements/error -Error: Missing element $lightness. +Error: $channels: The hsl color space has 3 channels but (0 100%) has 2. , 2 | b: hsl(0 100%); | ^^^^^^^^^^^ @@ -86,7 +86,7 @@ a { } <===> list/four_elements/error -Error: Only 3 elements allowed, but 4 were passed. +Error: $channels: The hsl color space has 3 channels but (0 100% 50% 0.4) has 4. , 2 | b: hsl(0 100% 50% 0.4); | ^^^^^^^^^^^^^^^^^^^ @@ -101,7 +101,7 @@ a { } <===> type/hue/error -Error: $hue: "foo" is not a number. +Error: $channels: Expected hue "foo" to be a number. , 2 | b: hsl("foo" 100% 50%); | ^^^^^^^^^^^^^^^^^^^ @@ -116,7 +116,7 @@ a { } <===> type/saturation/error -Error: $saturation: "foo" is not a number. +Error: $channels: Expected saturation "foo" to be a number. , 2 | b: hsl(0 "foo" 50%); | ^^^^^^^^^^^^^^^^ @@ -131,7 +131,7 @@ a { } <===> type/lightness/error -Error: $lightness: "foo" is not a number. +Error: $channels: Expected lightness "foo" to be a number. , 2 | b: hsl(0 100% "foo"); | ^^^^^^^^^^^^^^^^^ @@ -146,7 +146,7 @@ a { } <===> quoted_var_slash/error -Error: $lightness: "var(--foo) / 0.4" is not a number. +Error: $channels: Expected lightness "var(--foo) / 0.4" to be a number. , 2 | b: hsl(0 100% "var(--foo) / 0.4"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -187,7 +187,7 @@ Error: Only 2 slash-separated elements allowed, but 3 were passed. a {b: hsl(list.slash((), 1))} <===> slash_list/channels/empty/error -Error: Missing element $hue. +Error: $channels: Color component list may not be empty. , 2 | a {b: hsl(list.slash((), 1))} | ^^^^^^^^^^^^^^^^^^^^^^ @@ -201,7 +201,7 @@ Error: Missing element $hue. a {b: hsl(list.slash((0, 100%, 50%), 1))} <===> slash_list/channels/comma_separated/error -Error: $channels must be a space-separated list. +Error: $channels: Expected a space-separated list, was (0, 100%, 50%) , 2 | a {b: hsl(list.slash((0, 100%, 50%), 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -215,7 +215,7 @@ Error: $channels must be a space-separated list. a {b: hsl(list.slash([0 100% 50%], 1))} <===> slash_list/channels/bracketed/error -Error: $channels must be an unbracketed list. +Error: $channels: Expected an unbracketed list, was [0 100% 50%] , 2 | a {b: hsl(list.slash([0 100% 50%], 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -229,7 +229,7 @@ Error: $channels must be an unbracketed list. a {b: hsl(list.slash(0, 1))} <===> slash_list/channels/one_element/error -Error: Missing element $saturation. +Error: $channels: The hsl color space has 3 channels but (0 / 1) has 1. , 2 | a {b: hsl(list.slash(0, 1))} | ^^^^^^^^^^^^^^^^^^^^^ @@ -243,7 +243,7 @@ Error: Missing element $saturation. a {b: hsl(list.slash(0 100%, 1))} <===> slash_list/channels/two_elements/error -Error: Missing element $lightness. +Error: $channels: The hsl color space has 3 channels but (0 100% / 1) has 2. , 2 | a {b: hsl(list.slash(0 100%, 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -257,7 +257,7 @@ Error: Missing element $lightness. a {b: hsl(list.slash(0 100% 50% 0.4, 1))} <===> slash_list/channels/four_elements/error -Error: Only 3 elements allowed, but 4 were passed. +Error: $channels: The hsl color space has 3 channels but (0 100% 50% 0.4 / 1) has 4. , 2 | a {b: hsl(list.slash(0 100% 50% 0.4, 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/hsl/three_args/units.hrx b/spec/core_functions/color/hsl/three_args/units.hrx index 0e5cbf22b0..0ce6017e58 100644 --- a/spec/core_functions/color/hsl/three_args/units.hrx +++ b/spec/core_functions/color/hsl/three_args/units.hrx @@ -70,7 +70,7 @@ a {b: hsl(60rad, 100%, 50%)} <===> hue/angle/output.css a { - b: hsl(197.7467707849deg, 100%, 50%); + b: hsl(3437.7467707849deg, 100%, 50%); } <===> hue/angle/output-libsass.css diff --git a/spec/core_functions/color/hsl/three_args/w3c/blue_to_red.hrx b/spec/core_functions/color/hsl/three_args/w3c/blue_to_red.hrx index 42d72741e6..39018a3f07 100644 --- a/spec/core_functions/color/hsl/three_args/w3c/blue_to_red.hrx +++ b/spec/core_functions/color/hsl/three_args/w3c/blue_to_red.hrx @@ -25,7 +25,7 @@ a { step-8: hsl(324deg, 100%, 50%); step-9: hsl(336deg, 100%, 50%); step-10: hsl(348deg, 100%, 50%); - step-11: hsl(0deg, 100%, 50%); + step-11: hsl(360deg, 100%, 50%); } <===> output-libsass.css diff --git a/spec/core_functions/color/hsl/three_args/w3c/hue.hrx b/spec/core_functions/color/hsl/three_args/w3c/hue.hrx index 7340195e62..0133d16d1e 100644 --- a/spec/core_functions/color/hsl/three_args/w3c/hue.hrx +++ b/spec/core_functions/color/hsl/three_args/w3c/hue.hrx @@ -17,44 +17,44 @@ <===> output.css red { hue-0: hsl(0deg, 100%, 50%); - hue--360: hsl(0deg, 100%, 50%); - hue-360: hsl(0deg, 100%, 50%); - hue-6120: hsl(0deg, 100%, 50%); + hue--360: hsl(-360deg, 100%, 50%); + hue-360: hsl(360deg, 100%, 50%); + hue-6120: hsl(6120deg, 100%, 50%); } yellow { hue-60: hsl(60deg, 100%, 50%); - hue--300: hsl(60deg, 100%, 50%); - hue-420: hsl(60deg, 100%, 50%); - hue--9660: hsl(60deg, 100%, 50%); + hue--300: hsl(-300deg, 100%, 50%); + hue-420: hsl(420deg, 100%, 50%); + hue--9660: hsl(-9660deg, 100%, 50%); } green { hue-120: hsl(120deg, 100%, 50%); - hue--240: hsl(120deg, 100%, 50%); - hue-480: hsl(120deg, 100%, 50%); - hue-99840: hsl(120deg, 100%, 50%); + hue--240: hsl(-240deg, 100%, 50%); + hue-480: hsl(480deg, 100%, 50%); + hue-99840: hsl(99840deg, 100%, 50%); } cyan { hue-180: hsl(180deg, 100%, 50%); - hue--180: hsl(180deg, 100%, 50%); - hue-540: hsl(180deg, 100%, 50%); - hue--900: hsl(180deg, 100%, 50%); + hue--180: hsl(-180deg, 100%, 50%); + hue-540: hsl(540deg, 100%, 50%); + hue--900: hsl(-900deg, 100%, 50%); } blue { hue-240: hsl(240deg, 100%, 50%); - hue--120: hsl(240deg, 100%, 50%); - hue-600: hsl(240deg, 100%, 50%); - hue--104880: hsl(240deg, 100%, 50%); + hue--120: hsl(-120deg, 100%, 50%); + hue-600: hsl(600deg, 100%, 50%); + hue--104880: hsl(-104880deg, 100%, 50%); } purple { hue-300: hsl(300deg, 100%, 50%); - hue--60: hsl(300deg, 100%, 50%); - hue-660: hsl(300deg, 100%, 50%); - hue-2820: hsl(300deg, 100%, 50%); + hue--60: hsl(-60deg, 100%, 50%); + hue-660: hsl(660deg, 100%, 50%); + hue-2820: hsl(2820deg, 100%, 50%); } <===> output-libsass.css diff --git a/spec/core_functions/color/hwb/error/four_args.hrx b/spec/core_functions/color/hwb/error/four_args.hrx index 1e0ec96897..b202806b4f 100644 --- a/spec/core_functions/color/hwb/error/four_args.hrx +++ b/spec/core_functions/color/hwb/error/four_args.hrx @@ -3,7 +3,7 @@ a {b: color.hwb("foo", 30%, 40%, 0.5)} <===> hue/type/error -Error: $hue: "foo" is not a number. +Error: Expected hue "foo" to be a number. , 2 | a {b: color.hwb("foo", 30%, 40%, 0.5)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -12,6 +12,11 @@ Error: $hue: "foo" is not a number. <===> ================================================================================ +<===> hue/var/options.yml +--- +:todo: +- dart-sass + <===> hue/var/input.scss @use 'sass:color'; a {b: color.hwb(var(--c), 30%, 40%, 0.5)} @@ -31,7 +36,7 @@ Error: $hue: var(--c) is not a number. a {b: color.hwb(0, "foo", 40%, 0.5)} <===> whiteness/type/error -Error: $whiteness: "foo" is not a number. +Error: Expected whiteness "foo" to be a number. , 2 | a {b: color.hwb(0, "foo", 40%, 0.5)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -68,6 +73,11 @@ Error: $whiteness: Expected 30px to have unit "%". <===> ================================================================================ +<===> whiteness/too_high/options.yml +--- +:todo: +- dart-sass + <===> whiteness/too_high/input.scss @use 'sass:color'; a {b: color.hwb(0, 101%, 40%, 0.5)} @@ -82,6 +92,11 @@ Error: $whiteness: Expected 101% to be within 0% and 100%. <===> ================================================================================ +<===> whiteness/too_low/options.yml +--- +:todo: +- dart-sass + <===> whiteness/too_low/input.scss @use 'sass:color'; a {b: color.hwb(0, -1%, 40%, 0.5)} @@ -96,6 +111,11 @@ Error: $whiteness: Expected -1% to be within 0% and 100%. <===> ================================================================================ +<===> whiteness/var/options.yml +--- +:todo: +- dart-sass + <===> whiteness/var/input.scss @use 'sass:color'; a {b: color.hwb(0, var(--c), 40%, 0.5)} @@ -115,7 +135,7 @@ Error: $whiteness: var(--c) is not a number. a {b: color.hwb(0, 30%, "foo", 0.5)} <===> blackness/type/error -Error: $blackness: "foo" is not a number. +Error: Expected blackness "foo" to be a number. , 2 | a {b: color.hwb(0, 30%, "foo", 0.5)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -152,6 +172,11 @@ Error: $blackness: Expected 40px to have unit "%". <===> ================================================================================ +<===> blackness/too_high/options.yml +--- +:todo: +- dart-sass + <===> blackness/too_high/input.scss @use 'sass:color'; a {b: color.hwb(0, 30%, 101%, 0.5)} @@ -166,6 +191,11 @@ Error: $blackness: Expected 101% to be within 0% and 100%. <===> ================================================================================ +<===> blackness/too_low/options.yml +--- +:todo: +- dart-sass + <===> blackness/too_low/input.scss @use 'sass:color'; a {b: color.hwb(0, 30%, -1%, 0.5)} @@ -180,6 +210,11 @@ Error: $blackness: Expected -1% to be within 0% and 100%. <===> ================================================================================ +<===> blackness/var/options.yml +--- +:todo: +- dart-sass + <===> blackness/var/input.scss @use 'sass:color'; a {b: color.hwb(0, 30%, var(--c), 0.5)} @@ -208,6 +243,11 @@ Error: $alpha: Expected 0.5px to have no units or "%". <===> ================================================================================ +<===> alpha/var/options.yml +--- +:todo: +- dart-sass + <===> alpha/var/input.scss @use 'sass:color'; a {b: color.hwb(0, 0%, 0%, var(--c))} diff --git a/spec/core_functions/color/hwb/error/one_arg.hrx b/spec/core_functions/color/hwb/error/one_arg.hrx index 003348e8c6..2affeadd29 100644 --- a/spec/core_functions/color/hwb/error/one_arg.hrx +++ b/spec/core_functions/color/hwb/error/one_arg.hrx @@ -3,7 +3,7 @@ a {b: color.hwb(())} <===> list/empty/error -Error: Missing element $hue. +Error: $channels: Color component list may not be empty. , 2 | a {b: color.hwb(())} | ^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ Error: Missing element $hue. a {b: color.hwb((0, 30%, 40%))} <===> list/comma_separated/error -Error: $channels must be a space-separated list. +Error: $channels: Expected a space- or slash-separated list, was (0, 30%, 40%) , 2 | a {b: color.hwb((0, 30%, 40%))} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -31,7 +31,7 @@ Error: $channels must be a space-separated list. a {b: color.hwb([0 30% 40%])} <===> list/bracketed/error -Error: $channels must be an unbracketed list. +Error: $channels: Expected an unbracketed list, was [0 30% 40%] , 2 | a {b: color.hwb([0 30% 40%])} | ^^^^^^^^^^^^^^^^^^^^^^ @@ -45,7 +45,7 @@ Error: $channels must be an unbracketed list. a {b: color.hwb(0)} <===> list/one_element/error -Error: Missing element $whiteness. +Error: $channels: The hwb color space has 3 channels but 0 has 1. , 2 | a {b: color.hwb(0)} | ^^^^^^^^^^^^ @@ -59,7 +59,7 @@ Error: Missing element $whiteness. a {b: color.hwb(0 30%)} <===> list/two_elements/error -Error: Missing element $blackness. +Error: $channels: The hwb color space has 3 channels but (0 30%) has 2. , 2 | a {b: color.hwb(0 30%)} | ^^^^^^^^^^^^^^^^ @@ -73,7 +73,7 @@ Error: Missing element $blackness. a {b: color.hwb(0 30% 40% 0.4)} <===> list/four_elements/error -Error: Only 3 elements allowed, but 4 were passed. +Error: $channels: The hwb color space has 3 channels but (0 30% 40% 0.4) has 4. , 2 | a {b: color.hwb(0 30% 40% 0.4)} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -87,7 +87,7 @@ Error: Only 3 elements allowed, but 4 were passed. a {b: color.hwb("foo" 30% 40%)} <===> hue/type/error -Error: $hue: "foo" is not a number. +Error: $channels: Expected hue "foo" to be a number. , 2 | a {b: color.hwb("foo" 30% 40%)} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -96,6 +96,11 @@ Error: $hue: "foo" is not a number. <===> ================================================================================ +<===> hue/var/options.yml +--- +:todo: +- dart-sass + <===> hue/var/input.scss @use 'sass:color'; a {b: color.hwb(var(--c) 30% 40%)} @@ -115,7 +120,7 @@ Error: $hue: var(--c) is not a number. a {b: color.hwb(0 "foo" 40%)} <===> whiteness/type/error -Error: $whiteness: "foo" is not a number. +Error: $channels: Expected whiteness "foo" to be a number. , 2 | a {b: color.hwb(0 "foo" 40%)} | ^^^^^^^^^^^^^^^^^^^^^^ @@ -152,6 +157,11 @@ Error: $whiteness: Expected 30px to have unit "%". <===> ================================================================================ +<===> whiteness/too_high/options.yml +--- +:todo: +- dart-sass + <===> whiteness/too_high/input.scss @use 'sass:color'; a {b: color.hwb(0 101% 40%)} @@ -166,6 +176,11 @@ Error: $whiteness: Expected 101% to be within 0% and 100%. <===> ================================================================================ +<===> whiteness/too_low/options.yml +--- +:todo: +- dart-sass + <===> whiteness/too_low/input.scss @use 'sass:color'; a {b: color.hwb(0 -1% 40%)} @@ -180,6 +195,11 @@ Error: $whiteness: Expected -1% to be within 0% and 100%. <===> ================================================================================ +<===> whiteness/var/options.yml +--- +:todo: +- dart-sass + <===> whiteness/var/input.scss @use 'sass:color'; a {b: color.hwb(0 var(--c) 40%)} @@ -199,7 +219,7 @@ Error: $whiteness: var(--c) is not a number. a {b: color.hwb(0 30% "foo")} <===> blackness/type/error -Error: $blackness: "foo" is not a number. +Error: $channels: Expected blackness "foo" to be a number. , 2 | a {b: color.hwb(0 30% "foo")} | ^^^^^^^^^^^^^^^^^^^^^^ @@ -236,6 +256,11 @@ Error: $blackness: Expected 40px to have unit "%". <===> ================================================================================ +<===> blackness/too_high/options.yml +--- +:todo: +- dart-sass + <===> blackness/too_high/input.scss @use 'sass:color'; a {b: color.hwb(0 30% 101%)} @@ -250,6 +275,11 @@ Error: $blackness: Expected 101% to be within 0% and 100%. <===> ================================================================================ +<===> blackness/too_low/options.yml +--- +:todo: +- dart-sass + <===> blackness/too_low/input.scss @use 'sass:color'; a {b: color.hwb(0 30% -1%)} @@ -262,6 +292,13 @@ Error: $blackness: Expected -1% to be within 0% and 100%. ' input.scss 2:7 root stylesheet +<===> +================================================================================ +<===> blackness/var/options.yml +--- +:todo: +- dart-sass + <===> ================================================================================ <===> blackness/var/no_alpha/input.scss @@ -294,18 +331,23 @@ Error: Expected numeric channels, got "hwb(0 30% var(--c)/0.5px)". ================================================================================ <===> alpha/unit/input.scss @use 'sass:color'; -a {b: color.hwb(0 0 0 / 0.5px)} +a {b: color.hwb(0 0% 0% / 0.5px)} <===> alpha/unit/error -Error: $whiteness: Expected 0 to have unit "%". +Error: $alpha: Expected 0.5px to have no units or "%". , -2 | a {b: color.hwb(0 0 0 / 0.5px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: color.hwb(0 0% 0% / 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet <===> ================================================================================ +<===> alpha/var/options.yml +--- +:todo: +- dart-sass + <===> alpha/var/input.scss @use 'sass:color'; a {b: color.hwb(0 0 0 / var(--c))} @@ -325,7 +367,7 @@ Error: Expected numeric channels, got "hwb(0 0 0/var(--c))". a {b: color.hwb(0 30% "var(--foo) / 0.4")} <===> quoted_var_slash/error -Error: $blackness: "var(--foo) / 0.4" is not a number. +Error: $channels: Expected blackness "var(--foo) / 0.4" to be a number. , 2 | a {b: color.hwb(0 30% "var(--foo) / 0.4")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/hwb/error/three_args.hrx b/spec/core_functions/color/hwb/error/three_args.hrx index 4550021c60..558f605fa9 100644 --- a/spec/core_functions/color/hwb/error/three_args.hrx +++ b/spec/core_functions/color/hwb/error/three_args.hrx @@ -3,7 +3,7 @@ a {b: color.hwb("foo", 100%, 50%)} <===> hue/type/error -Error: $hue: "foo" is not a number. +Error: Expected hue "foo" to be a number. , 2 | a {b: color.hwb("foo", 100%, 50%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -25,7 +25,7 @@ Error: argument `$hue` of `hwb($hue, $whiteness, $blackness)` must be a number a {b: color.hwb(0, "foo", 50%)} <===> whiteness/type/error -Error: $whiteness: "foo" is not a number. +Error: Expected whiteness "foo" to be a number. , 2 | a {b: color.hwb(0, "foo", 50%)} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -47,7 +47,7 @@ Error: argument `$whiteness` of `hwb($hue, $whiteness, $blackness)` must be a nu a {b: color.hwb(0, 100%, "foo")} <===> blackness/type/error -Error: $blackness: "foo" is not a number. +Error: Expected blackness "foo" to be a number. , 2 | a {b: color.hwb(0, 100%, "foo")} | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/hwb/four_args.hrx b/spec/core_functions/color/hwb/four_args.hrx index 562bacabab..10ac54f206 100644 --- a/spec/core_functions/color/hwb/four_args.hrx +++ b/spec/core_functions/color/hwb/four_args.hrx @@ -4,7 +4,7 @@ a {b: color.hwb(0, 0%, 0%, -10%)} <===> alpha/percent/negative/output.css a { - b: rgba(255, 0, 0, 0); + b: hsla(0deg, 100%, 50%, 0); } <===> @@ -15,7 +15,7 @@ a {b: color.hwb(0, 0%, 0%, 0%)} <===> alpha/percent/min/output.css a { - b: rgba(255, 0, 0, 0); + b: hsla(0deg, 100%, 50%, 0); } <===> @@ -26,7 +26,7 @@ a {b: color.hwb(0, 0%, 0%, 45.6%)} <===> alpha/percent/positive/output.css a { - b: rgba(255, 0, 0, 0.456); + b: hsla(0deg, 100%, 50%, 0.456); } <===> @@ -59,7 +59,7 @@ a {b: color.hwb(0, 0%, 0%, -10)} <===> alpha/unitless/negative/output.css a { - b: rgba(255, 0, 0, 0); + b: hsla(0deg, 100%, 50%, 0); } <===> @@ -70,7 +70,7 @@ a {b: color.hwb(0, 0%, 0%, 0)} <===> alpha/unitless/min/output.css a { - b: rgba(255, 0, 0, 0); + b: hsla(0deg, 100%, 50%, 0); } <===> @@ -81,7 +81,7 @@ a {b: color.hwb(0, 0%, 0%, 0.456)} <===> alpha/unitless/positive/output.css a { - b: rgba(255, 0, 0, 0.456); + b: hsla(0deg, 100%, 50%, 0.456); } <===> @@ -114,5 +114,5 @@ a {b: color.hwb($hue: 180, $whiteness: 30%, $blackness: 40%, $alpha: 0.4)} <===> named/output.css a { - b: rgba(77, 153, 153, 0.4); + b: hsla(180deg, 33.3333333333%, 45%, 0.4); } diff --git a/spec/core_functions/color/hwb/one_arg.hrx b/spec/core_functions/color/hwb/one_arg.hrx index 85d4d19265..180e4b6e5e 100644 --- a/spec/core_functions/color/hwb/one_arg.hrx +++ b/spec/core_functions/color/hwb/one_arg.hrx @@ -4,7 +4,7 @@ a {b: color.hwb(180 30% 40% / 0)} <===> alpha/in_gamut/transparent/output.css a { - b: rgba(77, 153, 153, 0); + b: hsla(180deg, 33.3333333333%, 45%, 0); } <===> @@ -15,7 +15,7 @@ a {b: color.hwb(180 30% 40% / 1)} <===> alpha/in_gamut/opaque/output.css a { - b: #4d9999; + b: hsl(180deg, 33.3333333333%, 45%); } <===> @@ -26,7 +26,7 @@ a {b: color.hwb(180 30% 40% / 0.5)} <===> alpha/in_gamut/partial/output.css a { - b: rgba(77, 153, 153, 0.5); + b: hsla(180deg, 33.3333333333%, 45%, 0.5); } <===> @@ -37,7 +37,7 @@ a {b: color.hwb($channels: 180 30% 40% / 0.4)} <===> alpha/in_gamut/named/output.css a { - b: rgba(77, 153, 153, 0.4); + b: hsla(180deg, 33.3333333333%, 45%, 0.4); } <===> @@ -50,7 +50,7 @@ a {b: (color.hwb(180 30% 40% / 0.4))} <===> alpha/in_gamut/parenthesized/output.css a { - b: rgba(77, 153, 153, 0.4); + b: hsla(180deg, 33.3333333333%, 45%, 0.4); } <===> @@ -61,7 +61,7 @@ a {b: color.hwb(0 30% 40% / 1.1)} <===> alpha/clamped/above/output.css a { - b: #994d4d; + b: hsl(0deg, 33.3333333333%, 45%); } <===> @@ -72,7 +72,7 @@ a {b: color.hwb(0 30% 40% / -0.1)} <===> alpha/clamped/below/output.css a { - b: rgba(153, 77, 77, 0); + b: hsla(0deg, 33.3333333333%, 45%, 0); } <===> @@ -83,7 +83,7 @@ a {b: color.hwb(180 30% 40%)} <===> no_alpha/output.css a { - b: #4d9999; + b: hsl(180deg, 33.3333333333%, 45%); } <===> @@ -94,5 +94,5 @@ a {b: color.hwb($channels: 180 30% 40% / 0.4)} <===> named/output.css a { - b: rgba(77, 153, 153, 0.4); + b: hsla(180deg, 33.3333333333%, 45%, 0.4); } diff --git a/spec/core_functions/color/hwb/three_args/named.hrx b/spec/core_functions/color/hwb/three_args/named.hrx index 90680131ba..2f8eca8a7c 100644 --- a/spec/core_functions/color/hwb/three_args/named.hrx +++ b/spec/core_functions/color/hwb/three_args/named.hrx @@ -4,6 +4,5 @@ a {b: color.hwb($hue: 0, $whiteness: 30%, $blackness: 40%)} <===> output.css a { - b: #994d4d; + b: hsl(0deg, 33.3333333333%, 45%); } - diff --git a/spec/core_functions/color/hwb/three_args/units.hrx b/spec/core_functions/color/hwb/three_args/units.hrx index 2c422d22fb..26ff6f60db 100644 --- a/spec/core_functions/color/hwb/three_args/units.hrx +++ b/spec/core_functions/color/hwb/three_args/units.hrx @@ -4,7 +4,7 @@ a {b: color.hwb(0deg, 30%, 40%)} <===> hue/deg/output.css a { - b: #994d4d; + b: hsl(0deg, 33.3333333333%, 45%); } <===> @@ -15,7 +15,7 @@ a {b: color.hwb(1rad, 30%, 40%)} <===> hue/rad/output.css a { - b: #99964d; + b: hsl(57.2957795131deg, 33.3333333333%, 45%); } <===> @@ -26,7 +26,7 @@ a {b: color.hwb(1in, 30%, 40%)} <===> hue/non_angle/output.css a { - b: #994e4d; + b: hsl(1deg, 33.3333333333%, 45%); } <===> hue/non_angle/warning diff --git a/spec/core_functions/color/hwb/three_args/w3c/blue_magentas.hrx b/spec/core_functions/color/hwb/three_args/w3c/blue_magentas.hrx index 5eeac1e6e0..1de1809a9f 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/blue_magentas.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/blue_magentas.hrx @@ -4,55 +4,55 @@ <===> output.css whiteness-0 { - blackness-0: #8000ff; + blackness-0: hsl(270deg, 100%, 50%); blackness-20: #6600cc; - blackness-40: #4d0099; + blackness-40: hsl(270deg, 100%, 30%); blackness-60: #330066; - blackness-80: #1a0033; + blackness-80: hsl(270deg, 100%, 10%); blackness-100: black; } whiteness-20 { blackness-0: #9933ff; - blackness-20: #8033cc; + blackness-20: hsl(270deg, 60%, 50%); blackness-40: rebeccapurple; - blackness-60: #4d3366; + blackness-60: hsl(270deg, 33.3333333333%, 30%); blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0deg, 0%, 16.6666666667%); } whiteness-40 { - blackness-0: #b366ff; + blackness-0: hsl(270deg, 100%, 70%); blackness-20: #9966cc; - blackness-40: #806699; + blackness-40: hsl(270deg, 20%, 50%); blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0deg, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #cc99ff; - blackness-20: #b399cc; + blackness-20: hsl(270deg, 33.3333333333%, 70%); blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0deg, 0%, 50%); + blackness-80: hsl(0deg, 0%, 42.8571428571%); + blackness-100: hsl(0deg, 0%, 37.5%); } whiteness-80 { - blackness-0: #e6ccff; + blackness-0: hsl(270deg, 100%, 90%); blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0deg, 0%, 57.1428571429%); + blackness-80: hsl(0deg, 0%, 50%); + blackness-100: hsl(0deg, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0deg, 0%, 83.3333333333%); + blackness-40: hsl(0deg, 0%, 71.4285714286%); + blackness-60: hsl(0deg, 0%, 62.5%); + blackness-80: hsl(0deg, 0%, 55.5555555556%); + blackness-100: hsl(0deg, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/blues.hrx b/spec/core_functions/color/hwb/three_args/w3c/blues.hrx index 135c9b2e59..138c196a77 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/blues.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/blues.hrx @@ -18,7 +18,7 @@ whiteness-20 { blackness-40: #333399; blackness-60: #333366; blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0deg, 0%, 16.6666666667%); } whiteness-40 { @@ -27,32 +27,32 @@ whiteness-40 { blackness-40: #666699; blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0deg, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #9999ff; blackness-20: #9999cc; blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0deg, 0%, 50%); + blackness-80: hsl(0deg, 0%, 42.8571428571%); + blackness-100: hsl(0deg, 0%, 37.5%); } whiteness-80 { blackness-0: #ccccff; blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0deg, 0%, 57.1428571429%); + blackness-80: hsl(0deg, 0%, 50%); + blackness-100: hsl(0deg, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0deg, 0%, 83.3333333333%); + blackness-40: hsl(0deg, 0%, 71.4285714286%); + blackness-60: hsl(0deg, 0%, 62.5%); + blackness-80: hsl(0deg, 0%, 55.5555555556%); + blackness-100: hsl(0deg, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/cyan_blues.hrx b/spec/core_functions/color/hwb/three_args/w3c/cyan_blues.hrx index 11146aa6c9..e37cc4016c 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/cyan_blues.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/cyan_blues.hrx @@ -4,55 +4,55 @@ <===> output.css whiteness-0 { - blackness-0: #0080ff; + blackness-0: hsl(210deg, 100%, 50%); blackness-20: #0066cc; - blackness-40: #004d99; + blackness-40: hsl(210deg, 100%, 30%); blackness-60: #003366; - blackness-80: #001a33; + blackness-80: hsl(210deg, 100%, 10%); blackness-100: black; } whiteness-20 { blackness-0: #3399ff; - blackness-20: #3380cc; + blackness-20: hsl(210deg, 60%, 50%); blackness-40: #336699; - blackness-60: #334d66; + blackness-60: hsl(210deg, 33.3333333333%, 30%); blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0deg, 0%, 16.6666666667%); } whiteness-40 { - blackness-0: #66b3ff; + blackness-0: hsl(210deg, 100%, 70%); blackness-20: #6699cc; - blackness-40: #668099; + blackness-40: hsl(210deg, 20%, 50%); blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0deg, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #99ccff; - blackness-20: #99b3cc; + blackness-20: hsl(210deg, 33.3333333333%, 70%); blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0deg, 0%, 50%); + blackness-80: hsl(0deg, 0%, 42.8571428571%); + blackness-100: hsl(0deg, 0%, 37.5%); } whiteness-80 { - blackness-0: #cce6ff; + blackness-0: hsl(210deg, 100%, 90%); blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0deg, 0%, 57.1428571429%); + blackness-80: hsl(0deg, 0%, 50%); + blackness-100: hsl(0deg, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0deg, 0%, 83.3333333333%); + blackness-40: hsl(0deg, 0%, 71.4285714286%); + blackness-60: hsl(0deg, 0%, 62.5%); + blackness-80: hsl(0deg, 0%, 55.5555555556%); + blackness-100: hsl(0deg, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/cyans.hrx b/spec/core_functions/color/hwb/three_args/w3c/cyans.hrx index 21d546362d..c98a63e6c6 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/cyans.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/cyans.hrx @@ -18,7 +18,7 @@ whiteness-20 { blackness-40: #339999; blackness-60: #336666; blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0deg, 0%, 16.6666666667%); } whiteness-40 { @@ -27,32 +27,32 @@ whiteness-40 { blackness-40: #669999; blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0deg, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #99ffff; blackness-20: #99cccc; blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0deg, 0%, 50%); + blackness-80: hsl(0deg, 0%, 42.8571428571%); + blackness-100: hsl(0deg, 0%, 37.5%); } whiteness-80 { blackness-0: #ccffff; blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0deg, 0%, 57.1428571429%); + blackness-80: hsl(0deg, 0%, 50%); + blackness-100: hsl(0deg, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0deg, 0%, 83.3333333333%); + blackness-40: hsl(0deg, 0%, 71.4285714286%); + blackness-60: hsl(0deg, 0%, 62.5%); + blackness-80: hsl(0deg, 0%, 55.5555555556%); + blackness-100: hsl(0deg, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/green_cyans.hrx b/spec/core_functions/color/hwb/three_args/w3c/green_cyans.hrx index 13ed6d59c0..f9ba8875ec 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/green_cyans.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/green_cyans.hrx @@ -4,55 +4,55 @@ <===> output.css whiteness-0 { - blackness-0: #00ff80; + blackness-0: hsl(150deg, 100%, 50%); blackness-20: #00cc66; - blackness-40: #00994d; + blackness-40: hsl(150deg, 100%, 30%); blackness-60: #006633; - blackness-80: #00331a; + blackness-80: hsl(150deg, 100%, 10%); blackness-100: black; } whiteness-20 { blackness-0: #33ff99; - blackness-20: #33cc80; + blackness-20: hsl(150deg, 60%, 50%); blackness-40: #339966; - blackness-60: #33664d; + blackness-60: hsl(150deg, 33.3333333333%, 30%); blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0deg, 0%, 16.6666666667%); } whiteness-40 { - blackness-0: #66ffb3; + blackness-0: hsl(150deg, 100%, 70%); blackness-20: #66cc99; - blackness-40: #669980; + blackness-40: hsl(150deg, 20%, 50%); blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0deg, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #99ffcc; - blackness-20: #99ccb3; + blackness-20: hsl(150deg, 33.3333333333%, 70%); blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0deg, 0%, 50%); + blackness-80: hsl(0deg, 0%, 42.8571428571%); + blackness-100: hsl(0deg, 0%, 37.5%); } whiteness-80 { - blackness-0: #ccffe6; + blackness-0: hsl(150deg, 100%, 90%); blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0deg, 0%, 57.1428571429%); + blackness-80: hsl(0deg, 0%, 50%); + blackness-100: hsl(0deg, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0deg, 0%, 83.3333333333%); + blackness-40: hsl(0deg, 0%, 71.4285714286%); + blackness-60: hsl(0deg, 0%, 62.5%); + blackness-80: hsl(0deg, 0%, 55.5555555556%); + blackness-100: hsl(0deg, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/greens.hrx b/spec/core_functions/color/hwb/three_args/w3c/greens.hrx index eda752e084..eaa5bd93f2 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/greens.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/greens.hrx @@ -18,7 +18,7 @@ whiteness-20 { blackness-40: #339933; blackness-60: #336633; blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0deg, 0%, 16.6666666667%); } whiteness-40 { @@ -27,32 +27,32 @@ whiteness-40 { blackness-40: #669966; blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0deg, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #99ff99; blackness-20: #99cc99; blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0deg, 0%, 50%); + blackness-80: hsl(0deg, 0%, 42.8571428571%); + blackness-100: hsl(0deg, 0%, 37.5%); } whiteness-80 { blackness-0: #ccffcc; blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0deg, 0%, 57.1428571429%); + blackness-80: hsl(0deg, 0%, 50%); + blackness-100: hsl(0deg, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0deg, 0%, 83.3333333333%); + blackness-40: hsl(0deg, 0%, 71.4285714286%); + blackness-60: hsl(0deg, 0%, 62.5%); + blackness-80: hsl(0deg, 0%, 55.5555555556%); + blackness-100: hsl(0deg, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/magenta_reds.hrx b/spec/core_functions/color/hwb/three_args/w3c/magenta_reds.hrx index 41d254bd5e..0ec6ed2327 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/magenta_reds.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/magenta_reds.hrx @@ -4,55 +4,55 @@ <===> output.css whiteness-0 { - blackness-0: #ff0080; + blackness-0: hsl(330deg, 100%, 50%); blackness-20: #cc0066; - blackness-40: #99004d; + blackness-40: hsl(330deg, 100%, 30%); blackness-60: #660033; - blackness-80: #33001a; + blackness-80: hsl(330deg, 100%, 10%); blackness-100: black; } whiteness-20 { blackness-0: #ff3399; - blackness-20: #cc3380; + blackness-20: hsl(330deg, 60%, 50%); blackness-40: #993366; - blackness-60: #66334d; + blackness-60: hsl(330deg, 33.3333333333%, 30%); blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0deg, 0%, 16.6666666667%); } whiteness-40 { - blackness-0: #ff66b3; + blackness-0: hsl(330deg, 100%, 70%); blackness-20: #cc6699; - blackness-40: #996680; + blackness-40: hsl(330deg, 20%, 50%); blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0deg, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #ff99cc; - blackness-20: #cc99b3; + blackness-20: hsl(330deg, 33.3333333333%, 70%); blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0deg, 0%, 50%); + blackness-80: hsl(0deg, 0%, 42.8571428571%); + blackness-100: hsl(0deg, 0%, 37.5%); } whiteness-80 { - blackness-0: #ffcce6; + blackness-0: hsl(330deg, 100%, 90%); blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0deg, 0%, 57.1428571429%); + blackness-80: hsl(0deg, 0%, 50%); + blackness-100: hsl(0deg, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0deg, 0%, 83.3333333333%); + blackness-40: hsl(0deg, 0%, 71.4285714286%); + blackness-60: hsl(0deg, 0%, 62.5%); + blackness-80: hsl(0deg, 0%, 55.5555555556%); + blackness-100: hsl(0deg, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/magentas.hrx b/spec/core_functions/color/hwb/three_args/w3c/magentas.hrx index 4d288342cf..ff59010e3a 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/magentas.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/magentas.hrx @@ -18,7 +18,7 @@ whiteness-20 { blackness-40: #993399; blackness-60: #663366; blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0deg, 0%, 16.6666666667%); } whiteness-40 { @@ -27,32 +27,32 @@ whiteness-40 { blackness-40: #996699; blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0deg, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #ff99ff; blackness-20: #cc99cc; blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0deg, 0%, 50%); + blackness-80: hsl(0deg, 0%, 42.8571428571%); + blackness-100: hsl(0deg, 0%, 37.5%); } whiteness-80 { blackness-0: #ffccff; blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0deg, 0%, 57.1428571429%); + blackness-80: hsl(0deg, 0%, 50%); + blackness-100: hsl(0deg, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0deg, 0%, 83.3333333333%); + blackness-40: hsl(0deg, 0%, 71.4285714286%); + blackness-60: hsl(0deg, 0%, 62.5%); + blackness-80: hsl(0deg, 0%, 55.5555555556%); + blackness-100: hsl(0deg, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/oranges.hrx b/spec/core_functions/color/hwb/three_args/w3c/oranges.hrx index 8075f9a5ab..2653728396 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/oranges.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/oranges.hrx @@ -4,55 +4,55 @@ <===> output.css whiteness-0 { - blackness-0: #ff8000; + blackness-0: hsl(30deg, 100%, 50%); blackness-20: #cc6600; - blackness-40: #994d00; + blackness-40: hsl(30deg, 100%, 30%); blackness-60: #663300; - blackness-80: #331a00; + blackness-80: hsl(30deg, 100%, 10%); blackness-100: black; } whiteness-20 { blackness-0: #ff9933; - blackness-20: #cc8033; + blackness-20: hsl(30deg, 60%, 50%); blackness-40: #996633; - blackness-60: #664d33; + blackness-60: hsl(30deg, 33.3333333333%, 30%); blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0deg, 0%, 16.6666666667%); } whiteness-40 { - blackness-0: #ffb366; + blackness-0: hsl(30deg, 100%, 70%); blackness-20: #cc9966; - blackness-40: #998066; + blackness-40: hsl(30deg, 20%, 50%); blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0deg, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #ffcc99; - blackness-20: #ccb399; + blackness-20: hsl(30deg, 33.3333333333%, 70%); blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0deg, 0%, 50%); + blackness-80: hsl(0deg, 0%, 42.8571428571%); + blackness-100: hsl(0deg, 0%, 37.5%); } whiteness-80 { - blackness-0: #ffe6cc; + blackness-0: hsl(30deg, 100%, 90%); blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0deg, 0%, 57.1428571429%); + blackness-80: hsl(0deg, 0%, 50%); + blackness-100: hsl(0deg, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0deg, 0%, 83.3333333333%); + blackness-40: hsl(0deg, 0%, 71.4285714286%); + blackness-60: hsl(0deg, 0%, 62.5%); + blackness-80: hsl(0deg, 0%, 55.5555555556%); + blackness-100: hsl(0deg, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/reds.hrx b/spec/core_functions/color/hwb/three_args/w3c/reds.hrx index 846cbd3240..20bd6a78bc 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/reds.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/reds.hrx @@ -18,7 +18,7 @@ whiteness-20 { blackness-40: #993333; blackness-60: #663333; blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0deg, 0%, 16.6666666667%); } whiteness-40 { @@ -27,32 +27,32 @@ whiteness-40 { blackness-40: #996666; blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0deg, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #ff9999; blackness-20: #cc9999; blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0deg, 0%, 50%); + blackness-80: hsl(0deg, 0%, 42.8571428571%); + blackness-100: hsl(0deg, 0%, 37.5%); } whiteness-80 { blackness-0: #ffcccc; blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0deg, 0%, 57.1428571429%); + blackness-80: hsl(0deg, 0%, 50%); + blackness-100: hsl(0deg, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0deg, 0%, 83.3333333333%); + blackness-40: hsl(0deg, 0%, 71.4285714286%); + blackness-60: hsl(0deg, 0%, 62.5%); + blackness-80: hsl(0deg, 0%, 55.5555555556%); + blackness-100: hsl(0deg, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/yellow_greens.hrx b/spec/core_functions/color/hwb/three_args/w3c/yellow_greens.hrx index 24ff268a9e..0e478a1356 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/yellow_greens.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/yellow_greens.hrx @@ -4,55 +4,55 @@ <===> output.css whiteness-0 { - blackness-0: #80ff00; + blackness-0: hsl(90deg, 100%, 50%); blackness-20: #66cc00; - blackness-40: #4d9900; + blackness-40: hsl(90deg, 100%, 30%); blackness-60: #336600; - blackness-80: #1a3300; + blackness-80: hsl(90deg, 100%, 10%); blackness-100: black; } whiteness-20 { blackness-0: #99ff33; - blackness-20: #80cc33; + blackness-20: hsl(90deg, 60%, 50%); blackness-40: #669933; - blackness-60: #4d6633; + blackness-60: hsl(90deg, 33.3333333333%, 30%); blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0deg, 0%, 16.6666666667%); } whiteness-40 { - blackness-0: #b3ff66; + blackness-0: hsl(90deg, 100%, 70%); blackness-20: #99cc66; - blackness-40: #809966; + blackness-40: hsl(90deg, 20%, 50%); blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0deg, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #ccff99; - blackness-20: #b3cc99; + blackness-20: hsl(90deg, 33.3333333333%, 70%); blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0deg, 0%, 50%); + blackness-80: hsl(0deg, 0%, 42.8571428571%); + blackness-100: hsl(0deg, 0%, 37.5%); } whiteness-80 { - blackness-0: #e6ffcc; + blackness-0: hsl(90deg, 100%, 90%); blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0deg, 0%, 57.1428571429%); + blackness-80: hsl(0deg, 0%, 50%); + blackness-100: hsl(0deg, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0deg, 0%, 83.3333333333%); + blackness-40: hsl(0deg, 0%, 71.4285714286%); + blackness-60: hsl(0deg, 0%, 62.5%); + blackness-80: hsl(0deg, 0%, 55.5555555556%); + blackness-100: hsl(0deg, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/yellows.hrx b/spec/core_functions/color/hwb/three_args/w3c/yellows.hrx index 76322fe532..ebdbed7039 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/yellows.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/yellows.hrx @@ -18,7 +18,7 @@ whiteness-20 { blackness-40: #999933; blackness-60: #666633; blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0deg, 0%, 16.6666666667%); } whiteness-40 { @@ -27,32 +27,32 @@ whiteness-40 { blackness-40: #999966; blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0deg, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #ffff99; blackness-20: #cccc99; blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0deg, 0%, 50%); + blackness-80: hsl(0deg, 0%, 42.8571428571%); + blackness-100: hsl(0deg, 0%, 37.5%); } whiteness-80 { blackness-0: #ffffcc; blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0deg, 0%, 57.1428571429%); + blackness-80: hsl(0deg, 0%, 50%); + blackness-100: hsl(0deg, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0deg, 0%, 83.3333333333%); + blackness-40: hsl(0deg, 0%, 71.4285714286%); + blackness-60: hsl(0deg, 0%, 62.5%); + blackness-80: hsl(0deg, 0%, 55.5555555556%); + blackness-100: hsl(0deg, 0%, 50%); } diff --git a/spec/core_functions/color/invert.hrx b/spec/core_functions/color/invert.hrx index fb0d8976a6..0f85750e29 100644 --- a/spec/core_functions/color/invert.hrx +++ b/spec/core_functions/color/invert.hrx @@ -182,8 +182,8 @@ Error: Missing argument $color. | ^^^^^^^^ invocation ' ,--> sass:color -1 | @function invert($color, $weight: 100%) { - | ============================= declaration +1 | @function invert($color, $weight: 100%, $space: null) { + | =========================================== declaration ' input.scss 1:7 root stylesheet @@ -196,6 +196,11 @@ Error: Function invert is missing argument $color. <===> ================================================================================ +<===> error/too_many_args/options.yml +--- +:todo: +- dart-sass + <===> error/too_many_args/input.scss a {b: invert(turquoise, 0%, 1)} diff --git a/spec/core_functions/color/lighten.hrx b/spec/core_functions/color/lighten.hrx index c628ee432b..3bbd9a97da 100644 --- a/spec/core_functions/color/lighten.hrx +++ b/spec/core_functions/color/lighten.hrx @@ -32,6 +32,11 @@ a { a {b: lighten(red, 14%)} <===> middle/output.css +a { + b: rgb(255, 71.4, 71.4); +} + +<===> middle/output-libsass.css a { b: #ff4747; } @@ -42,6 +47,11 @@ a { a {b: lighten(red, 0.5%)} <===> fraction/output.css +a { + b: rgb(255, 2.55, 2.55); +} + +<===> fraction/output-libsass.css a { b: #ff0303; } @@ -62,6 +72,11 @@ a { a {b: lighten($color: red, $amount: 14%)} <===> named/output.css +a { + b: rgb(255, 71.4, 71.4); +} + +<===> named/output-libsass.css a { b: #ff4747; } diff --git a/spec/core_functions/color/mix.hrx b/spec/core_functions/color/mix.hrx index 2f6d21c09d..cb1e74bed9 100644 --- a/spec/core_functions/color/mix.hrx +++ b/spec/core_functions/color/mix.hrx @@ -268,6 +268,10 @@ More info: https://sass-lang.com/d/function-units <===> ================================================================================ +<===> error/too_many_args/options.yml +:todo: + - dart-sass + <===> error/too_many_args/input.scss a {b: mix(red, blue, 100, 1)} @@ -302,8 +306,8 @@ Error: Missing argument $color2. | ^^^^^^^^ invocation ' ,--> sass:color -1 | @function mix($color1, $color2, $weight: 50%) { - | =================================== declaration +1 | @function mix($color1, $color2, $weight: 50%, $method: null) { + | ================================================== declaration ' input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/rgb/error/one_arg.hrx b/spec/core_functions/color/rgb/error/one_arg.hrx index 28225d6b9c..dde5bfa30c 100644 --- a/spec/core_functions/color/rgb/error/one_arg.hrx +++ b/spec/core_functions/color/rgb/error/one_arg.hrx @@ -11,7 +11,7 @@ a { } <===> list/empty/error -Error: Missing element $red. +Error: $channels: Color component list may not be empty. , 2 | b: rgb(()); | ^^^^^^^ @@ -26,7 +26,7 @@ a { } <===> list/one_element/error -Error: Missing element $green. +Error: $channels: The rgb color space has 3 channels but 1 has 1. , 2 | b: rgb(1); | ^^^^^^ @@ -41,7 +41,7 @@ a { } <===> list/two_elements/error -Error: Missing element $blue. +Error: $channels: The rgb color space has 3 channels but (1 2) has 2. , 2 | b: rgb(1 2); | ^^^^^^^^ @@ -56,7 +56,7 @@ a { } <===> list/four_elements/error -Error: Only 3 elements allowed, but 4 were passed. +Error: $channels: The rgb color space has 3 channels but (1 2 3 0.4) has 4. , 2 | b: rgb(1 2 3 0.4); | ^^^^^^^^^^^^^^ @@ -71,7 +71,7 @@ a { } <===> list/comma_separated/error -Error: $channels must be a space-separated list. +Error: $channels: Expected a space- or slash-separated list, was (1, 2, 3) , 2 | b: rgb((1, 2, 3)); | ^^^^^^^^^^^^^^ @@ -86,7 +86,7 @@ a { } <===> list/bracketed/error -Error: $channels must be an unbracketed list. +Error: $channels: Expected an unbracketed list, was [1 2 3] , 2 | b: rgb([1 2 3]); | ^^^^^^^^^^^^ @@ -101,7 +101,7 @@ a { } <===> type/red/error -Error: $red: "foo" is not a number. +Error: $channels: Expected red "foo" to be a number. , 2 | b: rgb("foo" 2 3); | ^^^^^^^^^^^^^^ @@ -116,7 +116,7 @@ a { } <===> type/green/error -Error: $green: "foo" is not a number. +Error: $channels: Expected green "foo" to be a number. , 2 | b: rgb(1 "foo" 3); | ^^^^^^^^^^^^^^ @@ -131,7 +131,7 @@ a { } <===> type/blue/error -Error: $blue: "foo" is not a number. +Error: $channels: Expected blue "foo" to be a number. , 2 | b: rgb(1 2 "foo"); | ^^^^^^^^^^^^^^ @@ -146,7 +146,7 @@ a { } <===> quoted_var_slash/error -Error: $blue: "var(--foo) / 0.4" is not a number. +Error: $channels: Expected blue "var(--foo) / 0.4" to be a number. , 2 | b: rgb(1 2 "var(--foo) / 0.4"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -187,7 +187,7 @@ Error: Only 2 slash-separated elements allowed, but 3 were passed. a {b: rgb(list.slash((), 1))} <===> slash_list/channels/empty/error -Error: Missing element $red. +Error: $channels: Color component list may not be empty. , 2 | a {b: rgb(list.slash((), 1))} | ^^^^^^^^^^^^^^^^^^^^^^ @@ -201,7 +201,7 @@ Error: Missing element $red. a {b: rgb(list.slash((1, 2, 3), 1))} <===> slash_list/channels/comma_separated/error -Error: $channels must be a space-separated list. +Error: $channels: Expected a space-separated list, was (1, 2, 3) , 2 | a {b: rgb(list.slash((1, 2, 3), 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -215,7 +215,7 @@ Error: $channels must be a space-separated list. a {b: rgb(list.slash([1 2 3], 1))} <===> slash_list/channels/bracketed/error -Error: $channels must be an unbracketed list. +Error: $channels: Expected an unbracketed list, was [1 2 3] , 2 | a {b: rgb(list.slash([1 2 3], 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -229,7 +229,7 @@ Error: $channels must be an unbracketed list. a {b: rgb(list.slash(1, 1))} <===> slash_list/channels/one_element/error -Error: Missing element $green. +Error: $channels: The rgb color space has 3 channels but (1 / 1) has 1. , 2 | a {b: rgb(list.slash(1, 1))} | ^^^^^^^^^^^^^^^^^^^^^ @@ -243,7 +243,7 @@ Error: Missing element $green. a {b: rgb(list.slash(1 2, 1))} <===> slash_list/channels/two_elements/error -Error: Missing element $blue. +Error: $channels: The rgb color space has 3 channels but (1 2 / 1) has 2. , 2 | a {b: rgb(list.slash(1 2, 1))} | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -257,7 +257,7 @@ Error: Missing element $blue. a {b: rgb(list.slash(1 2 3 0.4, 1))} <===> slash_list/channels/four_elements/error -Error: Only 3 elements allowed, but 4 were passed. +Error: $channels: The rgb color space has 3 channels but (1 2 3 0.4 / 1) has 4. , 2 | a {b: rgb(list.slash(1 2 3 0.4, 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/rgb/four_args/clamped.hrx b/spec/core_functions/color/rgb/four_args/clamped.hrx index ea4e6788df..ca9c6caf7a 100644 --- a/spec/core_functions/color/rgb/four_args/clamped.hrx +++ b/spec/core_functions/color/rgb/four_args/clamped.hrx @@ -3,6 +3,10 @@ Channels that are out of bounds are clamped within bounds. <===> ================================================================================ +<===> red/options.yml +:todo: + - dart-sass + <===> red/input.scss a {b: rgb(256, 0, 0, 0.5)} @@ -13,6 +17,10 @@ a { <===> ================================================================================ +<===> green/options.yml +:todo: + - dart-sass + <===> green/input.scss a {b: rgb(0, -1, 0, 0.5)} @@ -23,6 +31,10 @@ a { <===> ================================================================================ +<===> blue/options.yml +:todo: + - dart-sass + <===> blue/input.scss a {b: rgb(0, 0, 9999, 0.5)} diff --git a/spec/core_functions/color/rgb/one_arg/alpha.hrx b/spec/core_functions/color/rgb/one_arg/alpha.hrx index 4de884a8cd..c9b346d325 100644 --- a/spec/core_functions/color/rgb/one_arg/alpha.hrx +++ b/spec/core_functions/color/rgb/one_arg/alpha.hrx @@ -64,6 +64,10 @@ Channels that are out of bounds are clamped within bounds. <===> ================================================================================ +<===> clamped/red/options.yml +:todo: + - dart-sass + <===> clamped/red/input.scss a {b: rgb(256 0 0 / 0.5)} @@ -74,6 +78,10 @@ a { <===> ================================================================================ +<===> clamped/green/options.yml +:todo: + - dart-sass + <===> clamped/green/input.scss a {b: rgb(0 -1 0 / 0.5)} @@ -84,6 +92,10 @@ a { <===> ================================================================================ +<===> clamped/blue/options.yml +:todo: + - dart-sass + <===> clamped/blue/input.scss a {b: rgb(0 0 9999 / 0.5)} diff --git a/spec/core_functions/color/rgb/one_arg/no_alpha.hrx b/spec/core_functions/color/rgb/one_arg/no_alpha.hrx index 6d1dc4b243..efcd185a4e 100644 --- a/spec/core_functions/color/rgb/one_arg/no_alpha.hrx +++ b/spec/core_functions/color/rgb/one_arg/no_alpha.hrx @@ -48,6 +48,10 @@ Channels that are out of bounds are clamped within bounds. <===> ================================================================================ +<===> unitless/clamped/red/options.yml +:todo: + - dart-sass + <===> unitless/clamped/red/input.scss a {b: rgb(256 0 0)} @@ -58,6 +62,10 @@ a { <===> ================================================================================ +<===> unitless/clamped/green/options.yml +:todo: + - dart-sass + <===> unitless/clamped/green/input.scss a {b: rgb(0 -1 0)} @@ -68,6 +76,10 @@ a { <===> ================================================================================ +<===> unitless/clamped/blue/options.yml +:todo: + - dart-sass + <===> unitless/clamped/blue/input.scss a {b: rgb(0 0 9999)} @@ -89,7 +101,7 @@ a {b: rgb(7.1% 20.4% 33.9%)} <===> percents/all/percent/output.css a { - b: rgb(18, 52, 86); + b: rgb(18.105, 52.02, 86.445); } <===> @@ -99,7 +111,7 @@ a {b: rgb(74.7% 173 93%)} <===> percents/unitless/green/output.css a { - b: rgb(190, 173, 237); + b: rgb(190.485, 173, 237.15); } <===> @@ -109,7 +121,7 @@ a {b: rgb(190 68% 237)} <===> percents/percent/green/output.css a { - b: rgb(190, 173, 237); + b: rgb(190, 173.4, 237); } <===> @@ -119,7 +131,7 @@ a {b: rgb(0% 100% 50%)} <===> percents/boundaries/output.css a { - b: rgb(0, 255, 128); + b: rgb(0, 255, 127.5); } <===> @@ -129,6 +141,10 @@ Channels that are out of bounds are clamped within bounds. <===> ================================================================================ +<===> percents/clamped/red/options.yml +:todo: + - dart-sass + <===> percents/clamped/red/input.scss a {b: rgb(100.1% 0 0)} @@ -139,6 +155,10 @@ a { <===> ================================================================================ +<===> percents/clamped/green/options.yml +:todo: + - dart-sass + <===> percents/clamped/green/input.scss a {b: rgb(0 -0.1% 0)} @@ -149,6 +169,10 @@ a { <===> ================================================================================ +<===> percents/clamped/blue/options.yml +:todo: + - dart-sass + <===> percents/clamped/blue/input.scss a {b: rgb(0 0 200%)} diff --git a/spec/core_functions/color/rgb/three_args/percents.hrx b/spec/core_functions/color/rgb/three_args/percents.hrx index 28fca22495..b49becab10 100644 --- a/spec/core_functions/color/rgb/three_args/percents.hrx +++ b/spec/core_functions/color/rgb/three_args/percents.hrx @@ -9,7 +9,7 @@ a {b: rgb(7.1%, 20.4%, 33.9%)} <===> all/percent/output.css a { - b: rgb(18, 52, 86); + b: rgb(18.105, 52.02, 86.445); } <===> all/percent/output-libsass.css @@ -24,7 +24,7 @@ a {b: rgb(74.7%, 173, 93%)} <===> unitless/green/output.css a { - b: rgb(190, 173, 237); + b: rgb(190.485, 173, 237.15); } <===> unitless/green/output-libsass.css @@ -39,7 +39,7 @@ a {b: rgb(190, 68%, 237)} <===> percent/green/output.css a { - b: rgb(190, 173, 237); + b: rgb(190, 173.4, 237); } <===> percent/green/output-libsass.css @@ -54,7 +54,7 @@ a {b: rgb(0%, 100%, 50%)} <===> boundaries/output.css a { - b: rgb(0, 255, 128); + b: rgb(0, 255, 127.5); } <===> boundaries/output-libsass.css @@ -69,6 +69,10 @@ Channels that are out of bounds are clamped within bounds. <===> ================================================================================ +<===> clamped/red/options.yml +:todo: + - dart-sass + <===> clamped/red/input.scss a {b: rgb(100.1%, 0, 0)} @@ -84,6 +88,10 @@ a { <===> ================================================================================ +<===> clamped/green/options.yml +:todo: + - dart-sass + <===> clamped/green/input.scss a {b: rgb(0, -0.1%, 0)} @@ -99,6 +107,10 @@ a { <===> ================================================================================ +<===> clamped/blue/options.yml +:todo: + - dart-sass + <===> clamped/blue/input.scss a {b: rgb(0, 0, 200%)} diff --git a/spec/core_functions/color/rgb/three_args/unitless.hrx b/spec/core_functions/color/rgb/three_args/unitless.hrx index fc560da604..2f1f4262b9 100644 --- a/spec/core_functions/color/rgb/three_args/unitless.hrx +++ b/spec/core_functions/color/rgb/three_args/unitless.hrx @@ -68,6 +68,10 @@ Channels that are out of bounds are clamped within bounds. <===> ================================================================================ +<===> clamped/red/options.yml +:todo: + - dart-sass + <===> clamped/red/input.scss a {b: rgb(256, 0, 0)} @@ -83,6 +87,10 @@ a { <===> ================================================================================ +<===> clamped/green/options.yml +:todo: + - dart-sass + <===> clamped/green/input.scss a {b: rgb(0, -1, 0)} @@ -98,6 +106,10 @@ a { <===> ================================================================================ +<===> clamped/blue/options.yml +:todo: + - dart-sass + <===> clamped/blue/input.scss a {b: rgb(0, 0, 9999)} diff --git a/spec/core_functions/color/saturate.hrx b/spec/core_functions/color/saturate.hrx index 45b58c2ee4..913e6c8a60 100644 --- a/spec/core_functions/color/saturate.hrx +++ b/spec/core_functions/color/saturate.hrx @@ -74,6 +74,11 @@ a { a {b: saturate(plum, 14%)} <===> two_args/middle/output.css +a { + b: rgb(230.03, 150.97, 230.03); +} + +<===> two_args/middle/output-libsass.css a { b: #e697e6; } @@ -94,6 +99,11 @@ a { a {b: saturate($color: plum, $amount: 14%)} <===> two_args/named/output.css +a { + b: rgb(230.03, 150.97, 230.03); +} + +<===> two_args/named/output-libsass.css a { b: #e697e6; } diff --git a/spec/core_functions/color/scale_color/error/args.hrx b/spec/core_functions/color/scale_color/error/args.hrx index bd3c6c6b5a..f3a9931c2d 100644 --- a/spec/core_functions/color/scale_color/error/args.hrx +++ b/spec/core_functions/color/scale_color/error/args.hrx @@ -49,7 +49,7 @@ Error: Only one positional argument is allowed. All other arguments must be pass a {b: scale-color(red, $hue: 10%)} <===> unknown/error -Error: No argument named $hue. +Error: $hue: Channel isn't scalable. , 1 | a {b: scale-color(red, $hue: 10%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/scale_color/error/mixed_formats.hrx b/spec/core_functions/color/scale_color/error/mixed_formats.hrx index 92d2ac71fe..a73c1f0a34 100644 --- a/spec/core_functions/color/scale_color/error/mixed_formats.hrx +++ b/spec/core_functions/color/scale_color/error/mixed_formats.hrx @@ -2,7 +2,7 @@ a {b: scale-color(red, $red: 1%, $saturation: 1%)} <===> red_and_saturation/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $saturation: Color space rgb doesn't have a channel with this name. , 1 | a {b: scale-color(red, $red: 1%, $saturation: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ Error: Cannot specify HSL and RGB values for a color at the same time for `scale a {b: scale-color(red, $green: 1%, $saturation: 1%)} <===> green_and_saturation/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $saturation: Color space rgb doesn't have a channel with this name. , 1 | a {b: scale-color(red, $green: 1%, $saturation: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -44,7 +44,7 @@ Error: Cannot specify HSL and RGB values for a color at the same time for `scale a {b: scale-color(red, $blue: 1%, $lightness: 1%)} <===> blue_and_lightness/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $lightness: Color space rgb doesn't have a channel with this name. , 1 | a {b: scale-color(red, $blue: 1%, $lightness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -70,7 +70,7 @@ Error: Cannot specify HSL and RGB values for a color at the same time for `scale a {b: scale-color(red, $red: 1%, $blackness: 1%)} <===> red_and_blackness/error -Error: RGB parameters may not be passed along with HWB parameters. +Error: $blackness: Color space rgb doesn't have a channel with this name. , 1 | a {b: scale-color(red, $red: 1%, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -88,7 +88,7 @@ Error: RGB parameters may not be passed along with HWB parameters. a {b: scale-color(red, $green: 1%, $whiteness: 1%)} <===> green_and_whiteness/error -Error: RGB parameters may not be passed along with HWB parameters. +Error: $whiteness: Color space rgb doesn't have a channel with this name. , 1 | a {b: scale-color(red, $green: 1%, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -106,7 +106,7 @@ Error: RGB parameters may not be passed along with HWB parameters. a {b: scale-color(red, $saturation: 1%, $blackness: 1%)} <===> saturation_and_blackness/error -Error: HSL parameters may not be passed along with HWB parameters. +Error: $blackness: Color space hsl doesn't have a channel with this name. , 1 | a {b: scale-color(red, $saturation: 1%, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -124,10 +124,9 @@ Error: HSL parameters may not be passed along with HWB parameters. a {b: scale-color(red, $lightness: 1%, $whiteness: 1%)} <===> lightness_and_whiteness/error -Error: HSL parameters may not be passed along with HWB parameters. +Error: $whiteness: Color space hsl doesn't have a channel with this name. , 1 | a {b: scale-color(red, $lightness: 1%, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 1:7 root stylesheet - diff --git a/spec/core_functions/color/scale_color/hsl.hrx b/spec/core_functions/color/scale_color/hsl.hrx index 2ec6a59500..7cb73a3b16 100644 --- a/spec/core_functions/color/scale_color/hsl.hrx +++ b/spec/core_functions/color/scale_color/hsl.hrx @@ -22,6 +22,11 @@ a { a {b: scale-color(plum, $saturation: -100%)} <===> saturation/min/output.css +a { + b: rgb(190.5, 190.5, 190.5); +} + +<===> saturation/min/output-libsass.css a { b: #bfbfbf; } @@ -32,6 +37,11 @@ a { a {b: scale-color(plum, $saturation: 67%)} <===> saturation/high/output.css +a { + b: rgb(243.78, 137.22, 243.78); +} + +<===> saturation/high/output-libsass.css a { b: #f489f4; } @@ -42,6 +52,11 @@ a { a {b: scale-color(plum, $saturation: -43%)} <===> saturation/low/output.css +a { + b: rgb(207.885, 173.115, 207.885); +} + +<===> saturation/low/output-libsass.css a { b: #d0add0; } @@ -82,6 +97,11 @@ a { a {b: scale-color(red, $lightness: 94%)} <===> lightness/high/output.css +a { + b: rgb(255, 239.7, 239.7); +} + +<===> lightness/high/output-libsass.css a { b: #fff0f0; } @@ -92,6 +112,11 @@ a { a {b: scale-color(red, $lightness: -14%)} <===> lightness/low/output.css +a { + b: rgb(219.3, 0, 0); +} + +<===> lightness/low/output-libsass.css a { b: #db0000; } @@ -102,6 +127,11 @@ a { a {b: scale-color(turquoise, $saturation: 24%, $lightness: -48%)} <===> all/output.css +a { + b: rgb(15.8934486486, 133.8665513514, 122.0692410811); +} + +<===> all/output-libsass.css a { b: #10867a; } @@ -112,6 +142,11 @@ a { a {b: scale-color(rgba(turquoise, 0.7), $saturation: 24%, $lightness: -48%)} <===> alpha_input/output.css +a { + b: rgba(15.8934486486, 133.8665513514, 122.0692410811, 0.7); +} + +<===> alpha_input/output-libsass.css a { b: rgba(16, 134, 122, 0.7); } @@ -122,6 +157,11 @@ a { a {b: scale-color(turquoise, $saturation: 24%, $lightness: -48%, $alpha: -70%)} <===> alpha_arg/output.css +a { + b: rgba(15.8934486486, 133.8665513514, 122.0692410811, 0.3); +} + +<===> alpha_arg/output-libsass.css a { b: rgba(16, 134, 122, 0.3); } @@ -132,6 +172,11 @@ a { a {b: scale-color($color: turquoise, $saturation: 24%, $lightness: -48%)} <===> named/output.css +a { + b: rgb(15.8934486486, 133.8665513514, 122.0692410811); +} + +<===> named/output-libsass.css a { b: #10867a; } diff --git a/spec/core_functions/color/scale_color/hwb.hrx b/spec/core_functions/color/scale_color/hwb.hrx index 2d2ab6e4c7..7b79f14252 100644 --- a/spec/core_functions/color/scale_color/hwb.hrx +++ b/spec/core_functions/color/scale_color/hwb.hrx @@ -10,7 +10,7 @@ a {b: scale-color(#66cc99, $whiteness: 100%)} <===> whiteness/max/output.css a { - b: #d5d5d5; + b: rgb(212.5, 212.5, 212.5); } <===> @@ -40,7 +40,7 @@ a {b: scale-color(#33cc80, $whiteness: 50%)} <===> whiteness/high/output.css a { - b: #99ccb3; + b: rgb(153, 204, 178.6666666667); } <===> @@ -50,7 +50,7 @@ a {b: scale-color(#66cc99, $whiteness: -50%)} <===> whiteness/low/output.css a { - b: #33cc80; + b: rgb(51, 204, 127.5); } <===> @@ -60,7 +60,7 @@ a {b: scale-color(#339966, $blackness: 100%)} <===> blackness/max/output.css a { - b: #2b2b2b; + b: rgb(42.5, 42.5, 42.5); } <===> @@ -90,7 +90,7 @@ a {b: scale-color(#33cc80, $blackness: 50%)} <===> blackness/high/output.css a { - b: #33664d; + b: rgb(51, 102, 76.6666666667); } <===> @@ -100,7 +100,7 @@ a {b: scale-color(#339966, $blackness: -50%)} <===> blackness/low/output.css a { - b: #33cc80; + b: rgb(51, 204, 127.5); } <===> @@ -110,7 +110,7 @@ a {b: scale-color(#66cc99, $whiteness: -50%, $blackness: 50%)} <===> all/output.css a { - b: #33664d; + b: rgb(51, 102, 76.5); } <===> @@ -120,7 +120,7 @@ a {b: scale-color(rgba(#66cc99, 0.7), $whiteness: -50%, $blackness: 50%)} <===> alpha_input/output.css a { - b: rgba(51, 102, 77, 0.7); + b: rgba(51, 102, 76.5, 0.7); } <===> @@ -130,7 +130,7 @@ a {b: scale-color(#66cc99, $whiteness: -50%, $blackness: 50%, $alpha: -70%)} <===> alpha_arg/output.css a { - b: rgba(51, 102, 77, 0.3); + b: rgba(51, 102, 76.5, 0.3); } <===> @@ -140,5 +140,5 @@ a {b: scale-color($color: #66cc99, $whiteness: -50%, $blackness: 50%)} <===> named/output.css a { - b: #33664d; + b: rgb(51, 102, 76.5); } diff --git a/spec/core_functions/color/scale_color/rgb.hrx b/spec/core_functions/color/scale_color/rgb.hrx index 25b93dc925..74a5137e4c 100644 --- a/spec/core_functions/color/scale_color/rgb.hrx +++ b/spec/core_functions/color/scale_color/rgb.hrx @@ -32,6 +32,11 @@ a { a {b: scale-color(lightcoral, $red: -33%)} <===> red/low/output.css +a { + b: rgb(160.8, 128, 128); +} + +<===> red/low/output-libsass.css a { b: #a18080; } @@ -42,6 +47,11 @@ a { a {b: scale-color(turquoise, $red: 86%)} <===> red/high/output.css +a { + b: rgb(228.26, 224, 208); +} + +<===> red/high/output-libsass.css a { b: #e4e0d0; } @@ -82,6 +92,11 @@ a { a {b: scale-color(seagreen, $green: -86%)} <===> green/low/output.css +a { + b: rgb(46, 19.46, 87); +} + +<===> green/low/output-libsass.css a { b: #2e1357; } @@ -92,6 +107,11 @@ a { a {b: scale-color(cadetblue, $green: 12%)} <===> green/high/output.css +a { + b: rgb(95, 169.64, 160); +} + +<===> green/high/output-libsass.css a { b: #5faaa0; } @@ -132,6 +152,11 @@ a { a {b: scale-color(slategray, $blue: -16%)} <===> blue/low/output.css +a { + b: rgb(112, 128, 120.96); +} + +<===> blue/low/output-libsass.css a { b: #708079; } @@ -142,6 +167,11 @@ a { a {b: scale-color(salmon, $blue: 42%)} <===> blue/high/output.css +a { + b: rgb(250, 128, 173.22); +} + +<===> blue/high/output-libsass.css a { b: #fa80ad; } @@ -152,6 +182,11 @@ a { a {b: scale-color(sienna, $red: 12%, $green: 24%, $blue: 48%)} <===> all/output.css +a { + b: rgb(171.4, 123.52, 145.8); +} + +<===> all/output-libsass.css a { b: #ab7c92; } @@ -162,6 +197,11 @@ a { a {b: scale-color(rgba(sienna, 0.3), $red: 12%, $green: 24%, $blue: 48%)} <===> alpha_input/output.css +a { + b: rgba(171.4, 123.52, 145.8, 0.3); +} + +<===> alpha_input/output-libsass.css a { b: rgba(171, 124, 146, 0.3); } @@ -172,6 +212,11 @@ a { a {b: scale-color(sienna, $red: 12%, $green: 24%, $blue: 48%, $alpha: -70%)} <===> alpha_arg/output.css +a { + b: rgba(171.4, 123.52, 145.8, 0.3); +} + +<===> alpha_arg/output-libsass.css a { b: rgba(171, 124, 146, 0.3); } @@ -182,6 +227,11 @@ a { a {b: scale-color($color: sienna, $red: 12%, $green: 24%, $blue: 48%)} <===> named/output.css +a { + b: rgb(171.4, 123.52, 145.8); +} + +<===> named/output-libsass.css a { b: #ab7c92; } diff --git a/spec/core_functions/color/whiteness.hrx b/spec/core_functions/color/whiteness.hrx index ab0c5c8a4e..acc7117889 100644 --- a/spec/core_functions/color/whiteness.hrx +++ b/spec/core_functions/color/whiteness.hrx @@ -33,7 +33,7 @@ a {b: color.whiteness(color.hwb(0, 50%, 0%))} <===> middle/zero_blackness/output.css a { - b: 50.1960784314%; + b: 50%; } <===> @@ -44,7 +44,7 @@ a {b: color.whiteness(color.hwb(0, 50%, 50%))} <===> middle/half_blackness/output.css a { - b: 50.1960784314%; + b: 50%; } <===> @@ -55,7 +55,7 @@ a {b: color.whiteness(color.hwb(0, 70%, 70%))} <===> middle/high_blackness/output.css a { - b: 50.1960784314%; + b: 50%; } <===> @@ -66,7 +66,7 @@ a {b: color.whiteness(color.hwb(0, 0.5%, 0%))} <===> fraction/output.css a { - b: 0.3921568627%; + b: 0.5%; } <===> @@ -77,7 +77,7 @@ a {b: color.whiteness($color: color.hwb(0, 42%, 0%))} <===> named/output.css a { - b: 41.9607843137%; + b: 42%; } <===> diff --git a/spec/core_functions/meta/call.hrx b/spec/core_functions/meta/call.hrx index 3fb1c6fa9e..b2ae9163f5 100644 --- a/spec/core_functions/meta/call.hrx +++ b/spec/core_functions/meta/call.hrx @@ -205,7 +205,7 @@ Error: Function call is missing argument $function. a {b: call(get-function("rgb"), 1)} <===> error/invalid_args/error -Error: Missing element $green. +Error: $channels: The rgb color space has 3 channels but 1 has 1. , 1 | a {b: call(get-function("rgb"), 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/meta/keywords.hrx b/spec/core_functions/meta/keywords.hrx index b14132567b..304ef20133 100644 --- a/spec/core_functions/meta/keywords.hrx +++ b/spec/core_functions/meta/keywords.hrx @@ -150,7 +150,7 @@ a { a {b: keywords(1 2 3)} <===> error/type/non_arg_list/error -Error: $args: 1 2 3 is not an argument list. +Error: $args: (1 2 3) is not an argument list. , 1 | a {b: keywords(1 2 3)} | ^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/modules/color.hrx b/spec/core_functions/modules/color.hrx index 85aafb72cc..a6746a29b9 100644 --- a/spec/core_functions/modules/color.hrx +++ b/spec/core_functions/modules/color.hrx @@ -125,7 +125,7 @@ a {b: color.scale(#abcdef, $red: 10%)} <===> scale/output.css a { - b: #b3cdef; + b: rgb(179.4, 205, 239); } <===> diff --git a/spec/core_functions/selector/parse/error.hrx b/spec/core_functions/selector/parse/error.hrx index d6c6158ffe..851e12d6c9 100644 --- a/spec/core_functions/selector/parse/error.hrx +++ b/spec/core_functions/selector/parse/error.hrx @@ -120,7 +120,7 @@ a list of strings, or a list of lists of strings. a {b: selector-parse(append((), append((), c)))} <===> outer_space/error -Error: $selector: c is not a valid selector: it must be a string, +Error: $selector: (c) is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , 1 | a {b: selector-parse(append((), append((), c)))} @@ -141,7 +141,7 @@ a list of strings, or a list of lists of strings. a {b: selector-parse(list.slash(c d, e f))} <===> slash_list/top_level/error -Error: $selector: c d / e f is not a valid selector: it must be a string, +Error: $selector: (c d / e f) is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , 2 | a {b: selector-parse(list.slash(c d, e f))} @@ -156,7 +156,7 @@ a list of strings, or a list of lists of strings. a {b: selector-parse((list.slash(c, d), list.slash(e, f)))} <===> slash_list/in_comma_list/error -Error: $selector: c / d, e / f is not a valid selector: it must be a string, +Error: $selector: (c / d, e / f) is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , 2 | a {b: selector-parse((list.slash(c, d), list.slash(e, f)))} diff --git a/spec/core_functions/string/quote.hrx b/spec/core_functions/string/quote.hrx index 8d42978d48..9743d3f309 100644 --- a/spec/core_functions/string/quote.hrx +++ b/spec/core_functions/string/quote.hrx @@ -79,7 +79,7 @@ a { a {b: quote((1, 2, 3))} <===> error/type/error -Error: $string: 1, 2, 3 is not a string. +Error: $string: (1, 2, 3) is not a string. , 1 | a {b: quote((1, 2, 3))} | ^^^^^^^^^^^^^^^^ diff --git a/spec/libsass-closed-issues/issue_1101.hrx b/spec/libsass-closed-issues/issue_1101.hrx index 0439c858c4..ece3cfe2eb 100644 --- a/spec/libsass-closed-issues/issue_1101.hrx +++ b/spec/libsass-closed-issues/issue_1101.hrx @@ -4,6 +4,11 @@ foo { bar: adjust-color($foo, $hue: -6deg, $lightness: -16%, $saturation: -7%); } <===> output.css +foo { + bar: rgb(214.2, 214.2, 214.2); +} + +<===> output-libsass.css foo { bar: #d6d6d6; } diff --git a/spec/libsass-closed-issues/issue_1240.hrx b/spec/libsass-closed-issues/issue_1240.hrx index 051ad6855b..760455d3a2 100644 --- a/spec/libsass-closed-issues/issue_1240.hrx +++ b/spec/libsass-closed-issues/issue_1240.hrx @@ -23,6 +23,6 @@ div { <===> warning input.scss:5 DEBUG: 1 -input.scss:6 DEBUG: 2, 3 -input.scss:7 DEBUG: 1 (2, 3) -input.scss:8 DEBUG: 1 (2, 3) +input.scss:6 DEBUG: (2, 3) +input.scss:7 DEBUG: (1 (2, 3)) +input.scss:8 DEBUG: (1 (2, 3)) diff --git a/spec/libsass-closed-issues/issue_1285.hrx b/spec/libsass-closed-issues/issue_1285.hrx index a327dc4405..d6821f0b4c 100644 --- a/spec/libsass-closed-issues/issue_1285.hrx +++ b/spec/libsass-closed-issues/issue_1285.hrx @@ -13,15 +13,35 @@ } <===> output.css +.box-1 { + color: rgb(229.5, 0, 0); +} + +.box-2 { + color: #cc0000; +} + +.box-3 { + color: rgb(178.5, 0, 0); +} + +.outside-child { + background-color: blue; +} + +<===> output-libsass.css .box-1 { color: #e60000; } + .box-2 { color: #cc0000; } + .box-3 { color: #b30000; } + .outside-child { background-color: blue; } diff --git a/spec/libsass-closed-issues/issue_1768.hrx b/spec/libsass-closed-issues/issue_1768.hrx index f77fffccff..c587efd9a9 100644 --- a/spec/libsass-closed-issues/issue_1768.hrx +++ b/spec/libsass-closed-issues/issue_1768.hrx @@ -7,6 +7,6 @@ <===> warning input.scss:1 DEBUG: () -input.scss:2 DEBUG: foo, (), bar -input.scss:3 DEBUG: foo () bar +input.scss:2 DEBUG: (foo, (), bar) +input.scss:3 DEBUG: (foo () bar) input.scss:4 DEBUG: (foo: (), bar: baz) diff --git a/spec/libsass-closed-issues/issue_2374.hrx b/spec/libsass-closed-issues/issue_2374.hrx index 93e0bfe184..be9934d733 100644 --- a/spec/libsass-closed-issues/issue_2374.hrx +++ b/spec/libsass-closed-issues/issue_2374.hrx @@ -30,6 +30,83 @@ $colors: ( background-color: white; } +.yellow-100 { + background-color: rgb(255, 254.7755102041, 252.8); +} + +.yellow-200 { + background-color: rgb(255, 253.7346938776, 242.6); +} + +.yellow-300 { + background-color: rgb(255, 252.693877551, 232.4); +} + +.yellow-400 { + background-color: rgb(255, 251.6530612245, 222.2); +} + +.yellow-500 { + background-color: rgb(255, 250.612244898, 212); +} + +.yellow-600 { + background-color: rgb(255, 249.5714285714, 201.8); +} + +.yellow-700 { + background-color: rgb(255, 248.5306122449, 191.6); +} + +.yellow-800 { + background-color: rgb(255, 247.4897959184, 181.4); +} + +.yellow-900 { + background-color: rgb(255, 246.4489795918, 171.2); +} + +.yellow-0 { + background-color: #ffff33; +} + +.yellow-100 { + background-color: #ffff33; +} + +.yellow-200 { + background-color: #ffff33; +} + +.red-0 { + background-color: #ff3333; +} + +.red-100 { + background-color: #ff3333; +} + +.red-200 { + background-color: #ff3333; +} + +.blue-0 { + background-color: #3333ff; +} + +.blue-100 { + background-color: #3333ff; +} + +.blue-200 { + background-color: #3333ff; +} + +<===> output-libsass.css +.yellow-0 { + background-color: white; +} + .yellow-100 { background-color: #fffffd; } @@ -109,7 +186,7 @@ Always quote color names when using them as strings or map keys (for example, "y If you really want to use the color value here, use '"" + $name'. , -7 | .#{$name}-#{($i*100)} { background-color: lighten($color, $amount) }; +7 | .#{$name}-#{($i*100)} { background-color: lighten($color, $amount) }; | ^^^^^ ' input.scss 7:12 root stylesheet @@ -120,7 +197,7 @@ Always quote color names when using them as strings or map keys (for example, "y If you really want to use the color value here, use '"" + $name'. , -20 | .#{$name}-#{($i*100)} { +20 | .#{$name}-#{($i*100)} { | ^^^^^ ' input.scss 20:12 root stylesheet @@ -131,7 +208,7 @@ Always quote color names when using them as strings or map keys (for example, "r If you really want to use the color value here, use '"" + $name'. , -20 | .#{$name}-#{($i*100)} { +20 | .#{$name}-#{($i*100)} { | ^^^^^ ' input.scss 20:12 root stylesheet @@ -142,7 +219,7 @@ Always quote color names when using them as strings or map keys (for example, "b If you really want to use the color value here, use '"" + $name'. , -20 | .#{$name}-#{($i*100)} { +20 | .#{$name}-#{($i*100)} { | ^^^^^ ' input.scss 20:12 root stylesheet diff --git a/spec/libsass-closed-issues/issue_238760.hrx b/spec/libsass-closed-issues/issue_238760.hrx index 3fceda3103..17ec8b9341 100644 --- a/spec/libsass-closed-issues/issue_238760.hrx +++ b/spec/libsass-closed-issues/issue_238760.hrx @@ -2,7 +2,7 @@ $id: inspect((a#b:c)...) <===> error Error: Variable keyword argument map must have string keys. -a #b is not a string in (a #b: c). +(a #b) is not a string in (a #b: c). , 1 | $id: inspect((a#b:c)...) | ^^^^^^^ diff --git a/spec/libsass-closed-issues/issue_2462.hrx b/spec/libsass-closed-issues/issue_2462.hrx index 5352dfeaa5..420b17bb39 100644 --- a/spec/libsass-closed-issues/issue_2462.hrx +++ b/spec/libsass-closed-issues/issue_2462.hrx @@ -4,6 +4,11 @@ b { } <===> output.css +b { + color: rgb(236.75, 54.25, 90.75); +} + +<===> output-libsass.css b { color: #ed365b; } diff --git a/spec/libsass-closed-issues/issue_2472.hrx b/spec/libsass-closed-issues/issue_2472.hrx index df01eb139c..98b6b3d5a9 100644 --- a/spec/libsass-closed-issues/issue_2472.hrx +++ b/spec/libsass-closed-issues/issue_2472.hrx @@ -22,6 +22,15 @@ $arg: join((), 5%); function2: dark2(#102030, 5%); } <===> output.css +.single { + direct: rgb(9.625, 19.25, 28.875); + arg: rgb(9.625, 19.25, 28.875); + call: rgb(9.625, 19.25, 28.875); + function: rgb(9.625, 19.25, 28.875); + function2: rgb(9.625, 19.25, 28.875); +} + +<===> output-libsass.css .single { direct: #0a131d; arg: #0a131d; @@ -65,10 +74,10 @@ Recommendation: call(get-function("darken")) <===> warning-libsass DEPRECATION WARNING: Passing a string to call() is deprecated and will be illegal -in Sass 4.0. Use call(function-reference(foobar)) instead. +in Sass 4.0. Use call(get-function("darken")) instead. DEPRECATION WARNING: Passing a string to call() is deprecated and will be illegal -in Sass 4.0. Use call(function-reference(foobar)) instead. +in Sass 4.0. Use call(get-function("darken")) instead. DEPRECATION WARNING: Passing a string to call() is deprecated and will be illegal -in Sass 4.0. Use call(function-reference(foobar)) instead. +in Sass 4.0. Use call(get-function("darken")) instead. diff --git a/spec/libsass-todo-issues/issue_2818.hrx b/spec/libsass-todo-issues/issue_2818.hrx index 893fcdcff4..88a45bcded 100644 --- a/spec/libsass-todo-issues/issue_2818.hrx +++ b/spec/libsass-todo-issues/issue_2818.hrx @@ -5,5 +5,5 @@ test { color: $base; } <===> output.css test { - color: #e4dede; + color: rgb(228.27, 222.33, 222.33); } diff --git a/spec/libsass/bourbon.hrx b/spec/libsass/bourbon.hrx index 57fa049a3a..0c2cf91adc 100644 --- a/spec/libsass/bourbon.hrx +++ b/spec/libsass/bourbon.hrx @@ -1928,8 +1928,8 @@ div { background-image: url("/images/a.png"), url("images/b.png"); background-image: url("/images/a.png"), -webkit-linear-gradient(white 0, yellow 50%, transparent 50%); background-image: url("/images/a.png"), linear-gradient( white 0, yellow 50%, transparent 50%); - background-image: -webkit-linear-gradient(hsla(0deg, 100%, 100%, 0.25) 0%, hsla(0deg, 100%, 100%, 0.08) 50%, transparent 50%), -webkit-linear-gradient(#4e7ba3, #3e6181); - background-image: linear-gradient( hsla(0deg, 100%, 100%, 0.25) 0%, hsla(0deg, 100%, 100%, 0.08) 50%, transparent 50%), linear-gradient( #4e7ba3, #3e6181); + background-image: -webkit-linear-gradient(hsla(0deg, 100%, 100%, 0.25) 0%, hsla(0deg, 100%, 100%, 0.08) 50%, transparent 50%), -webkit-linear-gradient(#4e7ba3, rgb(61.5619834711, 97.0785123967, 129.4380165289)); + background-image: linear-gradient( hsla(0deg, 100%, 100%, 0.25) 0%, hsla(0deg, 100%, 100%, 0.08) 50%, transparent 50%), linear-gradient( #4e7ba3, rgb(61.5619834711, 97.0785123967, 129.4380165289)); background-image: -webkit-url("/images/a.png")-gradient(center), -webkit-url("images/b.png")-gradient(left); background-image: url("/images/a.png")-gradient( center), url("images/b.png")-gradient( left); } diff --git a/spec/libsass/color-functions/other/change-color/h.hrx b/spec/libsass/color-functions/other/change-color/h.hrx index 469b0feb61..b8b2de1b09 100644 --- a/spec/libsass/color-functions/other/change-color/h.hrx +++ b/spec/libsass/color-functions/other/change-color/h.hrx @@ -366,367 +366,367 @@ foo { <===> output.css foo { - c-1: #ff0004; + c-1: rgb(255, 0, 4.25); c0: red; - c1: #ff0400; - c2: #ff0900; - c3: #ff0d00; + c1: rgb(255, 4.25, 0); + c2: rgb(255, 8.5, 0); + c3: rgb(255, 12.75, 0); c4: #ff1100; - c5: #ff1500; - c6: #ff1a00; - c7: #ff1e00; + c5: rgb(255, 21.25, 0); + c6: rgb(255, 25.5, 0); + c7: rgb(255, 29.75, 0); c8: #ff2200; - c9: #ff2600; - c10: #ff2b00; - c11: #ff2f00; + c9: rgb(255, 38.25, 0); + c10: rgb(255, 42.5, 0); + c11: rgb(255, 46.75, 0); c12: #ff3300; - c13: #ff3700; - c14: #ff3c00; - c15: #ff4000; + c13: rgb(255, 55.25, 0); + c14: rgb(255, 59.5, 0); + c15: rgb(255, 63.75, 0); c16: #ff4400; - c17: #ff4800; - c18: #ff4d00; - c19: #ff5100; + c17: rgb(255, 72.25, 0); + c18: rgb(255, 76.5, 0); + c19: rgb(255, 80.75, 0); c20: #ff5500; - c21: #ff5900; - c22: #ff5e00; - c23: #ff6200; + c21: rgb(255, 89.25, 0); + c22: rgb(255, 93.5, 0); + c23: rgb(255, 97.75, 0); c24: #ff6600; - c25: #ff6a00; - c26: #ff6f00; - c27: #ff7300; + c25: rgb(255, 106.25, 0); + c26: rgb(255, 110.5, 0); + c27: rgb(255, 114.75, 0); c28: #ff7700; - c29: #ff7b00; - c30: #ff8000; - c31: #ff8400; + c29: rgb(255, 123.25, 0); + c30: rgb(255, 127.5, 0); + c31: rgb(255, 131.75, 0); c32: #ff8800; - c33: darkorange; - c34: #ff9100; - c35: #ff9500; + c33: rgb(255, 140.25, 0); + c34: rgb(255, 144.5, 0); + c35: rgb(255, 148.75, 0); c36: #ff9900; - c37: #ff9d00; - c38: #ffa200; - c39: #ffa600; + c37: rgb(255, 157.25, 0); + c38: rgb(255, 161.5, 0); + c39: rgb(255, 165.75, 0); c40: #ffaa00; - c41: #ffae00; - c42: #ffb300; - c43: #ffb700; + c41: rgb(255, 174.25, 0); + c42: rgb(255, 178.5, 0); + c43: rgb(255, 182.75, 0); c44: #ffbb00; - c45: #ffbf00; - c46: #ffc400; - c47: #ffc800; + c45: rgb(255, 191.25, 0); + c46: rgb(255, 195.5, 0); + c47: rgb(255, 199.75, 0); c48: #ffcc00; - c49: #ffd000; - c50: #ffd500; - c51: #ffd900; + c49: rgb(255, 208.25, 0); + c50: rgb(255, 212.5, 0); + c51: rgb(255, 216.75, 0); c52: #ffdd00; - c53: #ffe100; - c54: #ffe600; - c55: #ffea00; + c53: rgb(255, 225.25, 0); + c54: rgb(255, 229.5, 0); + c55: rgb(255, 233.75, 0); c56: #ffee00; - c57: #fff200; - c58: #fff700; - c59: #fffb00; + c57: rgb(255, 242.25, 0); + c58: rgb(255, 246.5, 0); + c59: rgb(255, 250.75, 0); c60: yellow; - c61: #fbff00; - c62: #f7ff00; - c63: #f2ff00; + c61: rgb(250.75, 255, 0); + c62: rgb(246.5, 255, 0); + c63: rgb(242.25, 255, 0); c64: #eeff00; - c65: #eaff00; - c66: #e6ff00; - c67: #e1ff00; + c65: rgb(233.75, 255, 0); + c66: rgb(229.5, 255, 0); + c67: rgb(225.25, 255, 0); c68: #ddff00; - c69: #d9ff00; - c70: #d5ff00; - c71: #d0ff00; + c69: rgb(216.75, 255, 0); + c70: rgb(212.5, 255, 0); + c71: rgb(208.25, 255, 0); c72: #ccff00; - c73: #c8ff00; - c74: #c4ff00; - c75: #bfff00; + c73: rgb(199.75, 255, 0); + c74: rgb(195.5, 255, 0); + c75: rgb(191.25, 255, 0); c76: #bbff00; - c77: #b7ff00; - c78: #b3ff00; - c79: #aeff00; + c77: rgb(182.75, 255, 0); + c78: rgb(178.5, 255, 0); + c79: rgb(174.25, 255, 0); c80: #aaff00; - c81: #a6ff00; - c82: #a2ff00; - c83: #9dff00; + c81: rgb(165.75, 255, 0); + c82: rgb(161.5, 255, 0); + c83: rgb(157.25, 255, 0); c84: #99ff00; - c85: #95ff00; - c86: #91ff00; - c87: #8cff00; + c85: rgb(148.75, 255, 0); + c86: rgb(144.5, 255, 0); + c87: rgb(140.25, 255, 0); c88: #88ff00; - c89: #84ff00; - c90: #80ff00; - c91: #7bff00; + c89: rgb(131.75, 255, 0); + c90: rgb(127.5, 255, 0); + c91: rgb(123.25, 255, 0); c92: #77ff00; - c93: #73ff00; - c94: #6fff00; - c95: #6aff00; + c93: rgb(114.75, 255, 0); + c94: rgb(110.5, 255, 0); + c95: rgb(106.25, 255, 0); c96: #66ff00; - c97: #62ff00; - c98: #5eff00; - c99: #59ff00; + c97: rgb(97.75, 255, 0); + c98: rgb(93.5, 255, 0); + c99: rgb(89.25, 255, 0); c100: #55ff00; - c101: #51ff00; - c102: #4dff00; - c103: #48ff00; + c101: rgb(80.75, 255, 0); + c102: rgb(76.5, 255, 0); + c103: rgb(72.25, 255, 0); c104: #44ff00; - c105: #40ff00; - c106: #3cff00; - c107: #37ff00; + c105: rgb(63.75, 255, 0); + c106: rgb(59.5, 255, 0); + c107: rgb(55.25, 255, 0); c108: #33ff00; - c109: #2fff00; - c110: #2bff00; - c111: #26ff00; + c109: rgb(46.75, 255, 0); + c110: rgb(42.5, 255, 0); + c111: rgb(38.25, 255, 0); c112: #22ff00; - c113: #1eff00; - c114: #1aff00; - c115: #15ff00; + c113: rgb(29.75, 255, 0); + c114: rgb(25.5, 255, 0); + c115: rgb(21.25, 255, 0); c116: #11ff00; - c117: #0dff00; - c118: #09ff00; - c119: #04ff00; + c117: rgb(12.75, 255, 0); + c118: rgb(8.5, 255, 0); + c119: rgb(4.25, 255, 0); c120: lime; - c121: #00ff04; - c122: #00ff09; - c123: #00ff0d; + c121: rgb(0, 255, 4.25); + c122: rgb(0, 255, 8.5); + c123: rgb(0, 255, 12.75); c124: #00ff11; - c125: #00ff15; - c126: #00ff1a; - c127: #00ff1e; + c125: rgb(0, 255, 21.25); + c126: rgb(0, 255, 25.5); + c127: rgb(0, 255, 29.75); c128: #00ff22; - c129: #00ff26; - c130: #00ff2b; - c131: #00ff2f; + c129: rgb(0, 255, 38.25); + c130: rgb(0, 255, 42.5); + c131: rgb(0, 255, 46.75); c132: #00ff33; - c133: #00ff37; - c134: #00ff3c; - c135: #00ff40; + c133: rgb(0, 255, 55.25); + c134: rgb(0, 255, 59.5); + c135: rgb(0, 255, 63.75); c136: #00ff44; - c137: #00ff48; - c138: #00ff4d; - c139: #00ff51; + c137: rgb(0, 255, 72.25); + c138: rgb(0, 255, 76.5); + c139: rgb(0, 255, 80.75); c140: #00ff55; - c141: #00ff59; - c142: #00ff5e; - c143: #00ff62; + c141: rgb(0, 255, 89.25); + c142: rgb(0, 255, 93.5); + c143: rgb(0, 255, 97.75); c144: #00ff66; - c145: #00ff6a; - c146: #00ff6f; - c147: #00ff73; + c145: rgb(0, 255, 106.25); + c146: rgb(0, 255, 110.5); + c147: rgb(0, 255, 114.75); c148: #00ff77; - c149: #00ff7b; - c150: #00ff80; - c151: #00ff84; + c149: rgb(0, 255, 123.25); + c150: rgb(0, 255, 127.5); + c151: rgb(0, 255, 131.75); c152: #00ff88; - c153: #00ff8c; - c154: #00ff91; - c155: #00ff95; + c153: rgb(0, 255, 140.25); + c154: rgb(0, 255, 144.5); + c155: rgb(0, 255, 148.75); c156: #00ff99; - c157: #00ff9d; - c158: #00ffa2; - c159: #00ffa6; + c157: rgb(0, 255, 157.25); + c158: rgb(0, 255, 161.5); + c159: rgb(0, 255, 165.75); c160: #00ffaa; - c161: #00ffae; - c162: #00ffb3; - c163: #00ffb7; + c161: rgb(0, 255, 174.25); + c162: rgb(0, 255, 178.5); + c163: rgb(0, 255, 182.75); c164: #00ffbb; - c165: #00ffbf; - c166: #00ffc4; - c167: #00ffc8; + c165: rgb(0, 255, 191.25); + c166: rgb(0, 255, 195.5); + c167: rgb(0, 255, 199.75); c168: #00ffcc; - c169: #00ffd0; - c170: #00ffd5; - c171: #00ffd9; + c169: rgb(0, 255, 208.25); + c170: rgb(0, 255, 212.5); + c171: rgb(0, 255, 216.75); c172: #00ffdd; - c173: #00ffe1; - c174: #00ffe6; - c175: #00ffea; + c173: rgb(0, 255, 225.25); + c174: rgb(0, 255, 229.5); + c175: rgb(0, 255, 233.75); c176: #00ffee; - c177: #00fff2; - c178: #00fff7; - c179: #00fffb; + c177: rgb(0, 255, 242.25); + c178: rgb(0, 255, 246.5); + c179: rgb(0, 255, 250.75); c180: aqua; - c181: #00fbff; - c182: #00f7ff; - c183: #00f2ff; + c181: rgb(0, 250.75, 255); + c182: rgb(0, 246.5, 255); + c183: rgb(0, 242.25, 255); c184: #00eeff; - c185: #00eaff; - c186: #00e6ff; - c187: #00e1ff; + c185: rgb(0, 233.75, 255); + c186: rgb(0, 229.5, 255); + c187: rgb(0, 225.25, 255); c188: #00ddff; - c189: #00d9ff; - c190: #00d5ff; - c191: #00d0ff; + c189: rgb(0, 216.75, 255); + c190: rgb(0, 212.5, 255); + c191: rgb(0, 208.25, 255); c192: #00ccff; - c193: #00c8ff; - c194: #00c4ff; - c195: deepskyblue; + c193: rgb(0, 199.75, 255); + c194: rgb(0, 195.5, 255); + c195: rgb(0, 191.25, 255); c196: #00bbff; - c197: #00b7ff; - c198: #00b3ff; - c199: #00aeff; + c197: rgb(0, 182.75, 255); + c198: rgb(0, 178.5, 255); + c199: rgb(0, 174.25, 255); c200: #00aaff; - c201: #00a6ff; - c202: #00a2ff; - c203: #009dff; + c201: rgb(0, 165.75, 255); + c202: rgb(0, 161.5, 255); + c203: rgb(0, 157.25, 255); c204: #0099ff; - c205: #0095ff; - c206: #0091ff; - c207: #008cff; + c205: rgb(0, 148.75, 255); + c206: rgb(0, 144.5, 255); + c207: rgb(0, 140.25, 255); c208: #0088ff; - c209: #0084ff; - c210: #0080ff; - c211: #007bff; + c209: rgb(0, 131.75, 255); + c210: rgb(0, 127.5, 255); + c211: rgb(0, 123.25, 255); c212: #0077ff; - c213: #0073ff; - c214: #006fff; - c215: #006aff; + c213: rgb(0, 114.75, 255); + c214: rgb(0, 110.5, 255); + c215: rgb(0, 106.25, 255); c216: #0066ff; - c217: #0062ff; - c218: #005eff; - c219: #0059ff; + c217: rgb(0, 97.75, 255); + c218: rgb(0, 93.5, 255); + c219: rgb(0, 89.25, 255); c220: #0055ff; - c221: #0051ff; - c222: #004dff; - c223: #0048ff; + c221: rgb(0, 80.75, 255); + c222: rgb(0, 76.5, 255); + c223: rgb(0, 72.25, 255); c224: #0044ff; - c225: #0040ff; - c226: #003cff; - c227: #0037ff; + c225: rgb(0, 63.75, 255); + c226: rgb(0, 59.5, 255); + c227: rgb(0, 55.25, 255); c228: #0033ff; - c229: #002fff; - c230: #002bff; - c231: #0026ff; + c229: rgb(0, 46.75, 255); + c230: rgb(0, 42.5, 255); + c231: rgb(0, 38.25, 255); c232: #0022ff; - c233: #001eff; - c234: #001aff; - c235: #0015ff; + c233: rgb(0, 29.75, 255); + c234: rgb(0, 25.5, 255); + c235: rgb(0, 21.25, 255); c236: #0011ff; - c237: #000dff; - c238: #0009ff; - c239: #0004ff; + c237: rgb(0, 12.75, 255); + c238: rgb(0, 8.5, 255); + c239: rgb(0, 4.25, 255); c240: blue; - c241: #0400ff; - c242: #0900ff; - c243: #0d00ff; + c241: rgb(4.25, 0, 255); + c242: rgb(8.5, 0, 255); + c243: rgb(12.75, 0, 255); c244: #1100ff; - c245: #1500ff; - c246: #1a00ff; - c247: #1e00ff; + c245: rgb(21.25, 0, 255); + c246: rgb(25.5, 0, 255); + c247: rgb(29.75, 0, 255); c248: #2200ff; - c249: #2600ff; - c250: #2b00ff; - c251: #2f00ff; + c249: rgb(38.25, 0, 255); + c250: rgb(42.5, 0, 255); + c251: rgb(46.75, 0, 255); c252: #3300ff; - c253: #3700ff; - c254: #3c00ff; - c255: #4000ff; + c253: rgb(55.25, 0, 255); + c254: rgb(59.5, 0, 255); + c255: rgb(63.75, 0, 255); c256: #4400ff; - c257: #4800ff; - c258: #4d00ff; - c259: #5100ff; + c257: rgb(72.25, 0, 255); + c258: rgb(76.5, 0, 255); + c259: rgb(80.75, 0, 255); c260: #5500ff; - c261: #5900ff; - c262: #5e00ff; - c263: #6200ff; + c261: rgb(89.25, 0, 255); + c262: rgb(93.5, 0, 255); + c263: rgb(97.75, 0, 255); c264: #6600ff; - c265: #6a00ff; - c266: #6f00ff; - c267: #7300ff; + c265: rgb(106.25, 0, 255); + c266: rgb(110.5, 0, 255); + c267: rgb(114.75, 0, 255); c268: #7700ff; - c269: #7b00ff; - c270: #8000ff; - c271: #8400ff; + c269: rgb(123.25, 0, 255); + c270: rgb(127.5, 0, 255); + c271: rgb(131.75, 0, 255); c272: #8800ff; - c273: #8c00ff; - c274: #9100ff; - c275: #9500ff; + c273: rgb(140.25, 0, 255); + c274: rgb(144.5, 0, 255); + c275: rgb(148.75, 0, 255); c276: #9900ff; - c277: #9d00ff; - c278: #a200ff; - c279: #a600ff; + c277: rgb(157.25, 0, 255); + c278: rgb(161.5, 0, 255); + c279: rgb(165.75, 0, 255); c280: #aa00ff; - c281: #ae00ff; - c282: #b300ff; - c283: #b700ff; + c281: rgb(174.25, 0, 255); + c282: rgb(178.5, 0, 255); + c283: rgb(182.75, 0, 255); c284: #bb00ff; - c285: #bf00ff; - c286: #c400ff; - c287: #c800ff; + c285: rgb(191.25, 0, 255); + c286: rgb(195.5, 0, 255); + c287: rgb(199.75, 0, 255); c288: #cc00ff; - c289: #d000ff; - c290: #d500ff; - c291: #d900ff; + c289: rgb(208.25, 0, 255); + c290: rgb(212.5, 0, 255); + c291: rgb(216.75, 0, 255); c292: #dd00ff; - c293: #e100ff; - c294: #e600ff; - c295: #ea00ff; + c293: rgb(225.25, 0, 255); + c294: rgb(229.5, 0, 255); + c295: rgb(233.75, 0, 255); c296: #ee00ff; - c297: #f200ff; - c298: #f700ff; - c299: #fb00ff; + c297: rgb(242.25, 0, 255); + c298: rgb(246.5, 0, 255); + c299: rgb(250.75, 0, 255); c300: fuchsia; - c301: #ff00fb; - c302: #ff00f7; - c303: #ff00f2; + c301: rgb(255, 0, 250.75); + c302: rgb(255, 0, 246.5); + c303: rgb(255, 0, 242.25); c304: #ff00ee; - c305: #ff00ea; - c306: #ff00e6; - c307: #ff00e1; + c305: rgb(255, 0, 233.75); + c306: rgb(255, 0, 229.5); + c307: rgb(255, 0, 225.25); c308: #ff00dd; - c309: #ff00d9; - c310: #ff00d5; - c311: #ff00d0; + c309: rgb(255, 0, 216.75); + c310: rgb(255, 0, 212.5); + c311: rgb(255, 0, 208.25); c312: #ff00cc; - c313: #ff00c8; - c314: #ff00c4; - c315: #ff00bf; + c313: rgb(255, 0, 199.75); + c314: rgb(255, 0, 195.5); + c315: rgb(255, 0, 191.25); c316: #ff00bb; - c317: #ff00b7; - c318: #ff00b3; - c319: #ff00ae; + c317: rgb(255, 0, 182.75); + c318: rgb(255, 0, 178.5); + c319: rgb(255, 0, 174.25); c320: #ff00aa; - c321: #ff00a6; - c322: #ff00a2; - c323: #ff009d; + c321: rgb(255, 0, 165.75); + c322: rgb(255, 0, 161.5); + c323: rgb(255, 0, 157.25); c324: #ff0099; - c325: #ff0095; - c326: #ff0091; - c327: #ff008c; + c325: rgb(255, 0, 148.75); + c326: rgb(255, 0, 144.5); + c327: rgb(255, 0, 140.25); c328: #ff0088; - c329: #ff0084; - c330: #ff0080; - c331: #ff007b; + c329: rgb(255, 0, 131.75); + c330: rgb(255, 0, 127.5); + c331: rgb(255, 0, 123.25); c332: #ff0077; - c333: #ff0073; - c334: #ff006f; - c335: #ff006a; + c333: rgb(255, 0, 114.75); + c334: rgb(255, 0, 110.5); + c335: rgb(255, 0, 106.25); c336: #ff0066; - c337: #ff0062; - c338: #ff005e; - c339: #ff0059; + c337: rgb(255, 0, 97.75); + c338: rgb(255, 0, 93.5); + c339: rgb(255, 0, 89.25); c340: #ff0055; - c341: #ff0051; - c342: #ff004d; - c343: #ff0048; + c341: rgb(255, 0, 80.75); + c342: rgb(255, 0, 76.5); + c343: rgb(255, 0, 72.25); c344: #ff0044; - c345: #ff0040; - c346: #ff003c; - c347: #ff0037; + c345: rgb(255, 0, 63.75); + c346: rgb(255, 0, 59.5); + c347: rgb(255, 0, 55.25); c348: #ff0033; - c349: #ff002f; - c350: #ff002b; - c351: #ff0026; + c349: rgb(255, 0, 46.75); + c350: rgb(255, 0, 42.5); + c351: rgb(255, 0, 38.25); c352: #ff0022; - c353: #ff001e; - c354: #ff001a; - c355: #ff0015; + c353: rgb(255, 0, 29.75); + c354: rgb(255, 0, 25.5); + c355: rgb(255, 0, 21.25); c356: #ff0011; - c357: #ff000d; - c358: #ff0009; - c359: #ff0004; + c357: rgb(255, 0, 12.75); + c358: rgb(255, 0, 8.5); + c359: rgb(255, 0, 4.25); c360: red; } diff --git a/spec/libsass/color-functions/other/change-color/l.hrx b/spec/libsass/color-functions/other/change-color/l.hrx index 445bc6b558..59dbd1002e 100644 --- a/spec/libsass/color-functions/other/change-color/l.hrx +++ b/spec/libsass/color-functions/other/change-color/l.hrx @@ -105,6 +105,110 @@ foo { } <===> output.css +foo { + c0: black; + c1: rgb(5.1, 0, 0); + c2: rgb(10.2, 0, 0); + c3: rgb(15.3, 0, 0); + c4: rgb(20.4, 0, 0); + c5: rgb(25.5, 0, 0); + c6: rgb(30.6, 0, 0); + c7: rgb(35.7, 0, 0); + c8: rgb(40.8, 0, 0); + c9: rgb(45.9, 0, 0); + c10: #330000; + c11: rgb(56.1, 0, 0); + c12: rgb(61.2, 0, 0); + c13: rgb(66.3, 0, 0); + c14: rgb(71.4, 0, 0); + c15: rgb(76.5, 0, 0); + c16: rgb(81.6, 0, 0); + c17: rgb(86.7, 0, 0); + c18: rgb(91.8, 0, 0); + c19: rgb(96.9, 0, 0); + c20: #660000; + c21: rgb(107.1, 0, 0); + c22: rgb(112.2, 0, 0); + c23: rgb(117.3, 0, 0); + c24: rgb(122.4, 0, 0); + c25: rgb(127.5, 0, 0); + c26: rgb(132.6, 0, 0); + c27: rgb(137.7, 0, 0); + c28: rgb(142.8, 0, 0); + c29: rgb(147.9, 0, 0); + c30: #990000; + c31: rgb(158.1, 0, 0); + c32: rgb(163.2, 0, 0); + c33: rgb(168.3, 0, 0); + c34: rgb(173.4, 0, 0); + c35: rgb(178.5, 0, 0); + c36: rgb(183.6, 0, 0); + c37: rgb(188.7, 0, 0); + c38: rgb(193.8, 0, 0); + c39: rgb(198.9, 0, 0); + c40: #cc0000; + c41: rgb(209.1, 0, 0); + c42: rgb(214.2, 0, 0); + c43: rgb(219.3, 0, 0); + c44: rgb(224.4, 0, 0); + c45: rgb(229.5, 0, 0); + c46: rgb(234.6, 0, 0); + c47: rgb(239.7, 0, 0); + c48: rgb(244.8, 0, 0); + c49: rgb(249.9, 0, 0); + c50: red; + c51: rgb(255, 5.1, 5.1); + c52: rgb(255, 10.2, 10.2); + c53: rgb(255, 15.3, 15.3); + c54: rgb(255, 20.4, 20.4); + c55: rgb(255, 25.5, 25.5); + c56: rgb(255, 30.6, 30.6); + c57: rgb(255, 35.7, 35.7); + c58: rgb(255, 40.8, 40.8); + c59: rgb(255, 45.9, 45.9); + c60: #ff3333; + c61: rgb(255, 56.1, 56.1); + c62: rgb(255, 61.2, 61.2); + c63: rgb(255, 66.3, 66.3); + c64: rgb(255, 71.4, 71.4); + c65: rgb(255, 76.5, 76.5); + c66: rgb(255, 81.6, 81.6); + c67: rgb(255, 86.7, 86.7); + c68: rgb(255, 91.8, 91.8); + c69: rgb(255, 96.9, 96.9); + c70: #ff6666; + c71: rgb(255, 107.1, 107.1); + c72: rgb(255, 112.2, 112.2); + c73: rgb(255, 117.3, 117.3); + c74: rgb(255, 122.4, 122.4); + c75: rgb(255, 127.5, 127.5); + c76: rgb(255, 132.6, 132.6); + c77: rgb(255, 137.7, 137.7); + c78: rgb(255, 142.8, 142.8); + c79: rgb(255, 147.9, 147.9); + c80: #ff9999; + c81: rgb(255, 158.1, 158.1); + c82: rgb(255, 163.2, 163.2); + c83: rgb(255, 168.3, 168.3); + c84: rgb(255, 173.4, 173.4); + c85: rgb(255, 178.5, 178.5); + c86: rgb(255, 183.6, 183.6); + c87: rgb(255, 188.7, 188.7); + c88: rgb(255, 193.8, 193.8); + c89: rgb(255, 198.9, 198.9); + c90: #ffcccc; + c91: rgb(255, 209.1, 209.1); + c92: rgb(255, 214.2, 214.2); + c93: rgb(255, 219.3, 219.3); + c94: rgb(255, 224.4, 224.4); + c95: rgb(255, 229.5, 229.5); + c96: rgb(255, 234.6, 234.6); + c97: rgb(255, 239.7, 239.7); + c98: rgb(255, 244.8, 244.8); + c99: rgb(255, 249.9, 249.9); +} + +<===> output-libsass.css foo { c0: black; c1: #050000; diff --git a/spec/libsass/color-functions/other/change-color/s.hrx b/spec/libsass/color-functions/other/change-color/s.hrx index 6be178c555..18671b71a7 100644 --- a/spec/libsass/color-functions/other/change-color/s.hrx +++ b/spec/libsass/color-functions/other/change-color/s.hrx @@ -106,6 +106,111 @@ foo { } <===> output.css +foo { + c0: rgb(127.5, 127.5, 127.5); + c1: rgb(128.775, 126.225, 126.225); + c2: rgb(130.05, 124.95, 124.95); + c3: rgb(131.325, 123.675, 123.675); + c4: rgb(132.6, 122.4, 122.4); + c5: rgb(133.875, 121.125, 121.125); + c6: rgb(135.15, 119.85, 119.85); + c7: rgb(136.425, 118.575, 118.575); + c8: rgb(137.7, 117.3, 117.3); + c9: rgb(138.975, 116.025, 116.025); + c10: rgb(140.25, 114.75, 114.75); + c11: rgb(141.525, 113.475, 113.475); + c12: rgb(142.8, 112.2, 112.2); + c13: rgb(144.075, 110.925, 110.925); + c14: rgb(145.35, 109.65, 109.65); + c15: rgb(146.625, 108.375, 108.375); + c16: rgb(147.9, 107.1, 107.1); + c17: rgb(149.175, 105.825, 105.825); + c18: rgb(150.45, 104.55, 104.55); + c19: rgb(151.725, 103.275, 103.275); + c20: #996666; + c21: rgb(154.275, 100.725, 100.725); + c22: rgb(155.55, 99.45, 99.45); + c23: rgb(156.825, 98.175, 98.175); + c24: rgb(158.1, 96.9, 96.9); + c25: rgb(159.375, 95.625, 95.625); + c26: rgb(160.65, 94.35, 94.35); + c27: rgb(161.925, 93.075, 93.075); + c28: rgb(163.2, 91.8, 91.8); + c29: rgb(164.475, 90.525, 90.525); + c30: rgb(165.75, 89.25, 89.25); + c31: rgb(167.025, 87.975, 87.975); + c32: rgb(168.3, 86.7, 86.7); + c33: rgb(169.575, 85.425, 85.425); + c34: rgb(170.85, 84.15, 84.15); + c35: rgb(172.125, 82.875, 82.875); + c36: rgb(173.4, 81.6, 81.6); + c37: rgb(174.675, 80.325, 80.325); + c38: rgb(175.95, 79.05, 79.05); + c39: rgb(177.225, 77.775, 77.775); + c40: rgb(178.5, 76.5, 76.5); + c41: rgb(179.775, 75.225, 75.225); + c42: rgb(181.05, 73.95, 73.95); + c43: rgb(182.325, 72.675, 72.675); + c44: rgb(183.6, 71.4, 71.4); + c45: rgb(184.875, 70.125, 70.125); + c46: rgb(186.15, 68.85, 68.85); + c47: rgb(187.425, 67.575, 67.575); + c48: rgb(188.7, 66.3, 66.3); + c49: rgb(189.975, 65.025, 65.025); + c50: rgb(191.25, 63.75, 63.75); + c51: rgb(192.525, 62.475, 62.475); + c52: rgb(193.8, 61.2, 61.2); + c53: rgb(195.075, 59.925, 59.925); + c54: rgb(196.35, 58.65, 58.65); + c55: rgb(197.625, 57.375, 57.375); + c56: rgb(198.9, 56.1, 56.1); + c57: rgb(200.175, 54.825, 54.825); + c58: rgb(201.45, 53.55, 53.55); + c59: rgb(202.725, 52.275, 52.275); + c60: #cc3333; + c61: rgb(205.275, 49.725, 49.725); + c62: rgb(206.55, 48.45, 48.45); + c63: rgb(207.825, 47.175, 47.175); + c64: rgb(209.1, 45.9, 45.9); + c65: rgb(210.375, 44.625, 44.625); + c66: rgb(211.65, 43.35, 43.35); + c67: rgb(212.925, 42.075, 42.075); + c68: rgb(214.2, 40.8, 40.8); + c69: rgb(215.475, 39.525, 39.525); + c70: rgb(216.75, 38.25, 38.25); + c71: rgb(218.025, 36.975, 36.975); + c72: rgb(219.3, 35.7, 35.7); + c73: rgb(220.575, 34.425, 34.425); + c74: rgb(221.85, 33.15, 33.15); + c75: rgb(223.125, 31.875, 31.875); + c76: rgb(224.4, 30.6, 30.6); + c77: rgb(225.675, 29.325, 29.325); + c78: rgb(226.95, 28.05, 28.05); + c79: rgb(228.225, 26.775, 26.775); + c80: rgb(229.5, 25.5, 25.5); + c81: rgb(230.775, 24.225, 24.225); + c82: rgb(232.05, 22.95, 22.95); + c83: rgb(233.325, 21.675, 21.675); + c84: rgb(234.6, 20.4, 20.4); + c85: rgb(235.875, 19.125, 19.125); + c86: rgb(237.15, 17.85, 17.85); + c87: rgb(238.425, 16.575, 16.575); + c88: rgb(239.7, 15.3, 15.3); + c89: rgb(240.975, 14.025, 14.025); + c90: rgb(242.25, 12.75, 12.75); + c91: rgb(243.525, 11.475, 11.475); + c92: rgb(244.8, 10.2, 10.2); + c93: rgb(246.075, 8.925, 8.925); + c94: rgb(247.35, 7.65, 7.65); + c95: rgb(248.625, 6.375, 6.375); + c96: rgb(249.9, 5.1, 5.1); + c97: rgb(251.175, 3.825, 3.825); + c98: rgb(252.45, 2.55, 2.55); + c99: rgb(253.725, 1.275, 1.275); + c100: red; +} + +<===> output-libsass.css foo { c0: gray; c1: #817e7e; diff --git a/spec/libsass/color-functions/rgb/rgb/b.hrx b/spec/libsass/color-functions/rgb/rgb/b.hrx index d35334d1a5..bb1eb123a1 100644 --- a/spec/libsass/color-functions/rgb/rgb/b.hrx +++ b/spec/libsass/color-functions/rgb/rgb/b.hrx @@ -368,7 +368,7 @@ foo { <===> output.css foo { - c-1: rgb(0, 0, 0); + c-1: rgb(0, 0, -1); c0: rgb(0, 0, 0); c1: rgb(0, 0, 1); c2: rgb(0, 0, 2); @@ -625,113 +625,113 @@ foo { c253: rgb(0, 0, 253); c254: rgb(0, 0, 254); c255: rgb(0, 0, 255); - c256: rgb(0, 0, 255); + c256: rgb(0, 0, 256); } foo { - c-1: rgb(0, 0, 0); + c-1: rgb(0, 0, -2.55); c0: rgb(0, 0, 0); - c1: rgb(0, 0, 3); - c2: rgb(0, 0, 5); - c3: rgb(0, 0, 8); - c4: rgb(0, 0, 10); - c5: rgb(0, 0, 13); - c6: rgb(0, 0, 15); - c7: rgb(0, 0, 18); - c8: rgb(0, 0, 20); - c9: rgb(0, 0, 23); - c10: rgb(0, 0, 26); - c11: rgb(0, 0, 28); - c12: rgb(0, 0, 31); - c13: rgb(0, 0, 33); - c14: rgb(0, 0, 36); - c15: rgb(0, 0, 38); - c16: rgb(0, 0, 41); - c17: rgb(0, 0, 43); - c18: rgb(0, 0, 46); - c19: rgb(0, 0, 48); + c1: rgb(0, 0, 2.55); + c2: rgb(0, 0, 5.1); + c3: rgb(0, 0, 7.65); + c4: rgb(0, 0, 10.2); + c5: rgb(0, 0, 12.75); + c6: rgb(0, 0, 15.3); + c7: rgb(0, 0, 17.85); + c8: rgb(0, 0, 20.4); + c9: rgb(0, 0, 22.95); + c10: rgb(0, 0, 25.5); + c11: rgb(0, 0, 28.05); + c12: rgb(0, 0, 30.6); + c13: rgb(0, 0, 33.15); + c14: rgb(0, 0, 35.7); + c15: rgb(0, 0, 38.25); + c16: rgb(0, 0, 40.8); + c17: rgb(0, 0, 43.35); + c18: rgb(0, 0, 45.9); + c19: rgb(0, 0, 48.45); c20: rgb(0, 0, 51); - c21: rgb(0, 0, 54); - c22: rgb(0, 0, 56); - c23: rgb(0, 0, 59); - c24: rgb(0, 0, 61); - c25: rgb(0, 0, 64); - c26: rgb(0, 0, 66); - c27: rgb(0, 0, 69); - c28: rgb(0, 0, 71); - c29: rgb(0, 0, 74); - c30: rgb(0, 0, 77); - c31: rgb(0, 0, 79); - c32: rgb(0, 0, 82); - c33: rgb(0, 0, 84); - c34: rgb(0, 0, 87); - c35: rgb(0, 0, 89); - c36: rgb(0, 0, 92); - c37: rgb(0, 0, 94); - c38: rgb(0, 0, 97); - c39: rgb(0, 0, 99); + c21: rgb(0, 0, 53.55); + c22: rgb(0, 0, 56.1); + c23: rgb(0, 0, 58.65); + c24: rgb(0, 0, 61.2); + c25: rgb(0, 0, 63.75); + c26: rgb(0, 0, 66.3); + c27: rgb(0, 0, 68.85); + c28: rgb(0, 0, 71.4); + c29: rgb(0, 0, 73.95); + c30: rgb(0, 0, 76.5); + c31: rgb(0, 0, 79.05); + c32: rgb(0, 0, 81.6); + c33: rgb(0, 0, 84.15); + c34: rgb(0, 0, 86.7); + c35: rgb(0, 0, 89.25); + c36: rgb(0, 0, 91.8); + c37: rgb(0, 0, 94.35); + c38: rgb(0, 0, 96.9); + c39: rgb(0, 0, 99.45); c40: rgb(0, 0, 102); - c41: rgb(0, 0, 105); - c42: rgb(0, 0, 107); - c43: rgb(0, 0, 110); - c44: rgb(0, 0, 112); - c45: rgb(0, 0, 115); - c46: rgb(0, 0, 117); - c47: rgb(0, 0, 120); - c48: rgb(0, 0, 122); - c49: rgb(0, 0, 125); - c50: rgb(0, 0, 128); - c51: rgb(0, 0, 130); - c52: rgb(0, 0, 133); - c53: rgb(0, 0, 135); - c54: rgb(0, 0, 138); - c55: rgb(0, 0, 140); - c56: rgb(0, 0, 143); - c57: rgb(0, 0, 145); - c58: rgb(0, 0, 148); - c59: rgb(0, 0, 150); + c41: rgb(0, 0, 104.55); + c42: rgb(0, 0, 107.1); + c43: rgb(0, 0, 109.65); + c44: rgb(0, 0, 112.2); + c45: rgb(0, 0, 114.75); + c46: rgb(0, 0, 117.3); + c47: rgb(0, 0, 119.85); + c48: rgb(0, 0, 122.4); + c49: rgb(0, 0, 124.95); + c50: rgb(0, 0, 127.5); + c51: rgb(0, 0, 130.05); + c52: rgb(0, 0, 132.6); + c53: rgb(0, 0, 135.15); + c54: rgb(0, 0, 137.7); + c55: rgb(0, 0, 140.25); + c56: rgb(0, 0, 142.8); + c57: rgb(0, 0, 145.35); + c58: rgb(0, 0, 147.9); + c59: rgb(0, 0, 150.45); c60: rgb(0, 0, 153); - c61: rgb(0, 0, 156); - c62: rgb(0, 0, 158); - c63: rgb(0, 0, 161); - c64: rgb(0, 0, 163); - c65: rgb(0, 0, 166); - c66: rgb(0, 0, 168); - c67: rgb(0, 0, 171); - c68: rgb(0, 0, 173); - c69: rgb(0, 0, 176); - c70: rgb(0, 0, 179); - c71: rgb(0, 0, 181); - c72: rgb(0, 0, 184); - c73: rgb(0, 0, 186); - c74: rgb(0, 0, 189); - c75: rgb(0, 0, 191); - c76: rgb(0, 0, 194); - c77: rgb(0, 0, 196); - c78: rgb(0, 0, 199); - c79: rgb(0, 0, 201); + c61: rgb(0, 0, 155.55); + c62: rgb(0, 0, 158.1); + c63: rgb(0, 0, 160.65); + c64: rgb(0, 0, 163.2); + c65: rgb(0, 0, 165.75); + c66: rgb(0, 0, 168.3); + c67: rgb(0, 0, 170.85); + c68: rgb(0, 0, 173.4); + c69: rgb(0, 0, 175.95); + c70: rgb(0, 0, 178.5); + c71: rgb(0, 0, 181.05); + c72: rgb(0, 0, 183.6); + c73: rgb(0, 0, 186.15); + c74: rgb(0, 0, 188.7); + c75: rgb(0, 0, 191.25); + c76: rgb(0, 0, 193.8); + c77: rgb(0, 0, 196.35); + c78: rgb(0, 0, 198.9); + c79: rgb(0, 0, 201.45); c80: rgb(0, 0, 204); - c81: rgb(0, 0, 207); - c82: rgb(0, 0, 209); - c83: rgb(0, 0, 212); - c84: rgb(0, 0, 214); - c85: rgb(0, 0, 217); - c86: rgb(0, 0, 219); - c87: rgb(0, 0, 222); - c88: rgb(0, 0, 224); - c89: rgb(0, 0, 227); - c90: rgb(0, 0, 230); - c91: rgb(0, 0, 232); - c92: rgb(0, 0, 235); - c93: rgb(0, 0, 237); - c94: rgb(0, 0, 240); - c95: rgb(0, 0, 242); - c96: rgb(0, 0, 245); - c97: rgb(0, 0, 247); - c98: rgb(0, 0, 250); - c99: rgb(0, 0, 252); + c81: rgb(0, 0, 206.55); + c82: rgb(0, 0, 209.1); + c83: rgb(0, 0, 211.65); + c84: rgb(0, 0, 214.2); + c85: rgb(0, 0, 216.75); + c86: rgb(0, 0, 219.3); + c87: rgb(0, 0, 221.85); + c88: rgb(0, 0, 224.4); + c89: rgb(0, 0, 226.95); + c90: rgb(0, 0, 229.5); + c91: rgb(0, 0, 232.05); + c92: rgb(0, 0, 234.6); + c93: rgb(0, 0, 237.15); + c94: rgb(0, 0, 239.7); + c95: rgb(0, 0, 242.25); + c96: rgb(0, 0, 244.8); + c97: rgb(0, 0, 247.35); + c98: rgb(0, 0, 249.9); + c99: rgb(0, 0, 252.45); c100: rgb(0, 0, 255); - c101: rgb(0, 0, 255); + c101: rgb(0, 0, 257.55); } <===> output-libsass.css diff --git a/spec/libsass/color-functions/rgb/rgb/g.hrx b/spec/libsass/color-functions/rgb/rgb/g.hrx index 57311e601f..9b53794a42 100644 --- a/spec/libsass/color-functions/rgb/rgb/g.hrx +++ b/spec/libsass/color-functions/rgb/rgb/g.hrx @@ -368,7 +368,7 @@ foo { <===> output.css foo { - c-1: rgb(0, 0, 0); + c-1: rgb(0, -1, 0); c0: rgb(0, 0, 0); c1: rgb(0, 1, 0); c2: rgb(0, 2, 0); @@ -625,113 +625,113 @@ foo { c253: rgb(0, 253, 0); c254: rgb(0, 254, 0); c255: rgb(0, 255, 0); - c256: rgb(0, 255, 0); + c256: rgb(0, 256, 0); } foo { - c-1: rgb(0, 0, 0); + c-1: rgb(0, -2.55, 0); c0: rgb(0, 0, 0); - c1: rgb(0, 3, 0); - c2: rgb(0, 5, 0); - c3: rgb(0, 8, 0); - c4: rgb(0, 10, 0); - c5: rgb(0, 13, 0); - c6: rgb(0, 15, 0); - c7: rgb(0, 18, 0); - c8: rgb(0, 20, 0); - c9: rgb(0, 23, 0); - c10: rgb(0, 26, 0); - c11: rgb(0, 28, 0); - c12: rgb(0, 31, 0); - c13: rgb(0, 33, 0); - c14: rgb(0, 36, 0); - c15: rgb(0, 38, 0); - c16: rgb(0, 41, 0); - c17: rgb(0, 43, 0); - c18: rgb(0, 46, 0); - c19: rgb(0, 48, 0); + c1: rgb(0, 2.55, 0); + c2: rgb(0, 5.1, 0); + c3: rgb(0, 7.65, 0); + c4: rgb(0, 10.2, 0); + c5: rgb(0, 12.75, 0); + c6: rgb(0, 15.3, 0); + c7: rgb(0, 17.85, 0); + c8: rgb(0, 20.4, 0); + c9: rgb(0, 22.95, 0); + c10: rgb(0, 25.5, 0); + c11: rgb(0, 28.05, 0); + c12: rgb(0, 30.6, 0); + c13: rgb(0, 33.15, 0); + c14: rgb(0, 35.7, 0); + c15: rgb(0, 38.25, 0); + c16: rgb(0, 40.8, 0); + c17: rgb(0, 43.35, 0); + c18: rgb(0, 45.9, 0); + c19: rgb(0, 48.45, 0); c20: rgb(0, 51, 0); - c21: rgb(0, 54, 0); - c22: rgb(0, 56, 0); - c23: rgb(0, 59, 0); - c24: rgb(0, 61, 0); - c25: rgb(0, 64, 0); - c26: rgb(0, 66, 0); - c27: rgb(0, 69, 0); - c28: rgb(0, 71, 0); - c29: rgb(0, 74, 0); - c30: rgb(0, 77, 0); - c31: rgb(0, 79, 0); - c32: rgb(0, 82, 0); - c33: rgb(0, 84, 0); - c34: rgb(0, 87, 0); - c35: rgb(0, 89, 0); - c36: rgb(0, 92, 0); - c37: rgb(0, 94, 0); - c38: rgb(0, 97, 0); - c39: rgb(0, 99, 0); + c21: rgb(0, 53.55, 0); + c22: rgb(0, 56.1, 0); + c23: rgb(0, 58.65, 0); + c24: rgb(0, 61.2, 0); + c25: rgb(0, 63.75, 0); + c26: rgb(0, 66.3, 0); + c27: rgb(0, 68.85, 0); + c28: rgb(0, 71.4, 0); + c29: rgb(0, 73.95, 0); + c30: rgb(0, 76.5, 0); + c31: rgb(0, 79.05, 0); + c32: rgb(0, 81.6, 0); + c33: rgb(0, 84.15, 0); + c34: rgb(0, 86.7, 0); + c35: rgb(0, 89.25, 0); + c36: rgb(0, 91.8, 0); + c37: rgb(0, 94.35, 0); + c38: rgb(0, 96.9, 0); + c39: rgb(0, 99.45, 0); c40: rgb(0, 102, 0); - c41: rgb(0, 105, 0); - c42: rgb(0, 107, 0); - c43: rgb(0, 110, 0); - c44: rgb(0, 112, 0); - c45: rgb(0, 115, 0); - c46: rgb(0, 117, 0); - c47: rgb(0, 120, 0); - c48: rgb(0, 122, 0); - c49: rgb(0, 125, 0); - c50: rgb(0, 128, 0); - c51: rgb(0, 130, 0); - c52: rgb(0, 133, 0); - c53: rgb(0, 135, 0); - c54: rgb(0, 138, 0); - c55: rgb(0, 140, 0); - c56: rgb(0, 143, 0); - c57: rgb(0, 145, 0); - c58: rgb(0, 148, 0); - c59: rgb(0, 150, 0); + c41: rgb(0, 104.55, 0); + c42: rgb(0, 107.1, 0); + c43: rgb(0, 109.65, 0); + c44: rgb(0, 112.2, 0); + c45: rgb(0, 114.75, 0); + c46: rgb(0, 117.3, 0); + c47: rgb(0, 119.85, 0); + c48: rgb(0, 122.4, 0); + c49: rgb(0, 124.95, 0); + c50: rgb(0, 127.5, 0); + c51: rgb(0, 130.05, 0); + c52: rgb(0, 132.6, 0); + c53: rgb(0, 135.15, 0); + c54: rgb(0, 137.7, 0); + c55: rgb(0, 140.25, 0); + c56: rgb(0, 142.8, 0); + c57: rgb(0, 145.35, 0); + c58: rgb(0, 147.9, 0); + c59: rgb(0, 150.45, 0); c60: rgb(0, 153, 0); - c61: rgb(0, 156, 0); - c62: rgb(0, 158, 0); - c63: rgb(0, 161, 0); - c64: rgb(0, 163, 0); - c65: rgb(0, 166, 0); - c66: rgb(0, 168, 0); - c67: rgb(0, 171, 0); - c68: rgb(0, 173, 0); - c69: rgb(0, 176, 0); - c70: rgb(0, 179, 0); - c71: rgb(0, 181, 0); - c72: rgb(0, 184, 0); - c73: rgb(0, 186, 0); - c74: rgb(0, 189, 0); - c75: rgb(0, 191, 0); - c76: rgb(0, 194, 0); - c77: rgb(0, 196, 0); - c78: rgb(0, 199, 0); - c79: rgb(0, 201, 0); + c61: rgb(0, 155.55, 0); + c62: rgb(0, 158.1, 0); + c63: rgb(0, 160.65, 0); + c64: rgb(0, 163.2, 0); + c65: rgb(0, 165.75, 0); + c66: rgb(0, 168.3, 0); + c67: rgb(0, 170.85, 0); + c68: rgb(0, 173.4, 0); + c69: rgb(0, 175.95, 0); + c70: rgb(0, 178.5, 0); + c71: rgb(0, 181.05, 0); + c72: rgb(0, 183.6, 0); + c73: rgb(0, 186.15, 0); + c74: rgb(0, 188.7, 0); + c75: rgb(0, 191.25, 0); + c76: rgb(0, 193.8, 0); + c77: rgb(0, 196.35, 0); + c78: rgb(0, 198.9, 0); + c79: rgb(0, 201.45, 0); c80: rgb(0, 204, 0); - c81: rgb(0, 207, 0); - c82: rgb(0, 209, 0); - c83: rgb(0, 212, 0); - c84: rgb(0, 214, 0); - c85: rgb(0, 217, 0); - c86: rgb(0, 219, 0); - c87: rgb(0, 222, 0); - c88: rgb(0, 224, 0); - c89: rgb(0, 227, 0); - c90: rgb(0, 230, 0); - c91: rgb(0, 232, 0); - c92: rgb(0, 235, 0); - c93: rgb(0, 237, 0); - c94: rgb(0, 240, 0); - c95: rgb(0, 242, 0); - c96: rgb(0, 245, 0); - c97: rgb(0, 247, 0); - c98: rgb(0, 250, 0); - c99: rgb(0, 252, 0); + c81: rgb(0, 206.55, 0); + c82: rgb(0, 209.1, 0); + c83: rgb(0, 211.65, 0); + c84: rgb(0, 214.2, 0); + c85: rgb(0, 216.75, 0); + c86: rgb(0, 219.3, 0); + c87: rgb(0, 221.85, 0); + c88: rgb(0, 224.4, 0); + c89: rgb(0, 226.95, 0); + c90: rgb(0, 229.5, 0); + c91: rgb(0, 232.05, 0); + c92: rgb(0, 234.6, 0); + c93: rgb(0, 237.15, 0); + c94: rgb(0, 239.7, 0); + c95: rgb(0, 242.25, 0); + c96: rgb(0, 244.8, 0); + c97: rgb(0, 247.35, 0); + c98: rgb(0, 249.9, 0); + c99: rgb(0, 252.45, 0); c100: rgb(0, 255, 0); - c101: rgb(0, 255, 0); + c101: rgb(0, 257.55, 0); } <===> output-libsass.css diff --git a/spec/libsass/color-functions/rgb/rgb/r.hrx b/spec/libsass/color-functions/rgb/rgb/r.hrx index 230a34bba6..6a5212d66e 100644 --- a/spec/libsass/color-functions/rgb/rgb/r.hrx +++ b/spec/libsass/color-functions/rgb/rgb/r.hrx @@ -368,7 +368,7 @@ foo { <===> output.css foo { - c-1: rgb(0, 0, 0); + c-1: rgb(0, -1, 0); c0: rgb(0, 0, 0); c1: rgb(0, 1, 0); c2: rgb(0, 2, 0); @@ -625,113 +625,113 @@ foo { c253: rgb(0, 253, 0); c254: rgb(0, 254, 0); c255: rgb(0, 255, 0); - c256: rgb(0, 255, 0); + c256: rgb(0, 256, 0); } foo { - c-1: rgb(0, 0, 0); + c-1: rgb(-2.55, 0, 0); c0: rgb(0, 0, 0); - c1: rgb(3, 0, 0); - c2: rgb(5, 0, 0); - c3: rgb(8, 0, 0); - c4: rgb(10, 0, 0); - c5: rgb(13, 0, 0); - c6: rgb(15, 0, 0); - c7: rgb(18, 0, 0); - c8: rgb(20, 0, 0); - c9: rgb(23, 0, 0); - c10: rgb(26, 0, 0); - c11: rgb(28, 0, 0); - c12: rgb(31, 0, 0); - c13: rgb(33, 0, 0); - c14: rgb(36, 0, 0); - c15: rgb(38, 0, 0); - c16: rgb(41, 0, 0); - c17: rgb(43, 0, 0); - c18: rgb(46, 0, 0); - c19: rgb(48, 0, 0); + c1: rgb(2.55, 0, 0); + c2: rgb(5.1, 0, 0); + c3: rgb(7.65, 0, 0); + c4: rgb(10.2, 0, 0); + c5: rgb(12.75, 0, 0); + c6: rgb(15.3, 0, 0); + c7: rgb(17.85, 0, 0); + c8: rgb(20.4, 0, 0); + c9: rgb(22.95, 0, 0); + c10: rgb(25.5, 0, 0); + c11: rgb(28.05, 0, 0); + c12: rgb(30.6, 0, 0); + c13: rgb(33.15, 0, 0); + c14: rgb(35.7, 0, 0); + c15: rgb(38.25, 0, 0); + c16: rgb(40.8, 0, 0); + c17: rgb(43.35, 0, 0); + c18: rgb(45.9, 0, 0); + c19: rgb(48.45, 0, 0); c20: rgb(51, 0, 0); - c21: rgb(54, 0, 0); - c22: rgb(56, 0, 0); - c23: rgb(59, 0, 0); - c24: rgb(61, 0, 0); - c25: rgb(64, 0, 0); - c26: rgb(66, 0, 0); - c27: rgb(69, 0, 0); - c28: rgb(71, 0, 0); - c29: rgb(74, 0, 0); - c30: rgb(77, 0, 0); - c31: rgb(79, 0, 0); - c32: rgb(82, 0, 0); - c33: rgb(84, 0, 0); - c34: rgb(87, 0, 0); - c35: rgb(89, 0, 0); - c36: rgb(92, 0, 0); - c37: rgb(94, 0, 0); - c38: rgb(97, 0, 0); - c39: rgb(99, 0, 0); + c21: rgb(53.55, 0, 0); + c22: rgb(56.1, 0, 0); + c23: rgb(58.65, 0, 0); + c24: rgb(61.2, 0, 0); + c25: rgb(63.75, 0, 0); + c26: rgb(66.3, 0, 0); + c27: rgb(68.85, 0, 0); + c28: rgb(71.4, 0, 0); + c29: rgb(73.95, 0, 0); + c30: rgb(76.5, 0, 0); + c31: rgb(79.05, 0, 0); + c32: rgb(81.6, 0, 0); + c33: rgb(84.15, 0, 0); + c34: rgb(86.7, 0, 0); + c35: rgb(89.25, 0, 0); + c36: rgb(91.8, 0, 0); + c37: rgb(94.35, 0, 0); + c38: rgb(96.9, 0, 0); + c39: rgb(99.45, 0, 0); c40: rgb(102, 0, 0); - c41: rgb(105, 0, 0); - c42: rgb(107, 0, 0); - c43: rgb(110, 0, 0); - c44: rgb(112, 0, 0); - c45: rgb(115, 0, 0); - c46: rgb(117, 0, 0); - c47: rgb(120, 0, 0); - c48: rgb(122, 0, 0); - c49: rgb(125, 0, 0); - c50: rgb(128, 0, 0); - c51: rgb(130, 0, 0); - c52: rgb(133, 0, 0); - c53: rgb(135, 0, 0); - c54: rgb(138, 0, 0); - c55: rgb(140, 0, 0); - c56: rgb(143, 0, 0); - c57: rgb(145, 0, 0); - c58: rgb(148, 0, 0); - c59: rgb(150, 0, 0); + c41: rgb(104.55, 0, 0); + c42: rgb(107.1, 0, 0); + c43: rgb(109.65, 0, 0); + c44: rgb(112.2, 0, 0); + c45: rgb(114.75, 0, 0); + c46: rgb(117.3, 0, 0); + c47: rgb(119.85, 0, 0); + c48: rgb(122.4, 0, 0); + c49: rgb(124.95, 0, 0); + c50: rgb(127.5, 0, 0); + c51: rgb(130.05, 0, 0); + c52: rgb(132.6, 0, 0); + c53: rgb(135.15, 0, 0); + c54: rgb(137.7, 0, 0); + c55: rgb(140.25, 0, 0); + c56: rgb(142.8, 0, 0); + c57: rgb(145.35, 0, 0); + c58: rgb(147.9, 0, 0); + c59: rgb(150.45, 0, 0); c60: rgb(153, 0, 0); - c61: rgb(156, 0, 0); - c62: rgb(158, 0, 0); - c63: rgb(161, 0, 0); - c64: rgb(163, 0, 0); - c65: rgb(166, 0, 0); - c66: rgb(168, 0, 0); - c67: rgb(171, 0, 0); - c68: rgb(173, 0, 0); - c69: rgb(176, 0, 0); - c70: rgb(179, 0, 0); - c71: rgb(181, 0, 0); - c72: rgb(184, 0, 0); - c73: rgb(186, 0, 0); - c74: rgb(189, 0, 0); - c75: rgb(191, 0, 0); - c76: rgb(194, 0, 0); - c77: rgb(196, 0, 0); - c78: rgb(199, 0, 0); - c79: rgb(201, 0, 0); + c61: rgb(155.55, 0, 0); + c62: rgb(158.1, 0, 0); + c63: rgb(160.65, 0, 0); + c64: rgb(163.2, 0, 0); + c65: rgb(165.75, 0, 0); + c66: rgb(168.3, 0, 0); + c67: rgb(170.85, 0, 0); + c68: rgb(173.4, 0, 0); + c69: rgb(175.95, 0, 0); + c70: rgb(178.5, 0, 0); + c71: rgb(181.05, 0, 0); + c72: rgb(183.6, 0, 0); + c73: rgb(186.15, 0, 0); + c74: rgb(188.7, 0, 0); + c75: rgb(191.25, 0, 0); + c76: rgb(193.8, 0, 0); + c77: rgb(196.35, 0, 0); + c78: rgb(198.9, 0, 0); + c79: rgb(201.45, 0, 0); c80: rgb(204, 0, 0); - c81: rgb(207, 0, 0); - c82: rgb(209, 0, 0); - c83: rgb(212, 0, 0); - c84: rgb(214, 0, 0); - c85: rgb(217, 0, 0); - c86: rgb(219, 0, 0); - c87: rgb(222, 0, 0); - c88: rgb(224, 0, 0); - c89: rgb(227, 0, 0); - c90: rgb(230, 0, 0); - c91: rgb(232, 0, 0); - c92: rgb(235, 0, 0); - c93: rgb(237, 0, 0); - c94: rgb(240, 0, 0); - c95: rgb(242, 0, 0); - c96: rgb(245, 0, 0); - c97: rgb(247, 0, 0); - c98: rgb(250, 0, 0); - c99: rgb(252, 0, 0); + c81: rgb(206.55, 0, 0); + c82: rgb(209.1, 0, 0); + c83: rgb(211.65, 0, 0); + c84: rgb(214.2, 0, 0); + c85: rgb(216.75, 0, 0); + c86: rgb(219.3, 0, 0); + c87: rgb(221.85, 0, 0); + c88: rgb(224.4, 0, 0); + c89: rgb(226.95, 0, 0); + c90: rgb(229.5, 0, 0); + c91: rgb(232.05, 0, 0); + c92: rgb(234.6, 0, 0); + c93: rgb(237.15, 0, 0); + c94: rgb(239.7, 0, 0); + c95: rgb(242.25, 0, 0); + c96: rgb(244.8, 0, 0); + c97: rgb(247.35, 0, 0); + c98: rgb(249.9, 0, 0); + c99: rgb(252.45, 0, 0); c100: rgb(255, 0, 0); - c101: rgb(255, 0, 0); + c101: rgb(257.55, 0, 0); } <===> output-libsass.css diff --git a/spec/libsass/color-functions/rgb/rgba/b.hrx b/spec/libsass/color-functions/rgb/rgba/b.hrx index 2f1273b139..f816c99213 100644 --- a/spec/libsass/color-functions/rgb/rgba/b.hrx +++ b/spec/libsass/color-functions/rgb/rgba/b.hrx @@ -368,7 +368,7 @@ foo { <===> output.css foo { - c-1: rgb(0, 0, 0); + c-1: rgb(0, 0, -1); c0: rgb(0, 0, 0); c1: rgb(0, 0, 1); c2: rgb(0, 0, 2); @@ -625,113 +625,113 @@ foo { c253: rgb(0, 0, 253); c254: rgb(0, 0, 254); c255: rgb(0, 0, 255); - c256: rgb(0, 0, 255); + c256: rgb(0, 0, 256); } foo { - c-1: rgb(0, 0, 0); + c-1: rgb(0, 0, -2.55); c0: rgb(0, 0, 0); - c1: rgb(0, 0, 3); - c2: rgb(0, 0, 5); - c3: rgb(0, 0, 8); - c4: rgb(0, 0, 10); - c5: rgb(0, 0, 13); - c6: rgb(0, 0, 15); - c7: rgb(0, 0, 18); - c8: rgb(0, 0, 20); - c9: rgb(0, 0, 23); - c10: rgb(0, 0, 26); - c11: rgb(0, 0, 28); - c12: rgb(0, 0, 31); - c13: rgb(0, 0, 33); - c14: rgb(0, 0, 36); - c15: rgb(0, 0, 38); - c16: rgb(0, 0, 41); - c17: rgb(0, 0, 43); - c18: rgb(0, 0, 46); - c19: rgb(0, 0, 48); + c1: rgb(0, 0, 2.55); + c2: rgb(0, 0, 5.1); + c3: rgb(0, 0, 7.65); + c4: rgb(0, 0, 10.2); + c5: rgb(0, 0, 12.75); + c6: rgb(0, 0, 15.3); + c7: rgb(0, 0, 17.85); + c8: rgb(0, 0, 20.4); + c9: rgb(0, 0, 22.95); + c10: rgb(0, 0, 25.5); + c11: rgb(0, 0, 28.05); + c12: rgb(0, 0, 30.6); + c13: rgb(0, 0, 33.15); + c14: rgb(0, 0, 35.7); + c15: rgb(0, 0, 38.25); + c16: rgb(0, 0, 40.8); + c17: rgb(0, 0, 43.35); + c18: rgb(0, 0, 45.9); + c19: rgb(0, 0, 48.45); c20: rgb(0, 0, 51); - c21: rgb(0, 0, 54); - c22: rgb(0, 0, 56); - c23: rgb(0, 0, 59); - c24: rgb(0, 0, 61); - c25: rgb(0, 0, 64); - c26: rgb(0, 0, 66); - c27: rgb(0, 0, 69); - c28: rgb(0, 0, 71); - c29: rgb(0, 0, 74); - c30: rgb(0, 0, 77); - c31: rgb(0, 0, 79); - c32: rgb(0, 0, 82); - c33: rgb(0, 0, 84); - c34: rgb(0, 0, 87); - c35: rgb(0, 0, 89); - c36: rgb(0, 0, 92); - c37: rgb(0, 0, 94); - c38: rgb(0, 0, 97); - c39: rgb(0, 0, 99); + c21: rgb(0, 0, 53.55); + c22: rgb(0, 0, 56.1); + c23: rgb(0, 0, 58.65); + c24: rgb(0, 0, 61.2); + c25: rgb(0, 0, 63.75); + c26: rgb(0, 0, 66.3); + c27: rgb(0, 0, 68.85); + c28: rgb(0, 0, 71.4); + c29: rgb(0, 0, 73.95); + c30: rgb(0, 0, 76.5); + c31: rgb(0, 0, 79.05); + c32: rgb(0, 0, 81.6); + c33: rgb(0, 0, 84.15); + c34: rgb(0, 0, 86.7); + c35: rgb(0, 0, 89.25); + c36: rgb(0, 0, 91.8); + c37: rgb(0, 0, 94.35); + c38: rgb(0, 0, 96.9); + c39: rgb(0, 0, 99.45); c40: rgb(0, 0, 102); - c41: rgb(0, 0, 105); - c42: rgb(0, 0, 107); - c43: rgb(0, 0, 110); - c44: rgb(0, 0, 112); - c45: rgb(0, 0, 115); - c46: rgb(0, 0, 117); - c47: rgb(0, 0, 120); - c48: rgb(0, 0, 122); - c49: rgb(0, 0, 125); - c50: rgb(0, 0, 128); - c51: rgb(0, 0, 130); - c52: rgb(0, 0, 133); - c53: rgb(0, 0, 135); - c54: rgb(0, 0, 138); - c55: rgb(0, 0, 140); - c56: rgb(0, 0, 143); - c57: rgb(0, 0, 145); - c58: rgb(0, 0, 148); - c59: rgb(0, 0, 150); + c41: rgb(0, 0, 104.55); + c42: rgb(0, 0, 107.1); + c43: rgb(0, 0, 109.65); + c44: rgb(0, 0, 112.2); + c45: rgb(0, 0, 114.75); + c46: rgb(0, 0, 117.3); + c47: rgb(0, 0, 119.85); + c48: rgb(0, 0, 122.4); + c49: rgb(0, 0, 124.95); + c50: rgb(0, 0, 127.5); + c51: rgb(0, 0, 130.05); + c52: rgb(0, 0, 132.6); + c53: rgb(0, 0, 135.15); + c54: rgb(0, 0, 137.7); + c55: rgb(0, 0, 140.25); + c56: rgb(0, 0, 142.8); + c57: rgb(0, 0, 145.35); + c58: rgb(0, 0, 147.9); + c59: rgb(0, 0, 150.45); c60: rgb(0, 0, 153); - c61: rgb(0, 0, 156); - c62: rgb(0, 0, 158); - c63: rgb(0, 0, 161); - c64: rgb(0, 0, 163); - c65: rgb(0, 0, 166); - c66: rgb(0, 0, 168); - c67: rgb(0, 0, 171); - c68: rgb(0, 0, 173); - c69: rgb(0, 0, 176); - c70: rgb(0, 0, 179); - c71: rgb(0, 0, 181); - c72: rgb(0, 0, 184); - c73: rgb(0, 0, 186); - c74: rgb(0, 0, 189); - c75: rgb(0, 0, 191); - c76: rgb(0, 0, 194); - c77: rgb(0, 0, 196); - c78: rgb(0, 0, 199); - c79: rgb(0, 0, 201); + c61: rgb(0, 0, 155.55); + c62: rgb(0, 0, 158.1); + c63: rgb(0, 0, 160.65); + c64: rgb(0, 0, 163.2); + c65: rgb(0, 0, 165.75); + c66: rgb(0, 0, 168.3); + c67: rgb(0, 0, 170.85); + c68: rgb(0, 0, 173.4); + c69: rgb(0, 0, 175.95); + c70: rgb(0, 0, 178.5); + c71: rgb(0, 0, 181.05); + c72: rgb(0, 0, 183.6); + c73: rgb(0, 0, 186.15); + c74: rgb(0, 0, 188.7); + c75: rgb(0, 0, 191.25); + c76: rgb(0, 0, 193.8); + c77: rgb(0, 0, 196.35); + c78: rgb(0, 0, 198.9); + c79: rgb(0, 0, 201.45); c80: rgb(0, 0, 204); - c81: rgb(0, 0, 207); - c82: rgb(0, 0, 209); - c83: rgb(0, 0, 212); - c84: rgb(0, 0, 214); - c85: rgb(0, 0, 217); - c86: rgb(0, 0, 219); - c87: rgb(0, 0, 222); - c88: rgb(0, 0, 224); - c89: rgb(0, 0, 227); - c90: rgb(0, 0, 230); - c91: rgb(0, 0, 232); - c92: rgb(0, 0, 235); - c93: rgb(0, 0, 237); - c94: rgb(0, 0, 240); - c95: rgb(0, 0, 242); - c96: rgb(0, 0, 245); - c97: rgb(0, 0, 247); - c98: rgb(0, 0, 250); - c99: rgb(0, 0, 252); + c81: rgb(0, 0, 206.55); + c82: rgb(0, 0, 209.1); + c83: rgb(0, 0, 211.65); + c84: rgb(0, 0, 214.2); + c85: rgb(0, 0, 216.75); + c86: rgb(0, 0, 219.3); + c87: rgb(0, 0, 221.85); + c88: rgb(0, 0, 224.4); + c89: rgb(0, 0, 226.95); + c90: rgb(0, 0, 229.5); + c91: rgb(0, 0, 232.05); + c92: rgb(0, 0, 234.6); + c93: rgb(0, 0, 237.15); + c94: rgb(0, 0, 239.7); + c95: rgb(0, 0, 242.25); + c96: rgb(0, 0, 244.8); + c97: rgb(0, 0, 247.35); + c98: rgb(0, 0, 249.9); + c99: rgb(0, 0, 252.45); c100: rgb(0, 0, 255); - c101: rgb(0, 0, 255); + c101: rgb(0, 0, 257.55); } <===> output-libsass.css diff --git a/spec/libsass/color-functions/rgb/rgba/g.hrx b/spec/libsass/color-functions/rgb/rgba/g.hrx index 274c0389dc..16d61c5d17 100644 --- a/spec/libsass/color-functions/rgb/rgba/g.hrx +++ b/spec/libsass/color-functions/rgb/rgba/g.hrx @@ -368,7 +368,7 @@ foo { <===> output.css foo { - c-1: rgb(0, 0, 0); + c-1: rgb(0, -1, 0); c0: rgb(0, 0, 0); c1: rgb(0, 1, 0); c2: rgb(0, 2, 0); @@ -625,113 +625,113 @@ foo { c253: rgb(0, 253, 0); c254: rgb(0, 254, 0); c255: rgb(0, 255, 0); - c256: rgb(0, 255, 0); + c256: rgb(0, 256, 0); } foo { - c-1: rgb(0, 0, 0); + c-1: rgb(0, -2.55, 0); c0: rgb(0, 0, 0); - c1: rgb(0, 3, 0); - c2: rgb(0, 5, 0); - c3: rgb(0, 8, 0); - c4: rgb(0, 10, 0); - c5: rgb(0, 13, 0); - c6: rgb(0, 15, 0); - c7: rgb(0, 18, 0); - c8: rgb(0, 20, 0); - c9: rgb(0, 23, 0); - c10: rgb(0, 26, 0); - c11: rgb(0, 28, 0); - c12: rgb(0, 31, 0); - c13: rgb(0, 33, 0); - c14: rgb(0, 36, 0); - c15: rgb(0, 38, 0); - c16: rgb(0, 41, 0); - c17: rgb(0, 43, 0); - c18: rgb(0, 46, 0); - c19: rgb(0, 48, 0); + c1: rgb(0, 2.55, 0); + c2: rgb(0, 5.1, 0); + c3: rgb(0, 7.65, 0); + c4: rgb(0, 10.2, 0); + c5: rgb(0, 12.75, 0); + c6: rgb(0, 15.3, 0); + c7: rgb(0, 17.85, 0); + c8: rgb(0, 20.4, 0); + c9: rgb(0, 22.95, 0); + c10: rgb(0, 25.5, 0); + c11: rgb(0, 28.05, 0); + c12: rgb(0, 30.6, 0); + c13: rgb(0, 33.15, 0); + c14: rgb(0, 35.7, 0); + c15: rgb(0, 38.25, 0); + c16: rgb(0, 40.8, 0); + c17: rgb(0, 43.35, 0); + c18: rgb(0, 45.9, 0); + c19: rgb(0, 48.45, 0); c20: rgb(0, 51, 0); - c21: rgb(0, 54, 0); - c22: rgb(0, 56, 0); - c23: rgb(0, 59, 0); - c24: rgb(0, 61, 0); - c25: rgb(0, 64, 0); - c26: rgb(0, 66, 0); - c27: rgb(0, 69, 0); - c28: rgb(0, 71, 0); - c29: rgb(0, 74, 0); - c30: rgb(0, 77, 0); - c31: rgb(0, 79, 0); - c32: rgb(0, 82, 0); - c33: rgb(0, 84, 0); - c34: rgb(0, 87, 0); - c35: rgb(0, 89, 0); - c36: rgb(0, 92, 0); - c37: rgb(0, 94, 0); - c38: rgb(0, 97, 0); - c39: rgb(0, 99, 0); + c21: rgb(0, 53.55, 0); + c22: rgb(0, 56.1, 0); + c23: rgb(0, 58.65, 0); + c24: rgb(0, 61.2, 0); + c25: rgb(0, 63.75, 0); + c26: rgb(0, 66.3, 0); + c27: rgb(0, 68.85, 0); + c28: rgb(0, 71.4, 0); + c29: rgb(0, 73.95, 0); + c30: rgb(0, 76.5, 0); + c31: rgb(0, 79.05, 0); + c32: rgb(0, 81.6, 0); + c33: rgb(0, 84.15, 0); + c34: rgb(0, 86.7, 0); + c35: rgb(0, 89.25, 0); + c36: rgb(0, 91.8, 0); + c37: rgb(0, 94.35, 0); + c38: rgb(0, 96.9, 0); + c39: rgb(0, 99.45, 0); c40: rgb(0, 102, 0); - c41: rgb(0, 105, 0); - c42: rgb(0, 107, 0); - c43: rgb(0, 110, 0); - c44: rgb(0, 112, 0); - c45: rgb(0, 115, 0); - c46: rgb(0, 117, 0); - c47: rgb(0, 120, 0); - c48: rgb(0, 122, 0); - c49: rgb(0, 125, 0); - c50: rgb(0, 128, 0); - c51: rgb(0, 130, 0); - c52: rgb(0, 133, 0); - c53: rgb(0, 135, 0); - c54: rgb(0, 138, 0); - c55: rgb(0, 140, 0); - c56: rgb(0, 143, 0); - c57: rgb(0, 145, 0); - c58: rgb(0, 148, 0); - c59: rgb(0, 150, 0); + c41: rgb(0, 104.55, 0); + c42: rgb(0, 107.1, 0); + c43: rgb(0, 109.65, 0); + c44: rgb(0, 112.2, 0); + c45: rgb(0, 114.75, 0); + c46: rgb(0, 117.3, 0); + c47: rgb(0, 119.85, 0); + c48: rgb(0, 122.4, 0); + c49: rgb(0, 124.95, 0); + c50: rgb(0, 127.5, 0); + c51: rgb(0, 130.05, 0); + c52: rgb(0, 132.6, 0); + c53: rgb(0, 135.15, 0); + c54: rgb(0, 137.7, 0); + c55: rgb(0, 140.25, 0); + c56: rgb(0, 142.8, 0); + c57: rgb(0, 145.35, 0); + c58: rgb(0, 147.9, 0); + c59: rgb(0, 150.45, 0); c60: rgb(0, 153, 0); - c61: rgb(0, 156, 0); - c62: rgb(0, 158, 0); - c63: rgb(0, 161, 0); - c64: rgb(0, 163, 0); - c65: rgb(0, 166, 0); - c66: rgb(0, 168, 0); - c67: rgb(0, 171, 0); - c68: rgb(0, 173, 0); - c69: rgb(0, 176, 0); - c70: rgb(0, 179, 0); - c71: rgb(0, 181, 0); - c72: rgb(0, 184, 0); - c73: rgb(0, 186, 0); - c74: rgb(0, 189, 0); - c75: rgb(0, 191, 0); - c76: rgb(0, 194, 0); - c77: rgb(0, 196, 0); - c78: rgb(0, 199, 0); - c79: rgb(0, 201, 0); + c61: rgb(0, 155.55, 0); + c62: rgb(0, 158.1, 0); + c63: rgb(0, 160.65, 0); + c64: rgb(0, 163.2, 0); + c65: rgb(0, 165.75, 0); + c66: rgb(0, 168.3, 0); + c67: rgb(0, 170.85, 0); + c68: rgb(0, 173.4, 0); + c69: rgb(0, 175.95, 0); + c70: rgb(0, 178.5, 0); + c71: rgb(0, 181.05, 0); + c72: rgb(0, 183.6, 0); + c73: rgb(0, 186.15, 0); + c74: rgb(0, 188.7, 0); + c75: rgb(0, 191.25, 0); + c76: rgb(0, 193.8, 0); + c77: rgb(0, 196.35, 0); + c78: rgb(0, 198.9, 0); + c79: rgb(0, 201.45, 0); c80: rgb(0, 204, 0); - c81: rgb(0, 207, 0); - c82: rgb(0, 209, 0); - c83: rgb(0, 212, 0); - c84: rgb(0, 214, 0); - c85: rgb(0, 217, 0); - c86: rgb(0, 219, 0); - c87: rgb(0, 222, 0); - c88: rgb(0, 224, 0); - c89: rgb(0, 227, 0); - c90: rgb(0, 230, 0); - c91: rgb(0, 232, 0); - c92: rgb(0, 235, 0); - c93: rgb(0, 237, 0); - c94: rgb(0, 240, 0); - c95: rgb(0, 242, 0); - c96: rgb(0, 245, 0); - c97: rgb(0, 247, 0); - c98: rgb(0, 250, 0); - c99: rgb(0, 252, 0); + c81: rgb(0, 206.55, 0); + c82: rgb(0, 209.1, 0); + c83: rgb(0, 211.65, 0); + c84: rgb(0, 214.2, 0); + c85: rgb(0, 216.75, 0); + c86: rgb(0, 219.3, 0); + c87: rgb(0, 221.85, 0); + c88: rgb(0, 224.4, 0); + c89: rgb(0, 226.95, 0); + c90: rgb(0, 229.5, 0); + c91: rgb(0, 232.05, 0); + c92: rgb(0, 234.6, 0); + c93: rgb(0, 237.15, 0); + c94: rgb(0, 239.7, 0); + c95: rgb(0, 242.25, 0); + c96: rgb(0, 244.8, 0); + c97: rgb(0, 247.35, 0); + c98: rgb(0, 249.9, 0); + c99: rgb(0, 252.45, 0); c100: rgb(0, 255, 0); - c101: rgb(0, 255, 0); + c101: rgb(0, 257.55, 0); } <===> output-libsass.css diff --git a/spec/libsass/color-functions/rgb/rgba/r.hrx b/spec/libsass/color-functions/rgb/rgba/r.hrx index f4a78f87da..2d2220b590 100644 --- a/spec/libsass/color-functions/rgb/rgba/r.hrx +++ b/spec/libsass/color-functions/rgb/rgba/r.hrx @@ -368,7 +368,7 @@ foo { <===> output.css foo { - c-1: rgb(0, 0, 0); + c-1: rgb(0, -1, 0); c0: rgb(0, 0, 0); c1: rgb(0, 1, 0); c2: rgb(0, 2, 0); @@ -625,113 +625,113 @@ foo { c253: rgb(0, 253, 0); c254: rgb(0, 254, 0); c255: rgb(0, 255, 0); - c256: rgb(0, 255, 0); + c256: rgb(0, 256, 0); } foo { - c-1: rgb(0, 0, 0); + c-1: rgb(-2.55, 0, 0); c0: rgb(0, 0, 0); - c1: rgb(3, 0, 0); - c2: rgb(5, 0, 0); - c3: rgb(8, 0, 0); - c4: rgb(10, 0, 0); - c5: rgb(13, 0, 0); - c6: rgb(15, 0, 0); - c7: rgb(18, 0, 0); - c8: rgb(20, 0, 0); - c9: rgb(23, 0, 0); - c10: rgb(26, 0, 0); - c11: rgb(28, 0, 0); - c12: rgb(31, 0, 0); - c13: rgb(33, 0, 0); - c14: rgb(36, 0, 0); - c15: rgb(38, 0, 0); - c16: rgb(41, 0, 0); - c17: rgb(43, 0, 0); - c18: rgb(46, 0, 0); - c19: rgb(48, 0, 0); + c1: rgb(2.55, 0, 0); + c2: rgb(5.1, 0, 0); + c3: rgb(7.65, 0, 0); + c4: rgb(10.2, 0, 0); + c5: rgb(12.75, 0, 0); + c6: rgb(15.3, 0, 0); + c7: rgb(17.85, 0, 0); + c8: rgb(20.4, 0, 0); + c9: rgb(22.95, 0, 0); + c10: rgb(25.5, 0, 0); + c11: rgb(28.05, 0, 0); + c12: rgb(30.6, 0, 0); + c13: rgb(33.15, 0, 0); + c14: rgb(35.7, 0, 0); + c15: rgb(38.25, 0, 0); + c16: rgb(40.8, 0, 0); + c17: rgb(43.35, 0, 0); + c18: rgb(45.9, 0, 0); + c19: rgb(48.45, 0, 0); c20: rgb(51, 0, 0); - c21: rgb(54, 0, 0); - c22: rgb(56, 0, 0); - c23: rgb(59, 0, 0); - c24: rgb(61, 0, 0); - c25: rgb(64, 0, 0); - c26: rgb(66, 0, 0); - c27: rgb(69, 0, 0); - c28: rgb(71, 0, 0); - c29: rgb(74, 0, 0); - c30: rgb(77, 0, 0); - c31: rgb(79, 0, 0); - c32: rgb(82, 0, 0); - c33: rgb(84, 0, 0); - c34: rgb(87, 0, 0); - c35: rgb(89, 0, 0); - c36: rgb(92, 0, 0); - c37: rgb(94, 0, 0); - c38: rgb(97, 0, 0); - c39: rgb(99, 0, 0); + c21: rgb(53.55, 0, 0); + c22: rgb(56.1, 0, 0); + c23: rgb(58.65, 0, 0); + c24: rgb(61.2, 0, 0); + c25: rgb(63.75, 0, 0); + c26: rgb(66.3, 0, 0); + c27: rgb(68.85, 0, 0); + c28: rgb(71.4, 0, 0); + c29: rgb(73.95, 0, 0); + c30: rgb(76.5, 0, 0); + c31: rgb(79.05, 0, 0); + c32: rgb(81.6, 0, 0); + c33: rgb(84.15, 0, 0); + c34: rgb(86.7, 0, 0); + c35: rgb(89.25, 0, 0); + c36: rgb(91.8, 0, 0); + c37: rgb(94.35, 0, 0); + c38: rgb(96.9, 0, 0); + c39: rgb(99.45, 0, 0); c40: rgb(102, 0, 0); - c41: rgb(105, 0, 0); - c42: rgb(107, 0, 0); - c43: rgb(110, 0, 0); - c44: rgb(112, 0, 0); - c45: rgb(115, 0, 0); - c46: rgb(117, 0, 0); - c47: rgb(120, 0, 0); - c48: rgb(122, 0, 0); - c49: rgb(125, 0, 0); - c50: rgb(128, 0, 0); - c51: rgb(130, 0, 0); - c52: rgb(133, 0, 0); - c53: rgb(135, 0, 0); - c54: rgb(138, 0, 0); - c55: rgb(140, 0, 0); - c56: rgb(143, 0, 0); - c57: rgb(145, 0, 0); - c58: rgb(148, 0, 0); - c59: rgb(150, 0, 0); + c41: rgb(104.55, 0, 0); + c42: rgb(107.1, 0, 0); + c43: rgb(109.65, 0, 0); + c44: rgb(112.2, 0, 0); + c45: rgb(114.75, 0, 0); + c46: rgb(117.3, 0, 0); + c47: rgb(119.85, 0, 0); + c48: rgb(122.4, 0, 0); + c49: rgb(124.95, 0, 0); + c50: rgb(127.5, 0, 0); + c51: rgb(130.05, 0, 0); + c52: rgb(132.6, 0, 0); + c53: rgb(135.15, 0, 0); + c54: rgb(137.7, 0, 0); + c55: rgb(140.25, 0, 0); + c56: rgb(142.8, 0, 0); + c57: rgb(145.35, 0, 0); + c58: rgb(147.9, 0, 0); + c59: rgb(150.45, 0, 0); c60: rgb(153, 0, 0); - c61: rgb(156, 0, 0); - c62: rgb(158, 0, 0); - c63: rgb(161, 0, 0); - c64: rgb(163, 0, 0); - c65: rgb(166, 0, 0); - c66: rgb(168, 0, 0); - c67: rgb(171, 0, 0); - c68: rgb(173, 0, 0); - c69: rgb(176, 0, 0); - c70: rgb(179, 0, 0); - c71: rgb(181, 0, 0); - c72: rgb(184, 0, 0); - c73: rgb(186, 0, 0); - c74: rgb(189, 0, 0); - c75: rgb(191, 0, 0); - c76: rgb(194, 0, 0); - c77: rgb(196, 0, 0); - c78: rgb(199, 0, 0); - c79: rgb(201, 0, 0); + c61: rgb(155.55, 0, 0); + c62: rgb(158.1, 0, 0); + c63: rgb(160.65, 0, 0); + c64: rgb(163.2, 0, 0); + c65: rgb(165.75, 0, 0); + c66: rgb(168.3, 0, 0); + c67: rgb(170.85, 0, 0); + c68: rgb(173.4, 0, 0); + c69: rgb(175.95, 0, 0); + c70: rgb(178.5, 0, 0); + c71: rgb(181.05, 0, 0); + c72: rgb(183.6, 0, 0); + c73: rgb(186.15, 0, 0); + c74: rgb(188.7, 0, 0); + c75: rgb(191.25, 0, 0); + c76: rgb(193.8, 0, 0); + c77: rgb(196.35, 0, 0); + c78: rgb(198.9, 0, 0); + c79: rgb(201.45, 0, 0); c80: rgb(204, 0, 0); - c81: rgb(207, 0, 0); - c82: rgb(209, 0, 0); - c83: rgb(212, 0, 0); - c84: rgb(214, 0, 0); - c85: rgb(217, 0, 0); - c86: rgb(219, 0, 0); - c87: rgb(222, 0, 0); - c88: rgb(224, 0, 0); - c89: rgb(227, 0, 0); - c90: rgb(230, 0, 0); - c91: rgb(232, 0, 0); - c92: rgb(235, 0, 0); - c93: rgb(237, 0, 0); - c94: rgb(240, 0, 0); - c95: rgb(242, 0, 0); - c96: rgb(245, 0, 0); - c97: rgb(247, 0, 0); - c98: rgb(250, 0, 0); - c99: rgb(252, 0, 0); + c81: rgb(206.55, 0, 0); + c82: rgb(209.1, 0, 0); + c83: rgb(211.65, 0, 0); + c84: rgb(214.2, 0, 0); + c85: rgb(216.75, 0, 0); + c86: rgb(219.3, 0, 0); + c87: rgb(221.85, 0, 0); + c88: rgb(224.4, 0, 0); + c89: rgb(226.95, 0, 0); + c90: rgb(229.5, 0, 0); + c91: rgb(232.05, 0, 0); + c92: rgb(234.6, 0, 0); + c93: rgb(237.15, 0, 0); + c94: rgb(239.7, 0, 0); + c95: rgb(242.25, 0, 0); + c96: rgb(244.8, 0, 0); + c97: rgb(247.35, 0, 0); + c98: rgb(249.9, 0, 0); + c99: rgb(252.45, 0, 0); c100: rgb(255, 0, 0); - c101: rgb(255, 0, 0); + c101: rgb(257.55, 0, 0); } <===> output-libsass.css diff --git a/spec/libsass/color-functions/saturate.hrx b/spec/libsass/color-functions/saturate.hrx index 167059777d..b64b142b85 100644 --- a/spec/libsass/color-functions/saturate.hrx +++ b/spec/libsass/color-functions/saturate.hrx @@ -104,6 +104,109 @@ foo { } <===> output.css +foo { + c0: hsl(100deg, 0%, 50%); + c1: hsl(100deg, 1%, 50%); + c2: hsl(100deg, 2%, 50%); + c3: hsl(100deg, 3%, 50%); + c4: hsl(100deg, 4%, 50%); + c5: hsl(100deg, 5%, 50%); + c6: hsl(100deg, 6%, 50%); + c7: hsl(100deg, 7%, 50%); + c8: hsl(100deg, 8%, 50%); + c9: hsl(100deg, 9%, 50%); + c10: hsl(100deg, 10%, 50%); + c11: hsl(100deg, 11%, 50%); + c12: hsl(100deg, 12%, 50%); + c13: hsl(100deg, 13%, 50%); + c14: hsl(100deg, 14%, 50%); + c15: hsl(100deg, 15%, 50%); + c16: hsl(100deg, 16%, 50%); + c17: hsl(100deg, 17%, 50%); + c18: hsl(100deg, 18%, 50%); + c19: hsl(100deg, 19%, 50%); + c20: hsl(100deg, 20%, 50%); + c21: hsl(100deg, 21%, 50%); + c22: hsl(100deg, 22%, 50%); + c23: hsl(100deg, 23%, 50%); + c24: hsl(100deg, 24%, 50%); + c25: hsl(100deg, 25%, 50%); + c26: hsl(100deg, 26%, 50%); + c27: hsl(100deg, 27%, 50%); + c28: hsl(100deg, 28%, 50%); + c29: hsl(100deg, 29%, 50%); + c30: hsl(100deg, 30%, 50%); + c31: hsl(100deg, 31%, 50%); + c32: hsl(100deg, 32%, 50%); + c33: hsl(100deg, 33%, 50%); + c34: hsl(100deg, 34%, 50%); + c35: hsl(100deg, 35%, 50%); + c36: hsl(100deg, 36%, 50%); + c37: hsl(100deg, 37%, 50%); + c38: hsl(100deg, 38%, 50%); + c39: hsl(100deg, 39%, 50%); + c41: hsl(100deg, 41%, 50%); + c42: hsl(100deg, 42%, 50%); + c43: hsl(100deg, 43%, 50%); + c44: hsl(100deg, 44%, 50%); + c45: hsl(100deg, 45%, 50%); + c46: hsl(100deg, 46%, 50%); + c47: hsl(100deg, 47%, 50%); + c48: hsl(100deg, 48%, 50%); + c49: hsl(100deg, 49%, 50%); + c50: hsl(100deg, 50%, 50%); + c51: hsl(100deg, 51%, 50%); + c52: hsl(100deg, 52%, 50%); + c53: hsl(100deg, 53%, 50%); + c54: hsl(100deg, 54%, 50%); + c55: hsl(100deg, 55%, 50%); + c56: hsl(100deg, 56%, 50%); + c57: hsl(100deg, 57%, 50%); + c58: hsl(100deg, 58%, 50%); + c59: hsl(100deg, 59%, 50%); + c60: hsl(100deg, 60%, 50%); + c61: hsl(100deg, 61%, 50%); + c62: hsl(100deg, 62%, 50%); + c63: hsl(100deg, 63%, 50%); + c64: hsl(100deg, 64%, 50%); + c65: hsl(100deg, 65%, 50%); + c66: hsl(100deg, 66%, 50%); + c67: hsl(100deg, 67%, 50%); + c68: hsl(100deg, 68%, 50%); + c69: hsl(100deg, 69%, 50%); + c70: hsl(100deg, 70%, 50%); + c71: hsl(100deg, 71%, 50%); + c72: hsl(100deg, 72%, 50%); + c73: hsl(100deg, 73%, 50%); + c74: hsl(100deg, 74%, 50%); + c75: hsl(100deg, 75%, 50%); + c76: hsl(100deg, 76%, 50%); + c77: hsl(100deg, 77%, 50%); + c78: hsl(100deg, 78%, 50%); + c79: hsl(100deg, 79%, 50%); + c81: hsl(100deg, 81%, 50%); + c82: hsl(100deg, 82%, 50%); + c83: hsl(100deg, 83%, 50%); + c84: hsl(100deg, 84%, 50%); + c85: hsl(100deg, 85%, 50%); + c86: hsl(100deg, 86%, 50%); + c87: hsl(100deg, 87%, 50%); + c88: hsl(100deg, 88%, 50%); + c89: hsl(100deg, 89%, 50%); + c90: hsl(100deg, 90%, 50%); + c91: hsl(100deg, 91%, 50%); + c92: hsl(100deg, 92%, 50%); + c93: hsl(100deg, 93%, 50%); + c94: hsl(100deg, 94%, 50%); + c95: hsl(100deg, 95%, 50%); + c96: hsl(100deg, 96%, 50%); + c97: hsl(100deg, 97%, 50%); + c98: hsl(100deg, 98%, 50%); + c99: hsl(100deg, 99%, 50%); + c100: hsl(100deg, 100%, 50%); +} + +<===> output-libsass.css foo { c0: gray; c1: #7f817e; diff --git a/spec/libsass/test.hrx b/spec/libsass/test.hrx index 3b53f01844..6d10939b86 100644 --- a/spec/libsass/test.hrx +++ b/spec/libsass/test.hrx @@ -109,7 +109,7 @@ span { g: #782005; h: hsl(25deg, 100%, 80%); h: rgba(204, 86, 0, 0.8); - h: rgba(204, 85, 0, 0.8); + h: hsla(25deg, 100%, 40%, 0.8); i: hsla(25deg, 100%, 40%, 0.8); foo: url("http://blah/flah/grah"); foo: url(http://foo/bar/buzz.css); diff --git a/spec/non_conformant/colors/basic.hrx b/spec/non_conformant/colors/basic.hrx index c0cd43abfa..7c2f22b9ba 100644 --- a/spec/non_conformant/colors/basic.hrx +++ b/spec/non_conformant/colors/basic.hrx @@ -14,7 +14,7 @@ p { color: red green blue; color: redhux; color: redgreen; - foo: rgb(200, 255, 255); + foo: rgb(200, 382.5, 433.5); } <===> output-libsass.css diff --git a/spec/non_conformant/colors/change-color.hrx b/spec/non_conformant/colors/change-color.hrx index ce7d4ec719..d327e98c80 100644 --- a/spec/non_conformant/colors/change-color.hrx +++ b/spec/non_conformant/colors/change-color.hrx @@ -6,6 +6,14 @@ p { color: change-color(hsl(25, 100%, 80%), $lightness: 40%, $alpha: 0.8); } <===> output.css +p { + color: #102005; + color: rgba(16, 32, 48, 0.325); + color: #782005; + color: hsla(25deg, 100%, 40%, 0.8); +} + +<===> output-libsass.css p { color: #102005; color: rgba(16, 32, 48, 0.325); diff --git a/spec/non_conformant/errors/fn-change-color-1.hrx b/spec/non_conformant/errors/fn-change-color-1.hrx index b634dacd26..223771f1c9 100644 --- a/spec/non_conformant/errors/fn-change-color-1.hrx +++ b/spec/non_conformant/errors/fn-change-color-1.hrx @@ -3,9 +3,9 @@ foo { test: change-color(red, $red: 0.5, $hue: 0.2); } <===> error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $hue: Color space rgb doesn't have a channel with this name. , -2 | test: change-color(red, $red: 0.5, $hue: 0.2); +2 | test: change-color(red, $red: 0.5, $hue: 0.2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 2:9 root stylesheet diff --git a/spec/values/calculation/calc/error/value.hrx b/spec/values/calculation/calc/error/value.hrx index 5eee0e63ba..a36a0b6aa0 100644 --- a/spec/values/calculation/calc/error/value.hrx +++ b/spec/values/calculation/calc/error/value.hrx @@ -60,7 +60,7 @@ $a: 1 2 3; b {c: calc($a)} <===> variable/list/error -Error: Value 1 2 3 can't be used in a calculation. +Error: Value (1 2 3) can't be used in a calculation. , 2 | b {c: calc($a)} | ^^ @@ -159,7 +159,7 @@ Error: Value get-function("get-function") can't be used in a calculation. b {c: calc(a())} <===> function/list/error -Error: Value 1 2 3 can't be used in a calculation. +Error: Value (1 2 3) can't be used in a calculation. , 2 | b {c: calc(a())} | ^^^ From a9d21df11cec3167ca61a8801e24e153e135fb2a Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Thu, 8 Dec 2022 13:18:32 -0800 Subject: [PATCH 2/9] Drop the non-nullability annotation from the Dart Sass wrapper It seems like we may not need this anymore, and it's breaking the Dart Dev CI. --- lib-js/compiler.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/lib-js/compiler.ts b/lib-js/compiler.ts index c03c8c22c4..a35a466a16 100644 --- a/lib-js/compiler.ts +++ b/lib-js/compiler.ts @@ -116,7 +116,6 @@ export class DartCompiler implements Compiler { throw new Error(`${repoPath} is not a valid Dart Sass repository`); } const dartFile = ` -// @dart=2.9 import "dart:convert"; import "dart:io"; From 801d43ba7f076cdc248b113b7bc9b8167c05b7c3 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Thu, 8 Dec 2022 13:25:31 -0800 Subject: [PATCH 3/9] Run language specs against Dart dev channel as well --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ec8be5099..0544798629 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,17 +59,21 @@ jobs: - run: npm run lint-spec dart_sass_language: - name: "Language | Dart Sass" + name: "Language | Dart Sass | Dart ${{ matrix.dart_channel }}" runs-on: ubuntu-latest if: "github.event_name != 'pull_request' || !contains(github.event.pull_request.body, 'skip dart-sass')" + strategy: + matrix: + dart_channel: [stable, dev] + steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: {node-version: "${{ env.NODE_VERSION }}"} - run: npm install - uses: dart-lang/setup-dart@v1 - with: {sdk: stable} + with: {sdk: "${{ matrix.dart_channel }}"} - name: Install dart-sass run: | From f7265276e53b0c5e6df0f800ed4b0ae61fbd0351 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Thu, 8 Dec 2022 13:51:48 -0800 Subject: [PATCH 4/9] Delete the Ruby spec runner (#1849) --- .github/workflows/ci.yml | 15 +- Gemfile | 15 - Gemfile.lock | 106 --- {lib-js => lib}/cli-args.ts | 0 {lib-js => lib}/compiler.ts | 0 {lib-js => lib}/interactor.ts | 0 {lib-js => lib}/lint-reporter.ts | 0 lib/sass_spec.rb | 18 - lib/sass_spec/annotate.rb | 6 - lib/sass_spec/annotate/cli.rb | 240 ----- lib/sass_spec/capture_with_timeout.rb | 110 --- lib/sass_spec/cli.rb | 121 --- lib/sass_spec/directory.rb | 273 ------ lib/sass_spec/engine_adapter.rb | 129 --- lib/sass_spec/interactor.rb | 88 -- lib/sass_spec/runner.rb | 108 --- lib/sass_spec/test.rb | 659 ------------- lib/sass_spec/test_case.rb | 196 ---- lib/sass_spec/test_case_metadata.rb | 128 --- lib/sass_spec/util.rb | 37 - lib/sass_spec/version.rb | 4 - {lib-js => lib}/spec-directory/cleanup.ts | 0 {lib-js => lib}/spec-directory/hrx.ts | 0 {lib-js => lib}/spec-directory/index.ts | 0 {lib-js => lib}/spec-directory/options.ts | 0 .../spec-directory/real-directory.ts | 0 .../spec-directory/spec-directory.ts | 0 {lib-js => lib}/spec-directory/spec-path.ts | 0 .../spec-directory/virtual-directory.ts | 0 {lib-js => lib}/tabulator.ts | 0 {lib-js => lib}/test-case/compare.ts | 0 {lib-js => lib}/test-case/expected.ts | 0 {lib-js => lib}/test-case/index.ts | 0 {lib-js => lib}/test-case/test-case.ts | 0 {lib-js => lib}/test-case/util.ts | 0 lint-spec.ts | 8 +- sass-spec.rb | 51 - sass-spec.ts | 10 +- test/cli-args.test.ts | 4 +- test/compiler.test.ts | 2 +- test/fixtures/mock-compiler.ts | 4 +- test/interactor/loop.test.ts | 6 +- test/interactor/options.test.ts | 4 +- test/spec-directory/cleanup.test.ts | 2 +- test/spec-directory/hrx.test.ts | 4 +- test/spec-directory/iteration.test.ts | 2 +- test/spec-directory/mutations.test.ts | 2 +- test/spec-directory/options.test.ts | 2 +- test/spot-check.test.ts | 2 +- test/test-case/actual.test.ts | 6 +- test/test-case/compare.test.ts | 2 +- test/test-case/expected.test.ts | 4 +- test/test-case/mutation.test.ts | 4 +- test/test-case/result.test.ts | 4 +- tests/cli_spec.rb | 38 - tests/directory_spec.rb | 900 ------------------ tests/fixtures/basic/basic.hrx | 9 - tests/fixtures/limit/basic.hrx | 51 - tests/fixtures/todo/basic.hrx | 29 - tests/sass_stub | 16 - tests/spec_helper.rb | 62 -- tests/test_case_metadata_spec.rb | 101 -- tsconfig.json | 2 +- 63 files changed, 39 insertions(+), 3545 deletions(-) delete mode 100644 Gemfile delete mode 100644 Gemfile.lock rename {lib-js => lib}/cli-args.ts (100%) rename {lib-js => lib}/compiler.ts (100%) rename {lib-js => lib}/interactor.ts (100%) rename {lib-js => lib}/lint-reporter.ts (100%) delete mode 100644 lib/sass_spec.rb delete mode 100644 lib/sass_spec/annotate.rb delete mode 100644 lib/sass_spec/annotate/cli.rb delete mode 100644 lib/sass_spec/capture_with_timeout.rb delete mode 100644 lib/sass_spec/cli.rb delete mode 100644 lib/sass_spec/directory.rb delete mode 100644 lib/sass_spec/engine_adapter.rb delete mode 100644 lib/sass_spec/interactor.rb delete mode 100644 lib/sass_spec/runner.rb delete mode 100644 lib/sass_spec/test.rb delete mode 100644 lib/sass_spec/test_case.rb delete mode 100644 lib/sass_spec/test_case_metadata.rb delete mode 100644 lib/sass_spec/util.rb delete mode 100644 lib/sass_spec/version.rb rename {lib-js => lib}/spec-directory/cleanup.ts (100%) rename {lib-js => lib}/spec-directory/hrx.ts (100%) rename {lib-js => lib}/spec-directory/index.ts (100%) rename {lib-js => lib}/spec-directory/options.ts (100%) rename {lib-js => lib}/spec-directory/real-directory.ts (100%) rename {lib-js => lib}/spec-directory/spec-directory.ts (100%) rename {lib-js => lib}/spec-directory/spec-path.ts (100%) rename {lib-js => lib}/spec-directory/virtual-directory.ts (100%) rename {lib-js => lib}/tabulator.ts (100%) rename {lib-js => lib}/test-case/compare.ts (100%) rename {lib-js => lib}/test-case/expected.ts (100%) rename {lib-js => lib}/test-case/index.ts (100%) rename {lib-js => lib}/test-case/test-case.ts (100%) rename {lib-js => lib}/test-case/util.ts (100%) delete mode 100755 sass-spec.rb delete mode 100644 tests/cli_spec.rb delete mode 100644 tests/directory_spec.rb delete mode 100644 tests/fixtures/basic/basic.hrx delete mode 100644 tests/fixtures/limit/basic.hrx delete mode 100644 tests/fixtures/todo/basic.hrx delete mode 100755 tests/sass_stub delete mode 100644 tests/spec_helper.rb delete mode 100644 tests/test_case_metadata_spec.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0544798629..fefe561fb0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,19 +12,8 @@ on: pull_request: jobs: - unit_tests_rb: - name: "Unit tests | Ruby" - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 - with: {bundler-cache: true} - - name: Run tests - run: bundle exec rspec tests/ - - unit_tests_ts: - name: "Unit tests | Typescript" + unit_tests: + name: "Unit tests" runs-on: ubuntu-latest steps: diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 13c6c6cbf0..0000000000 --- a/Gemfile +++ /dev/null @@ -1,15 +0,0 @@ -source 'https://rubygems.org' - -require 'pp' # https://github.com/fakefs/fakefs#fakefs-----typeerror-superclass-mismatch-for-class-file - -gem "minitest", "~> 5.8" -gem "command_line_reporter", '~> 3.0' -gem "ruby-terminfo", '~> 0.1.1' -gem "diffy", '~> 3.4' -gem "hrx", '~> 1.0' - -gem 'rspec' -gem 'aruba' -gem 'fakefs' - - diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index cbbd714862..0000000000 --- a/Gemfile.lock +++ /dev/null @@ -1,106 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - activesupport (7.0.3.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - aruba (1.0.1) - childprocess (~> 3.0) - contracts (~> 0.16.0) - cucumber (>= 2.4, < 5.0) - ffi (~> 1.9) - rspec-expectations (~> 3.4) - thor (~> 1.0) - builder (3.2.4) - childprocess (3.0.0) - colored (1.2) - command_line_reporter (3.3.6) - colored (>= 1.2) - concurrent-ruby (1.1.10) - contracts (0.16.0) - cucumber (4.1.0) - builder (~> 3.2, >= 3.2.3) - cucumber-core (~> 7.1, >= 7.1.0) - cucumber-create-meta (~> 1.0.0, >= 1.0.0) - cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) - cucumber-gherkin (~> 14.0, >= 14.0.1) - cucumber-html-formatter (~> 7.0, >= 7.0.0) - cucumber-messages (~> 12.2, >= 12.2.0) - cucumber-wire (~> 3.1, >= 3.1.0) - diff-lcs (~> 1.3, >= 1.3, < 1.4) - multi_test (~> 0.1, >= 0.1.2) - sys-uname (~> 1.0, >= 1.0.2) - cucumber-core (7.1.0) - cucumber-gherkin (~> 14.0, >= 14.0.1) - cucumber-messages (~> 12.2, >= 12.2.0) - cucumber-tag-expressions (~> 2.0, >= 2.0.4) - cucumber-create-meta (1.0.0) - cucumber-messages (~> 12.2, >= 12.2.0) - sys-uname (~> 1.2, >= 1.2.1) - cucumber-cucumber-expressions (10.3.0) - cucumber-gherkin (14.2.0) - cucumber-messages (~> 12.4, >= 12.4.0) - cucumber-html-formatter (7.2.0) - cucumber-messages (~> 12.4, >= 12.4.0) - cucumber-messages (12.4.0) - protobuf-cucumber (~> 3.10, >= 3.10.8) - cucumber-tag-expressions (2.0.4) - cucumber-wire (3.1.0) - cucumber-core (~> 7.1, >= 7.1.0) - cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) - cucumber-messages (~> 12.2, >= 12.2.0) - diff-lcs (1.3) - diffy (3.4.1) - fakefs (1.2.2) - ffi (1.15.5) - hrx (1.0.0) - linked-list (~> 0.0.13) - i18n (1.12.0) - concurrent-ruby (~> 1.0) - linked-list (0.0.13) - middleware (0.1.0) - minitest (5.11.3) - multi_test (0.1.2) - protobuf-cucumber (3.10.8) - activesupport (>= 3.2) - middleware - thor - thread_safe - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.2) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.6) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.3) - ruby-terminfo (0.1.1) - sys-uname (1.2.2) - ffi (~> 1.1) - thor (1.2.1) - thread_safe (0.3.6) - tzinfo (2.0.5) - concurrent-ruby (~> 1.0) - -PLATFORMS - ruby - -DEPENDENCIES - aruba - command_line_reporter (~> 3.0) - diffy (~> 3.4) - fakefs - hrx (~> 1.0) - minitest (~> 5.8) - rspec - ruby-terminfo (~> 0.1.1) - -BUNDLED WITH - 2.1.2 diff --git a/lib-js/cli-args.ts b/lib/cli-args.ts similarity index 100% rename from lib-js/cli-args.ts rename to lib/cli-args.ts diff --git a/lib-js/compiler.ts b/lib/compiler.ts similarity index 100% rename from lib-js/compiler.ts rename to lib/compiler.ts diff --git a/lib-js/interactor.ts b/lib/interactor.ts similarity index 100% rename from lib-js/interactor.ts rename to lib/interactor.ts diff --git a/lib-js/lint-reporter.ts b/lib/lint-reporter.ts similarity index 100% rename from lib-js/lint-reporter.ts rename to lib/lint-reporter.ts diff --git a/lib/sass_spec.rb b/lib/sass_spec.rb deleted file mode 100644 index 92b579cccb..0000000000 --- a/lib/sass_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'rubygems/version' - -module SassSpec - SPEC_DIR = File.expand_path('../../spec', __FILE__) - LANGUAGE_VERSIONS = %w( - 3.5 - 3.6 - 3.7 - 3.8 - 4.0 - ) - MIN_LANGUAGE_VERSION = Gem::Version.new(LANGUAGE_VERSIONS.first) - MAX_LANGUAGE_VERSION = Gem::Version.new(LANGUAGE_VERSIONS.last) -end - -require_relative 'sass_spec/test_case_metadata' -require_relative 'sass_spec/cli' -require_relative 'sass_spec/runner' diff --git a/lib/sass_spec/annotate.rb b/lib/sass_spec/annotate.rb deleted file mode 100644 index 69dbe471aa..0000000000 --- a/lib/sass_spec/annotate.rb +++ /dev/null @@ -1,6 +0,0 @@ -module SassSpec - module Annotate - end -end - -require_relative "annotate/cli" diff --git a/lib/sass_spec/annotate/cli.rb b/lib/sass_spec/annotate/cli.rb deleted file mode 100644 index 361b84c78f..0000000000 --- a/lib/sass_spec/annotate/cli.rb +++ /dev/null @@ -1,240 +0,0 @@ -# encoding: utf-8 -require 'set' -require 'yaml' -require 'command_line_reporter' - -require_relative 'directory' - -class SassSpec::Annotate::CLI - include CommandLineReporter - - def self.assert_legal_version(version) - if version && !SassSpec::LANGUAGE_VERSIONS.include?(version) - warn "Version #{version} is not valid. " + - "Did you mean one of: #{SassSpec::LANGUAGE_VERSIONS.join(', ')}" - return false - end - true - end - - def self.assert_not_file!(string, expected) - if File.exist?(string) || string.include?(File::SEPARATOR) - warn "Expected #{expected} but got a file path. Did you forget the argument?" - return false - end - true - end - - def self.parse(args) - runner_options = { - } - options = { - } - parser = OptionParser.new do |opts| - opts.banner = < PID of the command, -# :status => Process::Status of the command, -# :stdout => the standard output of the command, -# :stderr => the standard error of the command, -# :timeout => whether the command was timed out, -# } -module CaptureWithTimeout - def capture3_with_timeout(*cmd) - spawn_opts = Hash === cmd.last ? cmd.pop.dup : {} - opts = { - :stdin_data => spawn_opts.delete(:stdin_data) || "", - :binmode => spawn_opts.delete(:binmode) || false, - :timeout => spawn_opts.delete(:timeout), - :signal => spawn_opts.delete(:signal) || "TERM", - :kill_after => spawn_opts.delete(:kill_after), - } - - in_r, in_w = IO.pipe - out_r, out_w = IO.pipe - err_r, err_w = IO.pipe - in_w.sync = true - - if opts[:binmode] - in_w.binmode - out_r.binmode - err_r.binmode - end - - spawn_opts[:in] = in_r - spawn_opts[:out] = out_w - spawn_opts[:err] = err_w - - result = { - :pid => nil, - :status => nil, - :stdout => nil, - :stderr => nil, - :timeout => false, - } - - out_reader = nil - err_reader = nil - wait_thr = nil - - begin - Timeout.timeout(opts[:timeout]) do - result[:pid] = spawn(*cmd, spawn_opts) - wait_thr = Process.detach(result[:pid]) - in_r.close - out_w.close - err_w.close - - out_reader = Thread.new { out_r.read } - err_reader = Thread.new { err_r.read } - - in_w.write opts[:stdin_data] - in_w.close - - result[:status] = wait_thr.value - end - rescue Timeout::Error - result[:timeout] = true - pid = spawn_opts[:pgroup] ? -result[:pid] : result[:pid] - Process.kill(opts[:signal], pid) - if opts[:kill_after] - unless wait_thr.join(opts[:kill_after]) - Process.kill("KILL", pid) - end - end - ensure - result[:status] = wait_thr.value if wait_thr - result[:stdout] = out_reader.value if out_reader - result[:stderr] = err_reader.value if err_reader - out_r.close unless out_r.closed? - err_r.close unless err_r.closed? - end - - result - end -end diff --git a/lib/sass_spec/cli.rb b/lib/sass_spec/cli.rb deleted file mode 100644 index ffe9ab346e..0000000000 --- a/lib/sass_spec/cli.rb +++ /dev/null @@ -1,121 +0,0 @@ -require_relative 'engine_adapter' - -module SassSpec::CLI - require 'optparse' - - def self.parse - options = { - engine_adapter: nil, - spec_directory: nil, - generate: false, - tap: false, - skip: false, - verbose: false, - filter: "", - implementation: 'sass' - } - - OptionParser.new do |opts| - opts.banner = "Usage: ./sass-spec.rb [options] [spec_directory...] - -Examples: - Run `sassc --style compressed input.scss`: - ./sass-spec.rb -c 'sass --style compressed' - - Run tests only in the spec/basic folder: - ./sass-spec.rb spec/basic - -This script will search for all files under the spec (or specified) directory -that are named input.scss. It will then run a specified binary and check that -the output matches the expected output. If you want set up your own test suite, -follow a similar hierarchy as described in the initial comment of this script -for your test hierarchy. - -This command can also be used to annotate tests to control which tests are ran -and when. For details: ./sass-spec.rb annotate -h - -Make sure the command you provide prints to stdout. - -" - - opts.on("-v", "--verbose", "Run verbosely") do - options[:verbose] = true - end - - opts.on("-t", "--tap", "Output TAP compatible report") do - options[:tap] = true - end - - opts.on("-c", "--command COMMAND", "Sets a specific binary to run") do |v| - options[:engine_adapter] = ExecutableEngineAdapter.new(v) - options[:engine_adapter].args = options[:cmd_args] - end - - opts.on("--dart PATH", "Run Dart Sass, whose repo should be at the given path.") do |path| - options[:engine_adapter] = DartEngineAdapter.new(path) - options[:engine_adapter].args = options[:cmd_args] - end - - opts.on("--cmd-args ARGS", "Pass ARGS to command or Dart Sass.") do |args| - if (adapter = options[:engine_adapter]) && adapter.is_a?(DartEngineAdapter) - adapter.args = args - elsif (adapter = options[:engine_adapter]) && adapter.is_a?(ExecutableEngineAdapter) - adapter.args = args - else - options[:cmd_args] = args - end - end - - opts.on("-g", "--generate", "Run test(s) and generate expected output file(s).") do - options[:generate] = true - end - - opts.on("--run-todo", "Run any tests marked as todo. Defaults to false.") do - options[:run_todo] = true - end - - opts.on("--probe-todo", "Run and report tests marked as todo that unexpectedly pass. Defaults to false.") do - options[:probe_todo] = options[:run_todo] = true - end - - opts.on("--impl NAME", "Sets the name of the implementation being tested. Defaults to 'sass'") do |name| - options[:implementation] = name - end - - opts.on("--filter PATTERN", "Run tests that match the pattern you provide") do |pattern| - options[:filter] = pattern - end - - opts.on("--limit NUMBER", "Limit the number of tests run to this positive integer.") do |limit| - raise "--limit must receive a positive integer" if limit.to_i < 0 - options[:limit] = limit.to_i - end - - opts.on("--migrate-impl", "Copy tests that fail and make them pass for the current implementation.") do - options[:migrate_impl] = true - end - - opts.on("--silent", "Don't show any logs") do - options[:silent] = true - end - - opts.on("--check-annotations", "Check if any test annotations are unnecessary.") do - options[:check_annotations] = true - end - - opts.on("--interactive", "When a test fails, enter into a dialog for how to handle it.") do - options[:interactive] = true - end - end.parse! - - raise "Must specify either --dart or --command." if options[:engine_adapter].nil? - - options[:spec_dirs_to_run] = ARGV.dup.map{|d| File.expand_path(d)} if ARGV.any? - - if options[:implementation] && options[:engine_adapter].respond_to?(:set_description) - options[:engine_adapter].set_description(options[:implementation]) - end - - options - end -end diff --git a/lib/sass_spec/directory.rb b/lib/sass_spec/directory.rb deleted file mode 100644 index 8ad68cc56a..0000000000 --- a/lib/sass_spec/directory.rb +++ /dev/null @@ -1,273 +0,0 @@ -require 'fileutils' -require 'hrx' -require 'pathname' -require 'set' - -require_relative 'util' - -# A directory that may represent either a physical directory on disk or a -# directory within an HRX::Archive. -class SassSpec::Directory - # A cache of parsed HRX files, indexed by their corresponding directory paths. - def self._hrx_cache - @hrx_cache ||= {} - end - - # The directory's path, possibly including components within an HRX file. - attr_reader :path - - # Returns whether this is a virtual HRX directory. - def hrx? - !!@archive - end - - # Creates a Directory from a `path`, which may go into an HRX file. For - # example, if `path` is `path/to/archive/subdir` and `path/to/archive.hrx` - # exists, this will load `subdir` from within `path/to/archive.hrx`. - def initialize(path) - @path = Pathname.new(path) - @path = @path.relative_path_from(Pathname.new(Dir.pwd)) if @path.absolute? - - # Always use forward slashes on Windows, because HRX requires them. - @path = Pathname.new(@path.to_s.gsub(/\\/, '/')) if Gem.win_platform? - - if %w[.. .].include?(@path.each_filename.first) - raise ArgumentError.new("#{path} must be beneath the working directory") - end - - return if Dir.exist?(@path) - - SassSpec::Util.each_directory(@path).with_index do |dir, i| - archive_path = dir + ".hrx" - if self.class._hrx_cache[dir] || File.exist?(archive_path) - @parent_archive_path = archive_path - @parent_archive = self.class._hrx_cache[dir] ||= HRX::Archive.load(archive_path) - - @path_in_parent = @path.each_filename.drop(i + 1).join("/") - @archive = - if @path_in_parent.empty? - @parent_archive - else - @parent_archive.child_archive(@path_in_parent) - end - - return - end - end - - raise ArgumentError.new("#{path} doesn't exist") - end - - # Returns the parent as a SassSpec::Directory, or `nil` if this is the root - # spec directory. - def parent - dirname = File.dirname(@path) - dirname == "." ? nil : SassSpec::Directory.new(dirname) - end - - # Returns a list of all files in this directory that match `pattern`, relative - # to the directory root. - # - # This includes files within HRX files in this directory. - def glob(pattern) - if hrx? - @archive.glob(pattern).select {|e| e.is_a?(HRX::File)}.map(&:path) - else - recursive = pattern.include?("**") - physical_pattern = - if recursive - "{#{File.join(@path, pattern)},#{File.join(@path, '**/*.hrx')}}" - else - File.join(@path, pattern) - end - - seen = Set.new - Dir.glob(physical_pattern, File::FNM_EXTGLOB).flat_map do |path| - # Dir.glob() can emit the same path multiple times if multiple `{}` - # patterns cover it. - next [] if seen.include?(path) - seen << path - - next [] if Dir.exists?(path) - - absolute = Pathname.new(path).expand_path - relative = absolute.relative_path_from(@path.expand_path).to_s - next relative unless path.end_with?(".hrx") - next [] unless recursive - - dir = path[0...-".hrx".length] - relative_dir = relative[0...-".hrx".length] - archive = self.class._hrx_cache[dir] ||= HRX::Archive.load(path) - archive.glob(pattern).map {|inner| "#{relative_dir}/#{inner.path}"} - end - end - end - - # Returns whether a file exists at `path` within this directory. - def file?(path) - if hrx? - @archive[path].is_a?(HRX::File) - elsif (dir, basename = split_if_nested(path)) - dir.file?(basename) - else - File.file?(File.join(@path, path)) - end - rescue ArgumentError, HRX::Error - # If we get a directory-doesn't-exist error for a nested directory, return - # false. This could catch unrelated errors, but it's probably not likely - # enough to be worth creating a custom exception class. - return false - end - - # Reads the file at `path` within this directory. - def read(path) - if hrx? - @archive.read(path) - elsif (dir, basename = split_if_nested(path)) - dir.read(basename) - else - File.read(File.join(@path, path), binmode: true, encoding: "ASCII-8BIT") - end - end - - # Writes `contents` to `path` within this directory. - def write(path, contents) - if hrx? - @archive.write(path, contents, comment: :copy) - _write! - elsif (dir, basename = split_if_nested(path)) - dir.write(basename, contents) - else - File.write(File.join(@path, path), contents, binmode: true) - end - end - - # Deletes the file at `path` within this directory. - # - # If `if_exists` is `true`, don't throw an error if the file doesn't exist. - def delete(path, if_exists: false) - return if if_exists && !file?(path) - if hrx? - @archive.delete(path) - _write! - elsif (dir, basename = split_if_nested(path)) - dir.delete(basename, if_exists: if_exists) - else - File.unlink(File.join(@path, path)) - end - end - - # Renames the file at `old` to `new`. - def rename(old, new) - old_dir, old_basename = split_if_nested(old) || [self, old] - new_dir, new_basename = split_if_nested(new) || [self, new] - - if old_dir.hrx? && new_dir.hrx? - unless old_file = old_dir.archive[old_basename] - raise "#@path/old doesn't exist" - end - - new_dir.archive.add( - HRX::File.new(new_basename, old_file.content, comment: old_file.comment), - after: new_dir == old_dir ? old_file.path : nil) - new_dir._write! - - old_dir.delete(old_basename) - else - new_dir.write(new_basename, old_dir.read(old_basename)) - old_dir.delete(old_basename) - end - end - - # Deletes this directory and everything it contains. - def delete_dir! - if hrx? - if @parent_archive.equal?(@archive) - _delete_parent! - else - @parent_archive.delete(@path_in_parent, recursive: true) - _write! - end - else - FileUtils.rm_rf(@path) - end - end - - # If this directory refers to an HRX file, runs a block with the archive's - # directory and all its contents physically present on the filesystem next to - # the archive. - # - # If this is a normal directory, runs the block with the filesystem as-is. - def with_real_files - return yield unless @archive - - files = @archive.entries.select {|entry| entry.is_a?(HRX::File)}.to_a - if parent && parent.hrx? && files.any? {|file| _reaches_out?(file)} - return parent.with_real_files {yield} - end - - outermost_new_dir = SassSpec::Util.each_directory(@path).find {|dir| !Dir.exist?(dir)} - - files.each do |file| - path = File.join(@path, file.path) - FileUtils.mkdir_p(File.dirname(path)) - File.write(path, file.content) - end - yield - ensure - FileUtils.rm_rf(outermost_new_dir) if outermost_new_dir - end - - # Returns an HRX representation of this directory. - def to_hrx - archive = HRX::Archive.new - glob("**/*").each do |path| - archive << HRX::File.new("#{self.path}/#{path}", read(path)) - end - archive.to_hrx - end - - def inspect - "#" - end - - def to_s - @path.to_s - end - - protected - - # The directory's underlying HRX archive. `nil` if `hrx?` is `false`. - attr_reader :archive - - # Writes `@parent_archive` to disk. - def _write! - if @parent_archive.entries.empty? - _delete_parent! - else - @parent_archive.write!(@parent_archive_path) - end - end - - private - - # If `path` points to a subdirectory of this directory, returns the nested - # `Directory` object and the basename of the file. Otherwise, returns `nil`. - def split_if_nested(path) - dirname, basename = File.split(path) - dirname == '.' ? nil : [SassSpec::Directory.new(@path.join(dirname)), basename] - end - - # Returns whether `file` contains enough `../` references to reach outside - # this directory. - def _reaches_out?(file) - depth = file.path.count("/") - file.content.scan(%r{(?:\.\./)+}).any? {|match| match.count("/") > depth} - end - - # Deletes `@parent_archive` from disk and from the archive cache. - def _delete_parent! - File.unlink(@parent_archive_path) - self.class._hrx_cache.delete(@parent_archive_path.sub(/\.hrx$/, '')) - end -end diff --git a/lib/sass_spec/engine_adapter.rb b/lib/sass_spec/engine_adapter.rb deleted file mode 100644 index 7f4bf095b4..0000000000 --- a/lib/sass_spec/engine_adapter.rb +++ /dev/null @@ -1,129 +0,0 @@ -require 'open3' -require_relative 'capture_with_timeout' - -class EngineAdapter - - def describe - not_implemented - end - - # Compile a Sass file and return the results - # @return [css_output, std_error, status_code] - def compile(sass_filename, precision) - not_implemented - end - - private - - def not_implemented - raise RuntimeError, "Not yet implemented" - end -end - -class ExecutableEngineAdapter < EngineAdapter - include CaptureWithTimeout - attr_accessor :args - - def initialize(command, description = nil) - @command = command - @timeout = 90 - @description = description || command - @version = `#{@command} --version` - end - - def set_description(description) - @description = description - end - - def describe - @description - end - - def compile(sass_filename, precision) - command = File.absolute_path(@command) - dirname, basename = File.split(sass_filename) - result = capture3_with_timeout( - command, "--precision", precision.to_s, "--style", "expanded", - "-I", File.expand_path("../../../spec", __FILE__), *@args&.split(/\s+/), basename, - binmode: true, timeout: @timeout, chdir: dirname) - - if result[:timeout] - ["", "Execution timed out after #{@timeout}s", -1] - else - [result[:stdout], result[:stderr], result[:status].exitstatus] - end - end - - def to_s - "#{@description} #{@version}" - end -end - -class DartEngineAdapter < EngineAdapter - attr_accessor :args - - def initialize(path) - @path = path - Tempfile.open("dart-sass-spec") do |f| - f.write(<<-DART) - // @dart=2.9 - import "dart:convert"; - import "dart:io"; - - import "#{File.absolute_path @path}/bin/sass.dart" as sass; - - main() async { - await for (var line in new LineSplitter().bind(utf8.decoder.bind(stdin))) { - if (line.startsWith("!cd ")) { - Directory.current = line.substring("!cd ".length); - continue; - } - - try { - await sass.main(line.split(" ").where((arg) => arg.isNotEmpty).toList()); - } catch (error, stackTrace) { - stderr.writeln("Unhandled exception:"); - stderr.writeln(error); - stderr.writeln(stackTrace); - exitCode = 255; - } - - stdout.add([0xFF]); - stdout.write(exitCode); - stdout.add([0xFF]); - stderr.add([0xFF]); - exitCode = 0; - } - } - DART - @stdin, @stdout, @stderr = Open3.popen3("dart --enable-asserts --packages=#{@path}/.packages #{f.path}") - @stdout.set_encoding 'binary' - @stderr.set_encoding 'binary' - end - @version = `dart #{@path}/bin/sass.dart --version` - end - - def describe - "dart-sass" - end - - def compile(sass_filename, precision) - dirname, basename = File.split(sass_filename) - @stdin.puts "!cd #{File.absolute_path(dirname)}" - @stdin.puts("--no-color --no-unicode -I #{File.expand_path("../../../spec", __FILE__)} " + - "#{@args} #{basename}") - [next_chunk(@stdout), next_chunk(@stderr), next_chunk(@stdout).to_i] - end - - def to_s - "Dart Sass #{@version}" - end - - private - - def next_chunk(io) - result = io.gets("\xFF".force_encoding('binary')) - return '' unless result - return result[0...-1] - end -end diff --git a/lib/sass_spec/interactor.rb b/lib/sass_spec/interactor.rb deleted file mode 100644 index 450d529613..0000000000 --- a/lib/sass_spec/interactor.rb +++ /dev/null @@ -1,88 +0,0 @@ -module SassSpec - class Interactor - - class Choice < Struct.new(:shortcut, :message, :block) - def run_block! - block.call if block - end - end - - def initialize(id = nil) - @choices = [] - @choice = nil - @id = id - end - - def prompt(message) - @prompt = message - end - - def choice(shortcut, message, &block) - @choices << Choice.new(shortcut, message, block) - end - - def restart! - @choice = nil - end - - def display_choices!(memory) - puts - puts @prompt if @prompt - @choices.each_with_index do |c, i| - puts "#{c.shortcut}. #{c.message}" - end - if @id && memory - puts "Note: If you end your choice with a ! then next time this happens,\n"+ - "we'll use that option without prompting you.\n" - end - print "Please select an option > " - end - - def run!(memory = nil) - if @id && memory && memory[@id] - @choices.detect{|c| c.shortcut == memory[@id]}.run_block! - return memory[@id] - end - if @choices.size == 0 - raise ArgumentError, "No choices to run." - end - @choice = nil - until @choice - display_choices!(memory) - input = $stdin.gets.strip - puts - - if input && input.end_with?("!") - repeat = true - input.slice!(-1) - end - - @choice = input - if (choice = @choices.find {|c| c.shortcut == @choice}) - choice.run_block! # We run this in the loop so restart! can be invoked. - else - @choice = nil - end - end - @choice # we return the shortcut so re-ordering choices doesn't change result - ensure - if @id && memory && repeat && @choice - memory[@id] = @choice - end - end - - def self.interact - interactor = new - yield interactor - interactor.run! - end - - def self.interact_with_memory(memory, id) - interactor = new(id) - yield interactor - interactor.run!(memory) - end - end -end - - diff --git a/lib/sass_spec/runner.rb b/lib/sass_spec/runner.rb deleted file mode 100644 index b88489c617..0000000000 --- a/lib/sass_spec/runner.rb +++ /dev/null @@ -1,108 +0,0 @@ -require 'minitest' - -require_relative 'test' -require_relative 'test_case' -require_relative 'directory' - -class SassSpec::Runner - - def initialize(options = {}) - @options = options - end - - def get_input_dirs - (@options[:spec_dirs_to_run] || [SassSpec::SPEC_DIR]).map do |d| - dir = - # If the user passes a directory, use that. If it fails, they may have - # passed a file *in* a directory, so try using the parent. If *that* - # fails, raise the original error. - begin - SassSpec::Directory.new(d) - rescue => e - begin - SassSpec::Directory.new(File.dirname(d)) - rescue - raise e - end - end - end - end - - def get_input_files - get_input_dirs.flat_map do |dir| - dir.glob("**/input.s[ac]ss").map {|f| File.join(dir.path, f)} - end.uniq - end - - def run - unless @options[:silent] || @options[:tap] - puts "Recursively searching under #{get_input_dirs.join(", ")} for test files to test #{@options[:engine_adapter]}." - end - - test_cases = _get_cases - SassSpec::Test.create_tests(test_cases, @options) - - minioptions = [] - if @options[:verbose] - minioptions.push '--verbose' - end - - if @options[:tap] - require 'minitap' - Minitest.reporter = Minitap::TapY - end - - result = Minitest.run(minioptions) - - if @options[:run_todo] - passing = [] - test_cases.each do |test_case| - if test_case.todo? && test_case.result? - passing << test_case.dir.to_s - end - end - if !passing.empty? - puts "The following tests pass but were marked as TODO for #{@options[:engine_adapter].describe}:" - puts passing.join("\n") - else - puts "Note: All tests marked as TODO for #{@options[:engine_adapter].describe} are still failing." - end - end - - result - end - - def impl - @options[:engine_adapter].describe - end - - def _get_cases - cases = [] - get_input_files().each do |filename| - dir = SassSpec::Directory.new(File.dirname(filename)) - metadata = SassSpec::TestCaseMetadata.new(dir) - - unless metadata.valid_for_impl?(impl) - if @options[:verbose] - warn "#{metadata.name} does not apply to #{impl}" - end - next - end - - next unless filename.include?(@options[:filter] || "") - - test_case = SassSpec::TestCase.new(dir, @options[:engine_adapter].describe) - - # unless File.exist?(test_case.expected_path) - # if @options[:verbose] - # warn "Expected output file missing. Skipping #{test_case.name}." - # end - # next - # end - - cases.push(test_case) - end - cases - end - -end diff --git a/lib/sass_spec/test.rb b/lib/sass_spec/test.rb deleted file mode 100644 index ff4e1b93f5..0000000000 --- a/lib/sass_spec/test.rb +++ /dev/null @@ -1,659 +0,0 @@ -require 'minitest' -require 'thread' -require 'fileutils' -require 'yaml' -require_relative "interactor" -require_relative "util" - -# Holder to put and run test cases -class SassSpec::Test < Minitest::Test - def self.create_tests(test_cases, options = {}) - options[:limit] ||= test_cases.length + 1 - test_cases[0...options[:limit]].each do |test_case| - define_method("test__#{test_case.name}") do - runner = SassSpecRunner.new(test_case, options) - test_case.finalize(runner.run) - self.assertions += runner.assertions - end - end - end -end - -class SassSpecRunner - include MiniTest::Assertions - - attr_accessor :assertions - - @@interaction_memory = {} - - def initialize(test_case, options = {}) - @assertions = 0 - @test_case = test_case - @options = options - end - - def run - if @test_case.todo? && !@options[:run_todo] - skip "Skipped #{@test_case.name}" - end - - unless @test_case.dir.hrx? - @test_case.dir.glob("*").each {|p| assert_filename_length!(File.join(@test_case.dir.path, p))} - end - - @output, @error, @status = @test_case.run(@options[:engine_adapter]) - @output = @output.gsub(/\r\n/, "\n") - @normalized_output = SassSpec::Util.normalize_output(@output) - @error = SassSpec::Util.normalize_error(@error) - - if @options[:generate] - overwrite_test! - return true - end - - # Allow checks to throw `:done` to indicate that no more checks need to be - # performed. We throw rather than returning a boolean so that we can do - # checks in nested functions without worrying about piping return values. - catch :done do - check_annotations! - handle_conflicting_files! - handle_missing_output! - handle_unexpected_error! - handle_unexpected_pass! - handle_output_difference! - - # Run these checks last because `handle_stderr_difference!` can skip the - # test if `@test_case.warning_todo?` is set, and we only want to check for - # an unnecessary TODO if the test isn't skipped because of a TODO. - handle_stderr_difference! - handle_unnecessary_todo! - end - - return true - end - - private - - ## Failure handlers - - def check_annotations! - return unless @options[:check_annotations] - - ignored_warning_impls = @test_case.metadata.warnings_ignored_for - - if ignored_warning_impls.any? && @error.empty? - message = "No warning issued, but warnings are ignored for #{ignored_warning_impls.join(', ')}" - choice = interact(:ignore_warning_nonexistant, :fail) do |i| - i.prompt message - - i.choice('R', "Remove ignored status for #{ignored_warning_impls.join(', ')}") do - change_options(remove_ignore_warning_for: ignored_warning_impls) - end - - fail_or_exit_choice(i) - end - - assert choice != :fail, message - end - - todo_warning_impls = @test_case.metadata.all_warning_todos - if todo_warning_impls.any? && @error.length == 0 - message = "No warning issued, but warnings are pending for #{todo_warning_impls.join(', ')}" - choice = interact(:todo_warning_nonexistant, :fail) do |i| - i.prompt message - - i.choice('R', "Remove TODO status for #{todo_warning_impls.join(', ')}") do - change_options(remove_warning_todo: todo_warning_impls) - end - - fail_or_exit_choice(i) - end - - assert choice != :fail, message - end - end - - def handle_conflicting_files! - if @test_case.file?("error", impl: true) - impl = true - elsif @test_case.file?("error") - impl = false - else - return - end - - output_file_exists = @test_case.file?("output.css", impl: impl) - warning_file_exists = @test_case.file?("warning", impl: impl) - return unless output_file_exists || warning_file_exists - - choice = interact(:conflicting_files, :fail) do |i| - i.prompt "Test has both error and success outputs." - - show_test_case_choice(i) - show_output_choice(i) - - delete_choice(i) - - i.choice('S', 'Keep the success output.') do - @test_case.delete("error", impl: :auto) - throw :done - end - - i.choice('E', 'Keep the error output.') do - @test_case.delete("output.css") if output_file_exists - @test_case.delete("warning") if warning_file_exists - throw :done - end - - migrate_warning_choice(i) unless warning_file_exists - update_output_choice(i) - fail_or_exit_choice(i) - end - - assert choice != :fail, "Expected #{@test_case.expected_path} file does not exist" - end - - def handle_missing_output! - return if @test_case.should_fail? || @test_case.expected - - skip_test_case!("TODO test is failing") if probe_todo? - - choice = interact(:missing_output, :fail) do |i| - i.prompt "Expected output file does not exist." - - show_test_case_choice(i) - show_output_choice(i) - delete_choice(i) - update_output_choice(i) - fail_or_exit_choice(i) - end - - assert choice != :fail, "Expected output.css file does not exist" - end - - def handle_unexpected_error! - return if @status == 0 || @test_case.should_fail? - - if !@options[:interactive] && @options[:migrate_impl] - migrate_impl! - throw :done - end - - skip_test_case!("TODO test is failing") if @test_case.todo? - - choice = interact(:unexpected_error, :fail) do |i| - i.prompt "An unexpected compiler error was encountered." - - show_test_case_choice(i) - - i.choice('e', "Show me the error.") do - display_text_block(@error) - i.restart! - end - - update_output_choice(i) - migrate_impl_choice(i) - todo_choice(i) - ignore_choice(i) - fail_or_exit_choice(i) - end - throw :done unless choice == :fail - - assert_equal 0, @status, - "Command `#{@options[:engine_adapter]}` did not complete:\n\n#{@error}" - end - - def handle_unexpected_pass! - return unless @status == 0 && @test_case.should_fail? - - if !@options[:interactive] && @options[:migrate_impl] - migrate_impl! - throw :done - end - - skip_test_case!("TODO test is failing") if probe_todo? - - choice = interact(:unexpected_pass, :fail) do |i| - i.prompt "A failure was expected but it compiled instead." - - show_test_case_choice(i) - - i.choice('o', "Show me the output.") do - display_text_block(@output) - i.restart! - end - - migrate_warning_choice(i) - update_output_choice(i) - migrate_impl_choice(i) - todo_choice(i) - fail_or_exit_choice(i) - end - throw :done unless choice == :fail - - refute_equal @status, 0, "Test case should fail, but it did not" - end - - def handle_output_difference! - return if @test_case.should_fail? || @normalized_output == @test_case.expected - - if !@options[:interactive] && @options[:migrate_impl] - migrate_impl! - throw :done - end - - skip_test_case!("TODO test is failing") if probe_todo? - - interact(:output_difference, :fail) do |i| - i.prompt "Output does not match expectation." - - show_test_case_choice(i) - - i.choice('d', "show diff.") do - require 'diffy' - display_text_block( - Diffy::Diff.new("Expected\n" + @test_case.expected, - "Actual\n" + @normalized_output).to_s(:color)) - i.restart! - end - - update_output_choice(i) - migrate_impl_choice(i) - todo_choice(i) - ignore_choice(i) - fail_or_exit_choice(i) - end - - assert_equal @test_case.expected, @normalized_output, "expected did not match output" - end - - def handle_unnecessary_todo! - return if probe_todo? && !@options[:interactive] - return unless @test_case.todo? || @test_case.warning_todo? - - interact(:unnecessary_todo, :fail) do |i| - i.prompt "Test is passing but marked as TODO." - - show_test_case_choice(i) - - unless @output.empty? - i.choice('o', "Show me the output.") do - display_text_block(@output) - i.restart! - end - end - - i.choice('R', "Remove TODO status for #{@test_case.impl}.") do - change_options(remove_todo: [@test_case.impl], remove_warning_todo: [@test_case.impl]) - throw :done - end - - i.choice('f', "Mark as skipped.") do - skip_test_case!("TODO test is passing") - end - - i.choice('X', "Exit testing.") do - raise Interrupt - end - end - - assert_equal @test_case.expected, @normalized_output, "expected did not match output" - end - - def handle_stderr_difference! - unless @test_case.should_fail? - if @test_case.ignore_warning? - return - elsif @test_case.warning_todo? && !@options[:run_todo] - skip_test_case! "Skipped warning check for #{@test_case.name}" - end - end - - error_msg = extract_error_message(@error) - expected_error_msg = extract_error_message( - @test_case.expected_error || @test_case.expected_warning) - - return if expected_error_msg == error_msg - skip_test_case!("TODO test is failing") if probe_todo? - - message = - if error_msg.empty? - if @test_case.should_fail? - "An error message was expected but wasn't produced." - else - "A warning was expected but wasn't produced." - end - elsif expected_error_msg.empty? - "An unexpected warning was produced." - else - if @test_case.should_fail? - "Error message doesn't match the expected error." - else - "Warning doesn't match the expected warning." - end - end - - type = @test_case.should_fail? ? :expected_error_different : :expected_warning_different - interact(type, :fail) do |i| - i.prompt(message) - - show_test_case_choice(i) - - unless error_msg.empty? - i.choice('e', "Show #{@test_case.should_fail? ? 'error' : 'warning'}.") do - display_text_block(error_msg) - i.restart! - end - end - - i.choice('d', "Show diff.") do - require 'diffy' - display_text_block( - Diffy::Diff.new("Expected\n#{expected_error_msg}", - "Actual\n#{error_msg}").to_s(:color)) - i.restart! - end - - update_output_choice(i) - migrate_impl_choice(i) - todo_warning_choice(i) - ignore_warning_choice(i) - fail_or_exit_choice(i) - end - - assert_equal expected_error_msg, error_msg, message - end - - ## Interaction utilities - - # If the runner is running in interactive mode, runs the interaction defined - # in the block and returns the result. Otherwise, just returns the default - # value. - def interact(prompt_id, default, &block) - if @options[:interactive] - print "\nIn test case: #{@test_case.name}" - return SassSpec::Interactor.interact_with_memory(@@interaction_memory, prompt_id, &block) - else - return default - end - end - - def show_test_case_choice(i) - i.choice('t', "Show me the test case.") do - display_text_block(@test_case.dir.to_hrx) - i.restart! - end - end - - def show_output_choice(i) - if @status == 0 - i.choice('o', "Show me the output generated.") do - display_text_block(@output) - i.restart! - end - - if @error.length > 0 - i.choice('e', "Show me the warning generated.") do - display_text_block(@error) - i.restart! - end - end - else - i.choice('e', "Show me the error generated.") do - display_text_block(@error) - i.restart! - end - end - end - - def migrate_warning_choice(i) - i.choice('W', "Migrate the error to a warning.") do - @test_case.rename("error", "warning") - throw :done - end - end - - def update_output_choice(i) - i.choice('O', "Update expected output and pass test.") do - overwrite_test! - throw :done - end - end - - def migrate_impl_choice(i) - i.choice('I', "Migrate copy of test to pass on #{@test_case.impl}.") do - migrate_impl! || i.restart! - throw :done - end - end - - def todo_choice(i) - return if @test_case.todo? - i.choice('T', "Mark spec as todo for #{@test_case.impl}.") do - change_options(add_todo: [@test_case.impl]) - throw :done - end - end - - def ignore_choice(i) - i.choice('G', "Ignore test for #{@test_case.impl} FOREVER.") do - change_options( - add_ignore_for: [@test_case.impl], - remove_warning_todo: [@test_case.impl], - remove_todo: [@test_case.impl]) - throw :done - end - end - - def delete_choice(i) - i.choice('D', "Delete test.") do - if delete_test! - throw :done - else - i.restart! - end - end - end - - def todo_warning_choice(i) - return if @test_case.warning_todo? - i.choice('T', "Mark warning as todo for #{@test_case.impl}.") do - change_options(add_warning_todo: [@test_case.impl]) - throw :done - end - end - - def ignore_warning_choice(i) - i.choice('G', "Ignore warning for #{@test_case.impl}.") do - change_options(add_ignore_warning_for: [@test_case.impl]) - throw :done - end - end - - def fail_or_exit_choice(i) - i.choice('f', "Mark as failed.") - i.choice('X', "Exit testing.") do - raise Interrupt - end - end - - # Deletes the current test case. - # - # In interactive mode, prompts the user and returns `false` if they decide not - # to delete the test. - def delete_test! - result = interact(:delete_test, :proceed) do |i| - files = @test_case.dir.glob("**/*") - i.prompt("The following files will be removed:\n * " + files.join("\n * ")) - - i.choice('D', "Delete them.") do - @test_case.dir.delete_dir! - end - - i.choice('x', "I changed my mind.") {} - end - result == :proceed || result == "D" - end - - # Adds separate outputs for the test that are compatible with the current - # implementation. - def migrate_impl! - if @status == 0 - if @test_case.expected != @normalized_output || @test_case.should_fail? - @test_case.write("output.css", @output, impl: true) - end - - if extract_error_message(@test_case.expected_warning) != extract_error_message(@error) - @test_case.write("warning", @error, impl: true) - end - else - actual_error = @test_case.expected_error && extract_error_message(@test_case.expected_error) - if actual_error != extract_error_message(@error) - @test_case.write("error", @error, impl: true) - end - end - - change_options(remove_warning_todo: [@test_case.impl], remove_todo: [@test_case.impl]) - end - - ## Other utilities - - # Returns whether the current test case is marked as TODO, but is still being - # run because --probe-todo was passed. These specs shouldn't produce errors - # when they fail. - def probe_todo? - @options[:probe_todo] && (@test_case.todo? || @test_case.warning_todo?) - end - - def skip_test_case!(reason = nil) - msg = "Skipped #{@test_case.name}" - if reason - msg << ": #{reason}" - else - msg << "." - end - skip msg - end - - ANSI_ESCAPES = /[\u001b\u009b][\[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/ - def display_text_block(text) - if text.empty? - puts "*" * 20 + " (empty) " + "*" * 20 - return - end - - delim = "*" * text.gsub(ANSI_ESCAPES, '').lines.map{|l| l.rstrip.size}.max - - puts delim - puts text - puts delim - end - - def overwrite_test! - if @status == 0 - @test_case.write("output.css", @output, impl: :auto) - @test_case.delete("error", if_exists: true, impl: :auto) - - if @error.empty? - @test_case.delete("warning", if_exists: true, impl: :auto) - else - @test_case.write("warning", @error, impl: :auto) - end - else - @test_case.write("error", @error, impl: :auto) - @test_case.delete("output.css", if_exists: true, impl: :auto) - @test_case.delete("warning", if_exists: true, impl: :auto) - end - - change_options(remove_warning_todo: [@test_case.impl], remove_todo: [@test_case.impl]) - end - - def change_options(new_options) - existing_options = if @test_case.file?("options.yml") - YAML.load(@test_case.read("options.yml")) - else - {} - end - - existing_options = SassSpec::TestCaseMetadata.merge_options(existing_options, new_options) - - if existing_options.any? - @test_case.write("options.yml", existing_options.to_yaml) - else - @test_case.delete("options.yml", if_exists: true) - end - end - - GEMFILE_PREFIX_LENGTH = 68 - # When running sass-spec as a gem from github very long filenames can cause - # installation issues. This checks that the paths in use will work. - def assert_filename_length!(filename) - name = relative_name = filename.to_s.sub(SassSpec::SPEC_DIR, "") - assert false, "Filename #{name} must no more than #{256 - GEMFILE_PREFIX_LENGTH} characters long" if name.size > (256 - GEMFILE_PREFIX_LENGTH) - - if name.size <= 100 then - prefix = "" - else - parts = name.split(/\//) - newname = parts.pop - nxt = "" - - loop do - nxt = parts.pop - break if newname.size + 1 + nxt.size > 100 - newname = nxt + "/" + newname - end - - prefix = (parts + [nxt]).join "/" - name = newname - - assert false, "base name (#{name}) of #{relative_name} must no more than 100 characters long" if name.size > 100 - assert false, "prefix (#{prefix}) of #{relative_name} must no more than #{155 - GEMFILE_PREFIX_LENGTH} characters long" if prefix.size > (155 - GEMFILE_PREFIX_LENGTH) - end - return nil - end - - def extract_error_message(error) - # We want to make sure dart-sass continues to generate correct stack traces - # and text highlights, so we check its full error messages. - if @options[:engine_adapter].describe == 'dart-sass' - return clean_debug_path(error.rstrip) - end - - error_message = "" - consume_next_line = false - error.each_line do |line| - if consume_next_line - next if line.strip == "" - error_message += line - break - end - if (line =~ /(DEPRECATION )?WARNING/) - if line.rstrip.end_with?(":") - error_message = line.rstrip + "\n" - consume_next_line = true - next - else - error_message = line - break - end - end - if (line =~ /Error:/) - error_message = line - break - end - end - clean_debug_path(error_message.rstrip) - end - - def clean_debug_path(error) - error.gsub(/^.*?(input.scss:\d+ DEBUG:)/, '\1') - .gsub(/\/+/, "/") - .gsub(/^#{Regexp.quote(SassSpec::SPEC_DIR.gsub(/\\/, '\/'))}\//, "/sass/sass-spec/") - .gsub(/^#{Regexp.quote(SassSpec::SPEC_DIR)}\//, "/sass/sass-spec/") - .gsub(/(?:\/todo_|_todo\/)/, "/") - .gsub(/\/libsass\-[a-z]+\-tests\//, "/") - .gsub(/\/libsass\-[a-z]+\-issues/, "/libsass-issues") - .strip - end -end diff --git a/lib/sass_spec/test_case.rb b/lib/sass_spec/test_case.rb deleted file mode 100644 index 19dae3878b..0000000000 --- a/lib/sass_spec/test_case.rb +++ /dev/null @@ -1,196 +0,0 @@ -require 'pathname' -require_relative 'util' - -# This represents a specific test case. -class SassSpec::TestCase - attr_reader :metadata, :dir, :impl - - # The path to the input file for this test case. - # - # Note that this file is not guaranteed to exist on disk, since this test case - # may be loaded from an HRX file. - attr_reader :input_path - - # The Sass or SCSS input for this test case. - attr_reader :input - - # The normalized expected CSS output. This is `nil` if the test is expected to - # fail, or if it's malformed and has no expectations. - attr_reader :expected - - # The normalized expected warning text. This is `nil` if the test is expected - # to fail, or if it's malformed and has no expectations. It's `""` if the test - # is expected to succeed without warnings. - attr_reader :expected_warning - - # The normalized expected error message. This is `nil` if the test is expected - # to succeed, or if it's malformed and has no expectations. - attr_reader :expected_error - - # Returns the test case for the given SassSpec::Directory and implementation - # name. - def initialize(dir, impl) - @dir = dir - @impl = impl - @metadata = SassSpec::TestCaseMetadata.new(dir) - @result = false - - input_files = @dir.glob("input.*") - if input_files.empty? - raise ArgumentError.new("No input file found in #{@dir}") - elsif input_files.size > 1 - raise ArgumentError.new("Multiple input files found in #{@dir}") - end - @input = @dir.read(input_files.first) - - # If there's an impl-specific output file, then this is a success test. - # Otherwise, it's an error test if there's *any* error file, impl-specific - # or otherwise. - if !file?("output.css", impl: true) && file?("error", impl: :auto) - @expected_error = SassSpec::Util.normalize_error(read("error", impl: :auto)) - else - if file?("output.css", impl: :auto) - output = read("output.css", impl: :auto) - # we seem to get CP850 otherwise - # this provokes equal test to fail - output = String.new(output).force_encoding('ASCII-8BIT') - @expected = SassSpec::Util.normalize_output(output) - end - - @expected_warning = - if file?("warning", impl: :auto) - SassSpec::Util.normalize_error(read("warning", impl: :auto)) - else - "" - end - end - end - - def result? - @result - end - - def finalize(result) - @result = result - end - - def name - @metadata.name - end - - def should_fail? - !!expected_error - end - - def todo? - @metadata.todo?(impl) - end - - def warning_todo? - @metadata.warning_todo?(impl) - end - - def ignore? - @metadata.ignore_for?(impl) - end - - def ignore_warning? - @metadata.ignore_warning_for?(impl) - end - - # Returns whether a file exists at `path` within this test case's directory. - # - # If `impl` is `true`, this adds an implementation-specific suffix to the - # path. If `impl` is false (the default), it does not. If `impl` is `:auto`, - # it returns true if either the implementation-specific file or the base file - # exists. - def file?(path, impl: false) - path = _path(path, impl) - path && @dir.file?(path) - end - - # Reads the file at `path` within this test case's directory. - # - # If `impl` is `true`, this adds an implementation-specific suffix to the - # path. If `impl` is false (the default), it does not. If `impl` is `:auto`, - # it returns the contents of implementation-specific file if it exists, or the - # base file if *it* exists, or throws an error if neither exists. - def read(path, impl: false) - unless resolved_path = _path(path, impl) - raise "#@dir/#{path} doesn't exist" - end - - @dir.read(resolved_path) - end - - # Writes `contents` to `path` within this test case's directory. - # - # If `impl` is `true`, this adds an implementation-specific suffix to the - # path. If `impl` is false (the default), it does not. If `impl` is `:auto`, - # it writes to the implementation-specific file if it exists, and the base - # file otherwise. - def write(path, contents, impl: false) - @dir.write(_path(path, impl) || path, contents) - end - - # Deletes the file at `path` within this test case's directory. - # - # If `if_exists` is `true`, don't throw an error if the file doesn't exist. - # - # If `impl` is `true`, this adds an implementation-specific suffix to the - # path. If `impl` is false (the default), it does not. If `impl` is `:auto`, - # it deletes the implementation-specific file if it exists, or the base file - # if *it* exists, or throws an error if neither exists. - def delete(path, if_exists: false, impl: false) - unless resolved_path = _path(path, impl) - return if if_exists - raise "#@dir/#{path} doesn't exist" - end - - @dir.delete(resolved_path, if_exists: if_exists) - end - - # Renames the file at `old` to `new` within this test case's directory. - # - # If `impl` is `true`, this adds an implementation-specific suffix to both - # paths. If `impl` is false (the default), it does not. If `impl` is `:auto`, - # it renames the implementation-specific file if it exists to an - # implementation-specific version of `new`, or the base file if *it* exists to - # `new`, or throws an error if neither exist. - def rename(old, new, impl: false) - unless resolved_old = _path(old, impl) - raise "#@dir/#{old} doesn't exist" - end - - new = _path(new, true) if resolved_old.include?("-#{@impl}") - @dir.rename(resolved_old, new) - end - - # Invokes EngineAdapter#compile on this test case and returns the result. - def run(engine_adapter) - @dir.with_real_files do - engine_adapter.compile( - File.join(@dir.path, @dir.glob("input.*").first), - @metadata.precision || 10) - end - end - - private - - # Returns the path of `path` within `dir`. - # - # If `impl` is `true`, this adds an implementation-specific suffix to the - # path. If `impl` is false (the default), it does not. If `impl` is `:auto`, - # it returns the implementation-specific file if it exists, or the base file - # if *it* exists, or `nil` if neither exists. - def _path(path, impl) - return path unless impl - - extension = File.extname(path) - path_without_extension = extension.empty? ? path : path[0...-extension.length] - path_with_impl = "#{path_without_extension}-#{@impl}#{extension}" - - return path_with_impl if impl == true || @dir.file?(path_with_impl) - return path if @dir.file?(path) - end -end diff --git a/lib/sass_spec/test_case_metadata.rb b/lib/sass_spec/test_case_metadata.rb deleted file mode 100644 index 813beccaa6..0000000000 --- a/lib/sass_spec/test_case_metadata.rb +++ /dev/null @@ -1,128 +0,0 @@ -require 'pathname' -require 'yaml' - -module SassSpec - class TestCaseMetadata - def self.cache - @metadata_cache ||= {} - end - - # If you change this, also change Annotate::CLI#annotate_path - def self.merge_options(existing_opts, new_opts) - existing_opts = existing_opts.dup - - new_opts.each do |key, value| - if added_key = key[/^add_(.*)/, 1] - added_key = added_key.to_sym - (existing_opts[added_key] ||= []) - .concat(value) - .uniq! - elsif removed_key = key[/^remove_((?:warning_)?todo)/, 1] - removed_key = removed_key.to_sym - (existing_opts[removed_key] ||= []) - .delete_if {|name| value.include?(_normalize_todo(name))} - existing_opts.delete(removed_key) if existing_opts[removed_key].empty? - elsif removed_key = key[/^remove_(.*)/, 1] - removed_key = removed_key.to_sym - (existing_opts[removed_key] ||= []) - .delete_if {|name| value.include?(name)} - existing_opts.delete(removed_key) if existing_opts[removed_key].empty? - elsif value.nil? - existing_opts.delete(key) - else - existing_opts[key] = value - end - end - - existing_opts - end - - ACCUMULATED_OPTIONS = [:todo, :warning_todo, :ignore_for, :ignore_warning_for, :only_on, :warning_only_on] - - attr_reader :options - - # The name of the test. - # - # This is a standardized format of the test's directory name. - attr_reader :name - - # Parses metadata for the test case at the given SassSpec::Directory. - def initialize(test_case_dir) - @name = test_case_dir.to_s - @options = resolve_options(test_case_dir) - end - - def resolve_options(dir) - self.class.cache[dir.path] ||= _resolve_options(dir).tap do |options| - _normalize_todos(options, :todo) - _normalize_todos(options, :warning_todo) - end.freeze - end - - def _resolve_options(dir) - self_options = dir.file?("options.yml") ? YAML.load(dir.read("options.yml")) : {} - raise "#{dir.path}/options.yml is not a map!" unless self_options.is_a?(Hash) - return self_options unless parent = dir.parent - - parent_options = resolve_options(parent) - rv = parent_options.merge(self_options) do |key, parent_value, self_value| - if ACCUMULATED_OPTIONS.include?(key) - (Array(parent_value) + Array(self_value)).uniq - else - self_value - end - end - rv - end - - # Normalize a list of TODOs to convert GitHub issue references to - # implementation names. - def _normalize_todos(options, field) - if options.include?(field) - options[field] = options[field] - .map {|name| self.class._normalize_todo(name)} - .to_set - end - end - - # Normalize a single TODO value to convert a GitHub issue reference to an - # implementation name. - def self._normalize_todo(value) - value =~ %r{^sass/(.*)#} ? $1 : value - end - - def todo?(impl) - @options[:todo] && @options[:todo].include?(impl) - end - - def warning_todo?(impl) - @options[:warning_todo] && @options[:warning_todo].include?(impl) - end - - def all_warning_todos - @options[:warning_todo] || [] - end - - def ignore_for?(impl) - (@options[:ignore_for] && @options[:ignore_for].include?(impl)) || - (@options[:only_on] && !@options[:only_on].include?(impl)) - end - - def ignore_warning_for?(impl) - (@options[:ignore_warning_for] && @options[:ignore_warning_for].include?(impl)) || - (@options[:warning_only_on] && @options[:warning_only_on].include?(impl)) - end - - def warnings_ignored_for - @options[:ignore_warning_for] || [] - end - - def precision - @options[:precision] - end - - def valid_for_impl?(impl) - !ignore_for?(impl) - end - end -end diff --git a/lib/sass_spec/util.rb b/lib/sass_spec/util.rb deleted file mode 100644 index aa54c99c1e..0000000000 --- a/lib/sass_spec/util.rb +++ /dev/null @@ -1,37 +0,0 @@ -module SassSpec::Util - class << self - # Normalizes the whitespace in the given CSS to make it easier to compare - # across implementations. - def normalize_output(css) - css.gsub(/(?:\r?\n)+/, "\n").force_encoding("utf-8") - end - - # Normalizes the path names and whitespace in the given error message. - def normalize_error(error) - # TODO(nweiz): Delete path normalization when sass/libsass#2861 is fixed. - error.gsub(/(?:\/todo_|_todo\/)/, "/") # hide todo pre/suffix - .gsub(/\/libsass\-[a-z]+\-tests\//, "/") # hide test directory - .gsub(/\/libsass\-[a-z]+\-issues\//, "/libsass-issues/") # normalize issue specs - .gsub(/(([\w\/.\-\\:]+?[\/\\])|([\/\\]|(?!:\s)))spec[\/\\]+/, "/sass/spec/") # normalize abs paths - .sub(/(?:\r?\n)*\z/, "\n") # make sure we have exactly one trailing linefeed - .sub(/\A(?:\r?\s)+\z/, "") # clear the whole file if only whitespace - .gsub(/\r\n/, "\n") # remove Windows line feeds - .force_encoding("utf-8") - end - - # Yields each directory in `path`, from the outermost to the innermost. - def each_directory(path) - return to_enum(__method__, path) unless block_given? - - path_so_far = nil - Pathname.new(path).each_filename do |dir| - if path_so_far.nil? - path_so_far = String.new(dir) - else - path_so_far << File::SEPARATOR << dir - end - yield path_so_far - end - end - end -end diff --git a/lib/sass_spec/version.rb b/lib/sass_spec/version.rb deleted file mode 100644 index 9975b5e057..0000000000 --- a/lib/sass_spec/version.rb +++ /dev/null @@ -1,4 +0,0 @@ -module SassSpec - VERSION = "3.3.3" -end - diff --git a/lib-js/spec-directory/cleanup.ts b/lib/spec-directory/cleanup.ts similarity index 100% rename from lib-js/spec-directory/cleanup.ts rename to lib/spec-directory/cleanup.ts diff --git a/lib-js/spec-directory/hrx.ts b/lib/spec-directory/hrx.ts similarity index 100% rename from lib-js/spec-directory/hrx.ts rename to lib/spec-directory/hrx.ts diff --git a/lib-js/spec-directory/index.ts b/lib/spec-directory/index.ts similarity index 100% rename from lib-js/spec-directory/index.ts rename to lib/spec-directory/index.ts diff --git a/lib-js/spec-directory/options.ts b/lib/spec-directory/options.ts similarity index 100% rename from lib-js/spec-directory/options.ts rename to lib/spec-directory/options.ts diff --git a/lib-js/spec-directory/real-directory.ts b/lib/spec-directory/real-directory.ts similarity index 100% rename from lib-js/spec-directory/real-directory.ts rename to lib/spec-directory/real-directory.ts diff --git a/lib-js/spec-directory/spec-directory.ts b/lib/spec-directory/spec-directory.ts similarity index 100% rename from lib-js/spec-directory/spec-directory.ts rename to lib/spec-directory/spec-directory.ts diff --git a/lib-js/spec-directory/spec-path.ts b/lib/spec-directory/spec-path.ts similarity index 100% rename from lib-js/spec-directory/spec-path.ts rename to lib/spec-directory/spec-path.ts diff --git a/lib-js/spec-directory/virtual-directory.ts b/lib/spec-directory/virtual-directory.ts similarity index 100% rename from lib-js/spec-directory/virtual-directory.ts rename to lib/spec-directory/virtual-directory.ts diff --git a/lib-js/tabulator.ts b/lib/tabulator.ts similarity index 100% rename from lib-js/tabulator.ts rename to lib/tabulator.ts diff --git a/lib-js/test-case/compare.ts b/lib/test-case/compare.ts similarity index 100% rename from lib-js/test-case/compare.ts rename to lib/test-case/compare.ts diff --git a/lib-js/test-case/expected.ts b/lib/test-case/expected.ts similarity index 100% rename from lib-js/test-case/expected.ts rename to lib/test-case/expected.ts diff --git a/lib-js/test-case/index.ts b/lib/test-case/index.ts similarity index 100% rename from lib-js/test-case/index.ts rename to lib/test-case/index.ts diff --git a/lib-js/test-case/test-case.ts b/lib/test-case/test-case.ts similarity index 100% rename from lib-js/test-case/test-case.ts rename to lib/test-case/test-case.ts diff --git a/lib-js/test-case/util.ts b/lib/test-case/util.ts similarity index 100% rename from lib-js/test-case/util.ts rename to lib/test-case/util.ts diff --git a/lint-spec.ts b/lint-spec.ts index ffb227c39d..ec7ecdbdb0 100644 --- a/lint-spec.ts +++ b/lint-spec.ts @@ -3,10 +3,10 @@ import fs from 'fs'; import p from 'path'; import yargs from 'yargs/yargs'; -import {LintReporter} from './lib-js/lint-reporter'; -import {fromPath, SpecDirectory} from './lib-js/spec-directory'; -import RealDirectory from './lib-js/spec-directory/real-directory'; -import VirtualDirectory from './lib-js/spec-directory/virtual-directory'; +import {LintReporter} from './lib/lint-reporter'; +import {fromPath, SpecDirectory} from './lib/spec-directory'; +import RealDirectory from './lib/spec-directory/real-directory'; +import VirtualDirectory from './lib/spec-directory/virtual-directory'; async function lintAllTests(fix: boolean) { try { diff --git a/sass-spec.rb b/sass-spec.rb deleted file mode 100755 index 2f903763e0..0000000000 --- a/sass-spec.rb +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env ruby - -#This script requires a standard directory hierarchy which might be a bit cumbersome to set up -# -#The hierarchy looks like this near the leaves: -#... -#|-test_subclass_1 -#| |-test_1 -#| | |-input.scss -#| | --output.css -#| --test_2 -#| |-input.scss -#| --output.css -#|-test_subclass_2 -#| |-test_1 -#| | |-input.scss -#| | --output.css -#... -#the point is to have all the tests in their own folder in a file named input* with -#the output of running a command on it in the file output* in the same directory - -require_relative 'lib/sass_spec' - - -module Minitest - class Skip < Assertion - def result_code - "-" - end - end -end - -if ARGV[0] == "annotate" - require_relative 'lib/sass_spec/annotate' - begin - (cli = SassSpec::Annotate::CLI.parse(ARGV[1..-1])) || exit(1) - rescue OptionParser::InvalidOption => e - warn e.message + "\n\n" - SassSpec::Annotate::CLI.parse(%w(-h)) - exit 1 - end - cli.annotate || exit(1) -else - begin - SassSpec::Runner.new(SassSpec::CLI.parse()).run || exit(1) - rescue ArgumentError => e - warn e.message - warn e.backtrace - exit 1 - end -end diff --git a/sass-spec.ts b/sass-spec.ts index b2081699b2..70b435c245 100644 --- a/sass-spec.ts +++ b/sass-spec.ts @@ -1,8 +1,8 @@ -import {fromPath} from './lib-js/spec-directory'; -import {Interactor} from './lib-js/interactor'; -import {parseArgs, CliArgs} from './lib-js/cli-args'; -import TestCase from './lib-js/test-case'; -import Tabulator from './lib-js/tabulator'; +import {fromPath} from './lib/spec-directory'; +import {Interactor} from './lib/interactor'; +import {parseArgs, CliArgs} from './lib/cli-args'; +import TestCase from './lib/test-case'; +import Tabulator from './lib/tabulator'; async function runAllTests() { let args_: CliArgs | undefined; diff --git a/test/cli-args.test.ts b/test/cli-args.test.ts index c06c5b0654..4d9ae499cf 100644 --- a/test/cli-args.test.ts +++ b/test/cli-args.test.ts @@ -1,8 +1,8 @@ import yargs from 'yargs'; -import {parseArgs, CliArgs} from '../lib-js/cli-args'; +import {parseArgs, CliArgs} from '../lib/cli-args'; // mock the compiler, since we don't actually care that it's created -jest.mock('../lib-js/compiler'); +jest.mock('../lib/compiler'); function wrap(yargs: yargs.Argv<{}>): yargs.Argv<{}> { return yargs.fail((msg, error) => { diff --git a/test/compiler.test.ts b/test/compiler.test.ts index 937ab35e53..b3c4c2515f 100644 --- a/test/compiler.test.ts +++ b/test/compiler.test.ts @@ -1,7 +1,7 @@ import {promises as fs} from 'fs'; import os from 'os'; import path from 'path'; -import {DartCompiler} from '../lib-js/compiler'; +import {DartCompiler} from '../lib/compiler'; describe('DartCompiler', () => { it('gracefully handles an executable that crashes on launch', async () => { diff --git a/test/fixtures/mock-compiler.ts b/test/fixtures/mock-compiler.ts index 29c41c165e..e33a8e1f9a 100644 --- a/test/fixtures/mock-compiler.ts +++ b/test/fixtures/mock-compiler.ts @@ -1,6 +1,6 @@ import yaml from 'js-yaml'; -import {Compiler, Stdio} from '../../lib-js/compiler'; -import {SpecDirectory} from '../../lib-js/spec-directory'; +import {Compiler, Stdio} from '../../lib/compiler'; +import {SpecDirectory} from '../../lib/spec-directory'; class MockCompiler extends Compiler { constructor(private readonly specDir: SpecDirectory) { diff --git a/test/interactor/loop.test.ts b/test/interactor/loop.test.ts index 7098470853..788f1c0024 100644 --- a/test/interactor/loop.test.ts +++ b/test/interactor/loop.test.ts @@ -1,7 +1,7 @@ -import {Interactor} from '../../lib-js/interactor'; +import {Interactor} from '../../lib/interactor'; import {Readable, Writable} from 'stream'; -import {fromContents} from '../../lib-js/spec-directory'; -import TestCase from '../../lib-js/test-case'; +import {fromContents} from '../../lib/spec-directory'; +import TestCase from '../../lib/test-case'; import {mockCompiler} from '../fixtures/mock-compiler'; class MemoryWritable extends Writable { diff --git a/test/interactor/options.test.ts b/test/interactor/options.test.ts index dddff97b42..153f8917a3 100644 --- a/test/interactor/options.test.ts +++ b/test/interactor/options.test.ts @@ -1,5 +1,5 @@ -import {TestCaseArg, optionsFor} from '../../lib-js/interactor'; -import {SassResult, TestResult} from '../../lib-js/test-case/util'; +import {TestCaseArg, optionsFor} from '../../lib/interactor'; +import {SassResult, TestResult} from '../../lib/test-case/util'; interface MockTestCaseArg { impl?: string; diff --git a/test/spec-directory/cleanup.test.ts b/test/spec-directory/cleanup.test.ts index f482e7b47b..bbd4ddaba2 100644 --- a/test/spec-directory/cleanup.test.ts +++ b/test/spec-directory/cleanup.test.ts @@ -1,4 +1,4 @@ -import {withAsyncCleanup} from '../../lib-js/spec-directory/cleanup'; +import {withAsyncCleanup} from '../../lib/spec-directory/cleanup'; describe('withAsyncCleanup', () => { it('does the cleanup function on normal exit', async () => { diff --git a/test/spec-directory/hrx.test.ts b/test/spec-directory/hrx.test.ts index 8cacbc2fbe..21c1ccbf3d 100644 --- a/test/spec-directory/hrx.test.ts +++ b/test/spec-directory/hrx.test.ts @@ -1,5 +1,5 @@ -import {fromContents} from '../../lib-js/spec-directory'; -import {toHrx} from '../../lib-js/spec-directory/hrx'; +import {fromContents} from '../../lib/spec-directory'; +import {toHrx} from '../../lib/spec-directory/hrx'; describe('toHrx', () => { async function expectHrx( diff --git a/test/spec-directory/iteration.test.ts b/test/spec-directory/iteration.test.ts index bd5184f440..0004bfe973 100644 --- a/test/spec-directory/iteration.test.ts +++ b/test/spec-directory/iteration.test.ts @@ -1,5 +1,5 @@ import path from 'path'; -import {fromPath, SpecDirectory} from '../../lib-js/spec-directory'; +import {fromPath, SpecDirectory} from '../../lib/spec-directory'; describe('SpecDirectory iteration', () => { describe('forEachTest', () => { diff --git a/test/spec-directory/mutations.test.ts b/test/spec-directory/mutations.test.ts index 936b8d8bec..27bbf16c65 100644 --- a/test/spec-directory/mutations.test.ts +++ b/test/spec-directory/mutations.test.ts @@ -1,5 +1,5 @@ import path from 'path'; -import {fromPath} from '../../lib-js/spec-directory'; +import {fromPath} from '../../lib/spec-directory'; // Tests for methods on SpecDirectory that mutate its contents describe('SpecDirectory mutations', () => { diff --git a/test/spec-directory/options.test.ts b/test/spec-directory/options.test.ts index 6413ce029d..119c0194f0 100644 --- a/test/spec-directory/options.test.ts +++ b/test/spec-directory/options.test.ts @@ -1,4 +1,4 @@ -import {fromContents} from '../../lib-js/spec-directory'; +import {fromContents} from '../../lib/spec-directory'; describe('SpecDirectory options', () => { it('works in the basic case', async () => { diff --git a/test/spot-check.test.ts b/test/spot-check.test.ts index c5cb8a1141..dee3c66443 100644 --- a/test/spot-check.test.ts +++ b/test/spot-check.test.ts @@ -1,5 +1,5 @@ import * as p from 'path'; -import * as specDirectory from '../lib-js/spec-directory'; +import * as specDirectory from '../lib/spec-directory'; // Spot checks for common spec errors. diff --git a/test/test-case/actual.test.ts b/test/test-case/actual.test.ts index f495e02619..4690ab68f5 100644 --- a/test/test-case/actual.test.ts +++ b/test/test-case/actual.test.ts @@ -1,7 +1,7 @@ -import {fromContents} from '../../lib-js/spec-directory'; +import {fromContents} from '../../lib/spec-directory'; import {mockCompiler} from '../fixtures/mock-compiler'; -import TestCase from '../../lib-js/test-case'; -import {SassResult} from '../../lib-js/test-case/util'; +import TestCase from '../../lib/test-case'; +import {SassResult} from '../../lib/test-case/util'; describe('TestCase::actual()', () => { async function getResults(contents: string): Promise { diff --git a/test/test-case/compare.test.ts b/test/test-case/compare.test.ts index 1553208265..adf8e74129 100644 --- a/test/test-case/compare.test.ts +++ b/test/test-case/compare.test.ts @@ -2,7 +2,7 @@ import { extractErrorMessage, extractWarningMessages, normalizeOutput, -} from '../../lib-js/test-case/compare'; +} from '../../lib/test-case/compare'; describe('result comparison', () => { describe('normalizeOutput', () => { diff --git a/test/test-case/expected.test.ts b/test/test-case/expected.test.ts index bd1e239ad4..96d7ddcb47 100644 --- a/test/test-case/expected.test.ts +++ b/test/test-case/expected.test.ts @@ -1,5 +1,5 @@ -import {fromContents} from '../../lib-js/spec-directory'; -import {getExpectedResult} from '../../lib-js/test-case/expected'; +import {fromContents} from '../../lib/spec-directory'; +import {getExpectedResult} from '../../lib/test-case/expected'; describe('getExpectedResult()', () => { describe('output', () => { diff --git a/test/test-case/mutation.test.ts b/test/test-case/mutation.test.ts index 3e7ba4718d..ee48f929e5 100644 --- a/test/test-case/mutation.test.ts +++ b/test/test-case/mutation.test.ts @@ -1,5 +1,5 @@ -import {fromContents, SpecDirectory} from '../../lib-js/spec-directory'; -import TestCase from '../../lib-js/test-case'; +import {fromContents, SpecDirectory} from '../../lib/spec-directory'; +import TestCase from '../../lib/test-case'; import {mockCompiler} from '../fixtures/mock-compiler'; function makeHrx(files: Record) { diff --git a/test/test-case/result.test.ts b/test/test-case/result.test.ts index c2b50c7cf9..d51f2a0088 100644 --- a/test/test-case/result.test.ts +++ b/test/test-case/result.test.ts @@ -1,6 +1,6 @@ -import {fromContents} from '../../lib-js/spec-directory'; +import {fromContents} from '../../lib/spec-directory'; import {mockCompiler} from '../fixtures/mock-compiler'; -import TestCase, {TestResult} from '../../lib-js/test-case'; +import TestCase, {TestResult} from '../../lib/test-case'; // TODO most of these tests can be factored out into tests that comparing two results work describe('TestCase::result()', () => { diff --git a/tests/cli_spec.rb b/tests/cli_spec.rb deleted file mode 100644 index 058a4019f2..0000000000 --- a/tests/cli_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -require_relative 'spec_helper' - -RSpec.describe 'run tests', type: :aruba do - it 'runs a single spec' do - run_sass('basic') - - expect(last_command_started).to be_successfully_executed - end - - it 'should not run todo specs by default' do - run_sass('todo') - - expect(last_command_started).to be_successfully_executed - expect(test_results(last_command_started.output)[:skips]).to eq 1 - end - - it 'should run todo specs with --run-todo flag' do - run_sass('todo', ["--run-todo"]) - - expect(last_command_started).to be_successfully_executed - expect(test_results(last_command_started.output)[:skips]).to eq 0 - end - - it 'should not allow limit to take a negative number' do - run_sass('limit', ["--limit -10"]) - - expect(last_command_started).to_not be_successfully_executed - end - - it 'should not allow limit to take a negative number' do - run_sass('limit', ["--run-todo", "--limit 3"]) - - expect(last_command_started).to be_successfully_executed - expect(test_results(last_command_started.output)[:runs]).to eq 3 - end -end diff --git a/tests/directory_spec.rb b/tests/directory_spec.rb deleted file mode 100644 index dafe881940..0000000000 --- a/tests/directory_spec.rb +++ /dev/null @@ -1,900 +0,0 @@ -# coding: utf-8 -# frozen_string_literal: true - -require_relative 'spec_helper' -require 'sass_spec' - -RSpec::Matchers.define_negated_matcher :not_include, :include - -# A regexp that matches an error message that indicates that a file/directory -# doesn't exist. -DOESNT_EXIST = /No such file or directory|doesn't exist|There is no directory/ - -describe SassSpec::Directory do - include_context :uses_fs - after(:each) { SassSpec::Directory._hrx_cache.clear } - - def directory(folder=nil) - SassSpec::Directory.new(dir(folder)) - end - - it 'throws an error if the path is the working directory' do - expect { SassSpec::Directory.new('.') }.to raise_error(". must be beneath the working directory") - end - - it 'throws an error if the path is outside the working directory' do - FileUtils.mkdir_p '/foo/bar/baz' - Dir.chdir '/foo/bar/baz' - expect { SassSpec::Directory.new('/foo') }.to raise_error("/foo must be beneath the working directory") - end - - context 'in a real directory' do - before(:each) { FileUtils.mkdir_p 'spec' } - - it "throws an error if the path doesn't exist" do - expect { directory('foo') }.to raise_error DOESNT_EXIST - end - - describe '#path' do - it 'returns the path relative to the working directory' do - expect(directory.path).to be == Pathname.new(dir) - end - - it 'returns a relative path even if passed an absolute path' do - expect(SassSpec::Directory.new(File.expand_path(dir)).path).to be == Pathname.new(dir) - end - - it 'uses forward slashes even on Windows' do - FileUtils.mkdir_p dir('foo/bar/baz') - expect(directory('foo/bar/baz').path.to_s).to include('/').and not_include("\\") - end - end - - describe '#hrx?' do - it 'returns false' do - expect(directory).not_to be_hrx - end - end - - describe '#parent' do - it 'returns nil if the parent is the cwd' do - expect(directory.parent).to be nil - end - - it 'returns a new directory' do - FileUtils.mkdir_p dir('foo/bar/baz') - expect(directory('foo/bar/baz').parent.to_s).to be == 'spec/foo/bar' - end - end - - describe '#glob' do - it 'returns matching physical files in the directory' do - File.write(dir('foo.txt'), '') - File.write(dir('bar.txt'), '') - File.write(dir('baz'), '') - expect(directory.glob('*.txt')).to contain_exactly('foo.txt', 'bar.txt') - end - - it 'returns matching physical files recursively beneath the directory' do - FileUtils.mkdir_p(dir('foo/bar/baz')) - File.write(dir('foo/bar/baz/zip'), '') - File.write(dir('foo/bar/zap.txt'), '') - File.write(dir('foo/zop'), '') - File.write(dir('qux.txt'), '') - expect(directory.glob('**/*.txt')).to contain_exactly('foo/bar/zap.txt', 'qux.txt') - end - - it 'returns files recursively within an HRX archive' do - FileUtils.mkdir_p(dir('foo')) - File.write(dir('foo/bar.hrx'), < baz/zip.txt -zip -<===> qux/zap -zap -<===> zop.txt -zop -END - expect(directory.glob('**/*.txt')) - .to contain_exactly('foo/bar/baz/zip.txt', 'foo/bar/zop.txt') - end - - it 'returns all files recursively within the directory or an HRX archive' do - FileUtils.mkdir_p(dir('foo')) - File.write(dir('foo/bar.hrx'), < baz/zip -zip -<===> zap -zap -END - File.write(dir('foo/qux'), '') - File.write(dir('bang'), '') - expect(directory.glob('**/*')) - .to contain_exactly('foo/bar/baz/zip', 'foo/bar/zap', 'foo/qux', 'bang') - end - - it "doesn't return an HRX archive itself" do - File.write(dir('foo.hrx'), '') - expect(directory.glob('*')).to be_empty - end - - it "ignores HRX archives when run non-recursively" do - File.write(dir('foo.hrx'), '<===> bar.txt\nbar') - expect(directory.glob('*.txt')).to be_empty - end - end - - describe '#file?' do - it 'returns true if the given file exists' do - File.write(dir('qux.txt'), 'hello!') - expect(directory.file?('qux.txt')).to be true - end - - it 'returns true if the given file exists in a subdirectory' do - FileUtils.mkdir_p dir('foo/bar/baz') - File.write(dir('foo/bar/baz/qux.txt'), 'hello!') - expect(directory.file?('foo/bar/baz/qux.txt')).to be true - end - - it 'returns true if the given file exists in an HRX archive' do - FileUtils.mkdir_p dir('foo') - File.write(dir('foo/bar.hrx'), < baz/qux.txt -hello! -END - expect(directory.file?('foo/bar/baz/qux.txt')).to be true - end - - it 'treats the path as relative to the directory' do - FileUtils.mkdir_p dir('foo/bar/baz') - File.write(dir('foo/bar/baz/qux.txt'), 'hello!') - expect(directory('foo/bar/baz').file?('qux.txt')).to be true - end - - it "returns false if the given file doesn't exist" do - expect(directory.file?('qux.txt')).to be false - end - - it "returns false if the given file doesn't exist in a subdirectory" do - expect(directory.file?('foo/bar/baz/qux.txt')).to be false - end - - it "returns false if the given file doesn't exist in an HRX archive" do - FileUtils.mkdir_p dir('foo') - File.write(dir('foo/bar.hrx'), '') - expect(directory.file?('foo/bar/baz/qux.txt')).to be false - end - - it "returns false if a directory with the given name exists" do - FileUtils.mkdir dir('subdir') - expect(directory.file?('subdir')).to be false - end - end - - describe '#read' do - it 'returns the contents of the given file' do - File.write(dir('qux.txt'), 'hello!') - expect(directory.read('qux.txt')).to be == 'hello!' - end - - it 'returns the contents of a file in a subdirectory' do - FileUtils.mkdir_p dir('foo/bar/baz') - File.write(dir('foo/bar/baz/qux.txt'), 'hello!') - expect(directory.read('foo/bar/baz/qux.txt')).to be == 'hello!' - end - - it 'returns the contents of a file in an HRX archive' do - FileUtils.mkdir_p dir('foo') - File.write(dir('foo/bar.hrx'), "<===> baz/qux.txt\nhello!") - expect(directory.read('foo/bar/baz/qux.txt')).to be == 'hello!' - end - - it 'treats the path as relative to the directory' do - FileUtils.mkdir_p dir('foo/bar/baz') - File.write(dir('foo/bar/baz/qux.txt'), 'hello!') - expect(directory('foo/bar/baz').read('qux.txt')).to be == 'hello!' - end - - context 'with a real filesystem' do - # FakeFS doesn't seem to respect `File.read()`'s encoding. - include_context :uses_real_fs - - it 'reads the file as binary' do - FileUtils.mkdir_p 'spec' - File.write('spec/qux.txt', '👭') - expect(SassSpec::Directory.new('spec').read('qux.txt')) - .to be == '👭'.dup.force_encoding('ASCII-8BIT') - end - end - - it "throws an error if the file doesn't exist" do - expect { directory.read('qux.txt') }.to raise_error DOESNT_EXIST - end - - it "throws an error if the given file doesn't exist in a subdirectory" do - expect { expect(directory.read('foo/bar/baz/qux.txt')) }.to raise_error DOESNT_EXIST - end - - it "throws an error if the given file doesn't exist in an HRX archive" do - FileUtils.mkdir_p dir('foo') - File.write(dir('foo/bar.hrx'), '') - expect { directory.read('foo/bar/baz/qux.txt') }.to raise_error DOESNT_EXIST - end - end - - describe '#write' do - it 'writes the contents of the given file' do - directory.write('qux.txt', 'hello!') - expect(File.read(dir('qux.txt'))).to be == 'hello!' - end - - it 'writes the file in a subdirectory' do - FileUtils.mkdir_p dir('foo/bar/baz') - directory.write('foo/bar/baz/qux.txt', 'hello!') - expect(File.read(dir('foo/bar/baz/qux.txt'))).to be == 'hello!' - end - - it 'writes the file in an HRX archive' do - FileUtils.mkdir_p dir('foo') - File.write(dir('foo/bar.hrx'), '') - directory.write('foo/bar/baz.txt', 'hello!') - expect(File.read(dir('foo/bar.hrx'))).to be == "<===> baz.txt\nhello!" - end - - it 'writes the contents of a file in an HRX archive' do - FileUtils.mkdir_p dir('foo') - File.write(dir('foo/bar.hrx'), "<===> baz/qux.txt\nhello!") - expect(directory.read('foo/bar/baz/qux.txt')).to be == 'hello!' - end - - it 'treats the path as relative to the directory' do - FileUtils.mkdir_p dir('foo/bar/baz') - directory('foo/bar/baz').write('qux.txt', 'hello!') - expect(File.read(dir('foo/bar/baz/qux.txt'))).to be == 'hello!' - end - - it "throws an error if the given subdirectory doesn't exist" do - expect { expect(directory.write('foo/bar/baz/qux.txt', 'hello!')) } - .to raise_error DOESNT_EXIST - end - - it "throws an error if the given subdirectory doesn't exist within an HRX archive" do - FileUtils.mkdir_p dir('foo') - File.write(dir('foo/bar.hrx'), '') - expect { expect(directory.write('foo/bar/baz/qux.txt', 'hello!')) } - .to raise_error DOESNT_EXIST - end - end - - describe '#delete' do - it 'deletes the given file' do - File.write(dir('qux.txt'), '') - directory.delete('qux.txt') - expect(File.exists?(dir('qux.txt'))).to be false - end - - it 'deletes the file in a subdirectory' do - FileUtils.mkdir_p dir('foo/bar/baz') - File.write(dir('foo/bar/baz/qux.txt'), 'hello!') - directory.delete('foo/bar/baz/qux.txt') - expect(File.exists?(dir('foo/bar/baz/qux.txt'))).to be false - end - - it 'deletes the file in an HRX archive' do - FileUtils.mkdir_p dir('foo') - File.write(dir('foo/bar.hrx'), < baz/bang.txt -bang! -<===> baz/qux.txt -qux? -<===> zip/zap.txt -zop~ -END - directory.delete('foo/bar/baz/qux.txt') - expect(File.read(dir('foo/bar.hrx'))).to be == < baz/bang.txt -bang! -<===> zip/zap.txt -zop~ -END - end - - it 'treats the path as relative to the directory' do - FileUtils.mkdir_p dir('foo/bar/baz') - File.write(dir('foo/bar/baz/qux.txt'), '') - directory('foo/bar/baz').delete('qux.txt') - expect(File.exists?(dir('foo/bar/baz/qux.txt'))).to be false - end - - it "throws an error if the file doesn't exist" do - expect { directory.delete('qux.txt') }.to raise_error DOESNT_EXIST - end - - it "throws an error if the given subdirectory doesn't exist" do - expect { expect(directory.delete('foo/bar/baz/qux.txt')) }.to raise_error DOESNT_EXIST - end - - it "throws an error if the given subdirectory doesn't exist within an HRX archive" do - FileUtils.mkdir_p dir('foo') - File.write(dir('foo/bar.hrx'), '') - expect { expect(directory.delete('foo/bar/baz/qux.txt')) } - .to raise_error DOESNT_EXIST - end - - context 'with if_exists' do - it 'deletes the given file' do - File.write(dir('qux.txt'), '') - directory.delete('qux.txt', if_exists: true) - expect(File.exists?(dir('qux.txt'))).to be false - end - - it "does nothing if the file doesn't exist" do - expect { directory.delete('qux.txt', if_exists: true) }.not_to raise_error - end - end - end - - describe '#rename' do - it 'moves the given file' do - File.write(dir('qux.txt'), 'hello!') - directory.rename('qux.txt', 'zip.txt') - expect(File.read(dir('zip.txt'))).to be == 'hello!' - expect(File.exists?(dir('qux.txt'))).to be false - end - - it 'moves the file within a subdirectory' do - FileUtils.mkdir_p dir('foo/bar/baz') - File.write(dir('foo/bar/baz/qux.txt'), 'hello!') - directory.rename('foo/bar/baz/qux.txt', 'foo/bar/baz/zip.txt') - expect(File.read(dir('foo/bar/baz/zip.txt'))).to be == 'hello!' - expect(File.exists?(dir('foo/bar/baz/qux.txt'))).to be false - end - - it 'moves the file between subdirectories' do - FileUtils.mkdir_p dir('foo/bar/baz') - FileUtils.mkdir_p dir('do/re/me') - File.write(dir('foo/bar/baz/qux.txt'), 'hello!') - directory.rename('foo/bar/baz/qux.txt', 'do/re/me/fa.txt') - expect(File.read(dir('do/re/me/fa.txt'))).to be == 'hello!' - expect(File.exists?(dir('foo/bar/baz/qux.txt'))).to be false - end - - it 'moves the file within an HRX archive' do - FileUtils.mkdir_p dir('foo') - File.write(dir('foo/bar.hrx'), "<===> baz/qux.txt\nhello!") - directory.rename('foo/bar/baz/qux.txt', 'foo/bar/baz/zap.txt') - expect(File.read(dir('foo/bar.hrx'))).to be == "<===> baz/zap.txt\nhello!" - end - - it 'moves the file out of an HRX archive' do - FileUtils.mkdir_p dir('foo') - File.write(dir('foo/bar.hrx'), "<===> baz/qux.txt\nhello!") - directory.rename('foo/bar/baz/qux.txt', 'qux.txt') - expect(File.exists?(dir('foo/bar.hrx'))).to be false - expect(File.read(dir('qux.txt'))).to be === 'hello!' - end - - it 'moves the file into an HRX archive' do - FileUtils.mkdir_p dir('foo') - File.write(dir('foo/bar.hrx'), '') - File.write(dir('qux.txt'), 'hello!') - directory.rename('qux.txt', 'foo/bar/baz.txt') - expect(File.exists?(dir('qux.txt'))).to be false - expect(File.read(dir('foo/bar.hrx'))).to be === "<===> baz.txt\nhello!" - end - - it 'moves the file between HRX archives' do - FileUtils.mkdir_p dir('foo') - File.write(dir('foo/bar.hrx'), "<===> baz/qux.txt\nhello!") - File.write(dir('foo/zip.hrx'), '') - directory.rename('foo/bar/baz/qux.txt', 'foo/zip/zap.txt') - expect(File.exists?(dir('foo/bar.hrx'))).to be false - expect(File.read(dir('foo/zip.hrx'))).to be === "<===> zap.txt\nhello!" - end - - it 'treats the path as relative to the directory' do - FileUtils.mkdir_p dir('foo/bar/baz') - File.write(dir('foo/bar/baz/qux.txt'), 'hello!') - directory('foo/bar/baz').rename('qux.txt', 'zip.txt') - expect(File.read(dir('foo/bar/baz/zip.txt'))).to be == 'hello!' - expect(File.exists?(dir('foo/bar/baz/qux.txt'))).to be false - end - - it "throws an error if the file doesn't exist" do - expect { directory.rename('qux.txt', 'zap.txt') }.to raise_error DOESNT_EXIST - end - - it "throws an error if the target directory doesn't exist" do - File.write(dir('qux.txt'), 'hello!') - expect { directory.rename('qux.txt', 'foo/zap.txt') }.to raise_error DOESNT_EXIST - end - end - - describe '#delete_dir!' do - it 'deletes the directory' do - directory.delete_dir! - expect(Dir.exists?(dir)).to be false - end - - it 'deletes the directory even if it contains files' do - File.write(dir('foo.txt'), '') - File.write(dir('bar.txt'), '') - File.write(dir('baz.txt'), '') - directory.delete_dir! - expect(Dir.exists?(dir)).to be false - end - - it 'deletes the directory even if it contains subdirectories' do - FileUtils.mkdir_p dir('foo/bar/baz') - File.write(dir('foo/bar/baz/qux.txt'), '') - directory.delete_dir! - end - - it 'treats the path as relative to the directory' do - FileUtils.mkdir_p dir('foo/bar/baz') - directory('foo/bar/baz').delete_dir! - expect(Dir.exists?(dir('foo/bar/baz'))).to be false - expect(Dir.exists?(dir('foo/bar'))).to be true - end - end - - describe '#with_real_files' do - it 'runs the block without any filesystem changes' do - dir = directory - dir.write('qux.txt', 'hello!') - dir.with_real_files do - expect(File.read(dir('qux.txt'))).to be == 'hello!' - end - end - - it 'forwards the return value from the block' do - expect(directory.with_real_files {:result}).to be :result - end - end - - describe '#to_hrx' do - it 'returns an empty string for an empty directory' do - expect(directory.to_hrx).to be_empty - end - - it 'returns files in the directory' do - dir = directory - dir.write('foo.txt', 'foo') - dir.write('bar.txt', 'bar') - dir.write('baz.txt', 'baz') - - # Slice the string because directory ordering is not guaranteed. - expect(dir.to_hrx.split("\n").each_slice(2).map {|s| s.join("\n")}).to contain_exactly( - "<===> spec/foo.txt\nfoo", - "<===> spec/bar.txt\nbar", - "<===> spec/baz.txt\nbaz" - ) - end - - it 'returns files in subdirectories' do - FileUtils.mkdir_p(dir('foo/bar/baz')) - File.write(dir('foo/bar/baz/qux.txt'), 'hello!') - expect(directory.to_hrx).to be == "<===> spec/foo/bar/baz/qux.txt\nhello!" - end - - it 'returns files in HRX archives' do - File.write(dir('archive.hrx'), < foo.txt -foo -<===> subdir/bar.txt -bar -END - expect(directory.to_hrx).to be == < spec/archive/foo.txt -foo -<===> spec/archive/subdir/bar.txt -bar -END - end - end - end - - context 'in an HRX directory' do - it "throws an error if the path doesn't exist" do - File.write('spec.hrx', '') - expect { directory('foo') }.to raise_error DOESNT_EXIST - end - - describe '#path' do - it 'returns the path relative to the working directory' do - File.write('spec.hrx', '') - expect(directory.path).to be == Pathname.new(dir) - end - - it 'returns a relative path even if passed an absolute path' do - File.write('spec.hrx', '') - expect(SassSpec::Directory.new(File.expand_path(dir)).path).to be == Pathname.new(dir) - end - - it 'uses forward slashes even on Windows' do - File.write('spec.hrx', "<===> foo/bar/baz/bang.txt\nbang") - expect(directory('foo/bar/baz').path.to_s).to include('/').and not_include("\\") - end - end - - describe '#hrx?' do - it 'returns false' do - File.write('spec.hrx', '') - expect(directory).to be_hrx - end - end - - describe '#parent' do - it 'returns nil if the parent is the cwd' do - File.write('spec.hrx', '') - expect(directory.parent).to be nil - end - - it 'returns a new directory' do - File.write('spec.hrx', "<===> foo/bar/baz/bang.txt\nbang") - FileUtils.mkdir_p dir('foo/bar/baz') - expect(directory('foo/bar/baz').parent.to_s).to be == 'spec/foo/bar' - end - end - - describe '#glob' do - it 'returns matching files in the directory' do - File.write('spec.hrx', < foo.txt -foo -<===> bar.txt -bar -<===> baz -baz -END - expect(directory.glob('*.txt')).to contain_exactly('foo.txt', 'bar.txt') - end - - it "doesn't return directories" do - File.write('spec.hrx', "<===> foo/\n") - expect(directory.glob('*')).to be_empty - end - end - - describe '#file?' do - it 'returns true if the given file exists' do - File.write('spec.hrx', "<===> qux.txt\nhello!") - expect(directory.file?('qux.txt')).to be true - end - - it 'returns true if the given file exists in a subdirectory' do - File.write('spec.hrx', "<===> foo/bar/baz/qux.txt\nhello!") - expect(directory.file?('foo/bar/baz/qux.txt')).to be true - end - - it 'treats the path as relative to the directory' do - File.write('spec.hrx', "<===> foo/bar/baz/qux.txt\nhello!") - expect(directory('foo/bar/baz').file?('qux.txt')).to be true - end - - it "returns false if the given file doesn't exist" do - File.write('spec.hrx', '') - expect(directory.file?('qux.txt')).to be false - end - - it "returns false if the given file doesn't exist in a subdirectory" do - File.write('spec.hrx', '') - expect(directory.file?('foo/bar/baz/qux.txt')).to be false - end - - it "returns false if a directory with the given name exists" do - File.write('spec.hrx', "<===> subdir/\n") - expect(directory.file?('subdir')).to be false - end - end - - describe '#read' do - it 'returns the contents of the given file' do - File.write('spec.hrx', "<===> qux.txt\nhello!") - expect(directory.read('qux.txt')).to be == 'hello!' - end - - it 'returns the contents of a file in a subdirectory' do - File.write('spec.hrx', "<===> foo/bar/baz/qux.txt\nhello!") - expect(directory.read('foo/bar/baz/qux.txt')).to be == 'hello!' - end - - it 'treats the path as relative to the directory' do - File.write('spec.hrx', "<===> foo/bar/baz/qux.txt\nhello!") - expect(directory('foo/bar/baz').read('qux.txt')).to be == 'hello!' - end - - it "throws an error if the file doesn't exist" do - File.write('spec.hrx', '') - expect { directory.read('qux.txt') }.to raise_error(/There is no file/) - end - - it "throws an error if the given file doesn't exist in a subdirectory" do - File.write('spec.hrx', '') - expect { expect(directory.read('foo/bar/baz/qux.txt')) }.to raise_error(/There is no file/) - end - end - - describe '#write' do - it 'writes the contents of the given file' do - File.write('spec.hrx', '') - directory.write('qux.txt', 'hello!') - expect(File.read('spec.hrx')).to be == "<===> qux.txt\nhello!" - end - - it 'writes the file in a subdirectory' do - File.write('spec.hrx', '') - directory.write('foo/bar/baz/qux.txt', 'hello!') - expect(File.read('spec.hrx')).to be == "<===> foo/bar/baz/qux.txt\nhello!" - end - - it 'treats the path as relative to the directory' do - File.write('spec.hrx', "<===> foo/bar/baz/zap.txt\nzap") - directory('foo/bar/baz').write('qux.txt', "hello!\n") - expect(File.read('spec.hrx')).to be == < foo/bar/baz/zap.txt -zap -<===> foo/bar/baz/qux.txt -hello! -END - end - end - - describe '#delete' do - it 'deletes the given file' do - File.write('spec.hrx', < qux.txt -hello -<===> zap.txt -world -END - directory.delete('qux.txt') - expect(File.read('spec.hrx')).to be == "<===> zap.txt\nworld\n" - end - - it "deletes the HRX file if the given file is the last one" do - File.write('spec.hrx', "<===> qux.txt\nhello!") - directory.delete('qux.txt') - expect(File.exists?('spec.hrx')).to be false - end - - it 'deletes the file in a subdirectory' do - File.write('spec.hrx', < foo/bar/baz/qux.txt -hello -<===> zap.txt -world -END - directory.delete('foo/bar/baz/qux.txt') - expect(File.read('spec.hrx')).to be == "<===> zap.txt\nworld\n" - end - - it 'treats the path as relative to the directory' do - File.write('spec.hrx', "<===> foo/bar/baz/qux.txt\nhello!") - directory('foo/bar/baz').delete('qux.txt') - expect(File.exists?('spec.hrx')).to be false - end - - it "throws an error if the file doesn't exist" do - File.write('spec.hrx', '') - expect { directory.delete('qux.txt') }.to raise_error(/doesn't exist/) - end - - it "throws an error if the given subdirectory doesn't exist" do - File.write('spec.hrx', '') - expect { expect(directory.delete('foo/bar/baz/qux.txt')) }.to raise_error DOESNT_EXIST - end - - context 'with if_exists' do - it 'deletes the given file' do - File.write('spec.hrx', < qux.txt -hello -<===> zap.txt -world -END - directory.delete('qux.txt', if_exists: true) - expect(File.read('spec.hrx')).to be == "<===> zap.txt\nworld\n" - end - - it "does nothing if the file doesn't exist" do - File.write('spec.hrx', "<===> zap.txt\nworld") - expect { directory.delete('qux.txt', if_exists: true) }.not_to raise_error - expect(File.read('spec.hrx')).to be == "<===> zap.txt\nworld" - end - end - end - - describe '#rename' do - it 'moves the given file' do - File.write('spec.hrx', "<===> qux.txt\nhello!") - directory.rename('qux.txt', 'zip.txt') - expect(File.read('spec.hrx')).to be == "<===> zip.txt\nhello!" - end - - it 'preserves an HRX comment' do - File.write('spec.hrx', < -comment! -<===> qux.txt -hello! -END - directory.rename('qux.txt', 'zip.txt') - expect(File.read('spec.hrx')).to be == < -comment! -<===> zip.txt -hello! -END - end - - it 'moves the file within a subdirectory' do - File.write('spec.hrx', "<===> foo/bar/baz/qux.txt\nhello!") - directory.rename('foo/bar/baz/qux.txt', 'foo/bar/baz/zip.txt') - expect(File.read('spec.hrx')).to be == "<===> foo/bar/baz/zip.txt\nhello!" - end - - it 'moves the file between subdirectories' do - File.write('spec.hrx', < foo/bar/baz/qux.txt -hello! - -<===> do/re/me/zap.txt -zap -END - directory.rename('foo/bar/baz/qux.txt', 'do/re/me/fa.txt') - expect(File.read('spec.hrx')).to be == < do/re/me/zap.txt -zap - -<===> do/re/me/fa.txt -hello! -END - end - - it 'treats the path as relative to the directory' do - File.write('spec.hrx', "<===> foo/bar/baz/qux.txt\nhello!") - directory('foo/bar/baz').rename('qux.txt', 'zip.txt') - expect(File.read('spec.hrx')).to be == "<===> foo/bar/baz/zip.txt\nhello!" - end - - it "throws an error if the file doesn't exist" do - File.write('spec.hrx', '') - expect { directory.rename('qux.txt', 'zap.txt') }.to raise_error(/doesn't exist/) - end - - it "throws an error if the target directory doesn't exist" do - File.write('spec.hrx', "<===> foo/qux.txt\nhello!") - expect { directory.rename('qux.txt', 'foo/zap.txt') }.to raise_error DOESNT_EXIST - end - end - - describe '#delete_dir!' do - it 'deletes the entire HRX file' do - File.write('spec.hrx', '') - directory.delete_dir! - expect(File.exists?('spec.hrx')).to be false - end - - it 'deletes a subdirectory within an HRX file' do - File.write('spec.hrx', < foo/bar/baz.txt -baz -<===> foo/bar/bang.txt -bang -<===> foo/qux.txt -qux -END - directory('foo/bar').delete_dir! - File.write('spec.hrx', "<===> foo/qux.txt\nqux") - end - - it "deletes a parent HRX file if it's now empty" do - File.write('spec.hrx', < foo/bar/baz.txt -baz -<===> foo/bar/bang.txt -bang -END - directory('foo/bar').delete_dir! - expect(File.exists?('spec.hrx')).to be false - end - end - - describe '#with_real_files' do - it 'creates physical files for files in the archive' do - File.write('spec.hrx', < foo.txt -foo -<===> bar.txt -bar -<===> baz.txt -baz -END - - directory.with_real_files do - expect(File.read('spec/foo.txt')).to be == 'foo' - expect(File.read('spec/bar.txt')).to be == 'bar' - expect(File.read('spec/baz.txt')).to be == "baz\n" - end - end - - it 'deletes physical files after the block' do - File.write('spec.hrx', "<===> foo.txt\nfoo") - directory.with_real_files {} - expect(Dir.exists?('spec')).to be false - end - - it 'only materializes a subdirectory if necessary' do - File.write('spec.hrx', < foo/bar/baz/qux.txt -qux -<===> foo/bar/baz.txt -baz -<===> foo/bar.txt -bar -END - - directory('foo/bar/baz').with_real_files do - expect(File.read('spec/foo/bar/baz/qux.txt')).to be == 'qux' - expect(File.exists?('spec/foo/bar/baz.txt')).to be false - expect(File.exists?('spec/foo/bar.txt')).to be false - end - end - - it 'deletes the parent directory after a subdirectory is materialized' do - File.write('spec.hrx', "<===> foo/bar/baz/qux.txt\nhello!") - directory('foo/bar/baz').with_real_files {} - expect(Dir.exists?('spec')).to be false - end - - it 'only materializes a parent directory if the subdirectory reaches out' do - File.write('spec.hrx', < foo/bar/baz/qux.txt -../../bar.txt -<===> foo/bar.txt -bar -<===> foo.txt -foo -END - - directory('foo/bar/baz').with_real_files do - expect(File.read('spec/foo/bar/baz/qux.txt')).to be == '../../bar.txt' - expect(File.read('spec/foo/bar.txt')).to be == 'bar' - expect(File.exists?('spec/foo.txt')).to be false - end - end - end - - describe '#to_hrx' do - it 'returns an empty string for an empty directory' do - File.write('spec.hrx', '') - expect(directory.to_hrx).to be_empty - end - - it 'returns files in the directory' do - File.write('spec.hrx', < foo.txt -foo -<===> bar.txt -bar -<===> baz.txt -baz -END - - expect(directory.to_hrx).to be == < spec/foo.txt -foo -<===> spec/bar.txt -bar -<===> spec/baz.txt -baz -END - end - - it 'returns files in subdirectories' do - File.write('spec.hrx', "<===> foo/bar/baz/qux.txt\nhello!") - expect(directory.to_hrx).to be == "<===> spec/foo/bar/baz/qux.txt\nhello!" - end - end - end -end diff --git a/tests/fixtures/basic/basic.hrx b/tests/fixtures/basic/basic.hrx deleted file mode 100644 index f4632693c4..0000000000 --- a/tests/fixtures/basic/basic.hrx +++ /dev/null @@ -1,9 +0,0 @@ -<===> input.scss -p { - color: #ff8000; -} -<===> output.css -input: ["--precision", "10", "--style", "expanded", "input.scss"] -file: p { - color: #ff8000; -} diff --git a/tests/fixtures/limit/basic.hrx b/tests/fixtures/limit/basic.hrx deleted file mode 100644 index 6d02c21713..0000000000 --- a/tests/fixtures/limit/basic.hrx +++ /dev/null @@ -1,51 +0,0 @@ -<===> limit/1/input.scss -p { - color: #ff8000; -} - -<===> limit/1/output.css -input: ["--precision", "10", "--style", "expanded", "input.scss"] -file: p { - color: #ff8000; -} - -<===> -============================================================ -<===> limit/2/input.scss -p { - color: #ff8000; -} - -<===> limit/2/output.css -input: ["--precision", "10", "--style", "expanded", "input.scss"] -file: p { - color: #ff8000; -} - -<===> -============================================================ -<===> limit/3/input.scss -p { - color: #ff8000; -} - -<===> limit/3/output.css -input: ["--precision", "10", "--style", "expanded", "input.scss"] -file: p { - color: #ff8000; -} - -<===> -============================================================ -<===> limit/4/input.scss -p { - color: #ff8000; -} - -<===> limit/4/output.css -input: ["--precision", "10", "--style", "expanded", "input.scss"] -file: p { - color: #ff8000; -} - -<===> diff --git a/tests/fixtures/todo/basic.hrx b/tests/fixtures/todo/basic.hrx deleted file mode 100644 index f580d4e45b..0000000000 --- a/tests/fixtures/todo/basic.hrx +++ /dev/null @@ -1,29 +0,0 @@ -<===> no_todo/input.scss -p { - color: #ff8000; -} - -<===> no_todo/output.css -input: ["--precision", "10", "--style", "expanded", "input.scss"] -file: p { - color: #ff8000; -} - -<===> -============================================================= -<===> todo/options.yml ---- -:todo: -- sass/sass#0000 - -<===> todo/input.scss -p { - color: #ff8000; -} - -<===> todo/output.css -input: ["--precision", "10", "--style", "expanded", "input.scss"] -file: p { - color: #ff8000; -} - diff --git a/tests/sass_stub b/tests/sass_stub deleted file mode 100755 index f560e3c232..0000000000 --- a/tests/sass_stub +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# This program stubs out the Sass CLI. It does not apply any Sass -# transformations and simply outputs the input file to stdout. - -# Version flag needs to return a value. -if ARGV.last == '--version' - puts '0.1' -else - # sass-spec passes in full paths to the -I command. We should - # omit that path. - args = ARGV - arg_position_I = ARGV.index("-I") - # Array is shifted post_delete, so -I path will be at arg_position_I on second delete. - 2.times { ARGV.delete_at(arg_position_I) } if arg_position_I - puts ["input: #{args.inspect}", "file: #{File.read(ARGV.last)}"].join("\n") -end diff --git a/tests/spec_helper.rb b/tests/spec_helper.rb deleted file mode 100644 index 99d432f09d..0000000000 --- a/tests/spec_helper.rb +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 -# frozen_string_literal: true - -require 'fakefs/spec_helpers' -require 'rspec' -require 'aruba/rspec' - -Aruba.configure do |config| - config.allow_absolute_paths = true -end - -# Given the output of sass-spec, -# return the number of tests in -# each state (success, failed, etc) -def test_results(output) - results = {} - matches = output.match( - /(?\d+) runs, (?\d+) assertions, (?\d+) failures, (?\d+) errors, (?\d+) skips/ - ) - matches.names.each { |k, v| results[k.to_sym] = matches[k].to_i } - results -end - -# Gives a command string that Aruba should run for a unit test. -# This command calls sass-spec using the sass stub. -# It takes in the name of a fixture folder and an array of additional flags. -def run_sass(fixture_folder, additional_flags = []) - copy "#{Dir.pwd}/tests/fixtures/#{fixture_folder}", 'tmp/aruba/spec' - run_command([ - "#{Dir.pwd}/sass-spec.rb #{additional_flags.join(' ')}", - "--command '#{Dir.pwd}/tests/sass_stub'", - 'tmp/aruba/spec' - ].join(' ')) -end - -# A context with a mocked filesystem. -shared_context :uses_fs do - include FakeFS::SpecHelpers - - # Returns `subdir` within the root spec directory. If `subdir` isn't passed, - # returns `'spec'` on its own. - def dir(subdir=nil) - subdir ? File.join('spec', subdir) : 'spec' - end -end - -# A context with a real temporary filesystem, for cases where mock_fs doesn't -# quite work. -shared_context :uses_real_fs do - before(:each) { FakeFS.deactivate! } - - around do |example| - Dir.mktmpdir('sass-spec-tests-') do |dir| - @dir = dir - Dir.chdir(dir) { example.run } - end - end - - def dir(subdir=nil) - subdir ? File.join('spec', subdir) : 'spec' - end -end diff --git a/tests/test_case_metadata_spec.rb b/tests/test_case_metadata_spec.rb deleted file mode 100644 index 1ac15dde7c..0000000000 --- a/tests/test_case_metadata_spec.rb +++ /dev/null @@ -1,101 +0,0 @@ -# frozen_string_literal: true - -require_relative 'spec_helper' -require 'sass_spec' - -describe SassSpec::TestCaseMetadata do - include_context :uses_fs - after(:each) { SassSpec::TestCaseMetadata.cache.clear } - - def create_options_yaml(folder=nil, dictionary) - dir = self.dir(folder) - FileUtils.mkdir_p(dir) - File.write(File.join(dir, 'options.yml'), dictionary.to_yaml) - end - - def metadata(folder=nil) - SassSpec::TestCaseMetadata.new(SassSpec::Directory.new(self.dir(folder))) - end - - describe '#initialize' do - it 'should load all options from the directory' do - create_options_yaml(foo: 'bar', baz: 'qux', zip: 'zap') - expect(metadata.options).to be == {foo: 'bar', baz: 'qux', zip: 'zap'} - end - - context 'with a parent directory' do - it 'should include options from the parent and child' do - create_options_yaml(foo: 'bar') - create_options_yaml('child', baz: 'qux') - create_options_yaml('child/grandchild', zip: 'zap') - expect(metadata('child/grandchild').options).to be == {foo: 'bar', baz: 'qux', zip: 'zap'} - end - - it 'should prefer child options to parent options' do - create_options_yaml(foo: 'parent') - create_options_yaml('child', foo: 'child') - expect(metadata('child').options).to be == {foo: 'child'} - end - - it 'should consider directories without options to have empty options' do - create_options_yaml(foo: 'bar') - create_options_yaml('child/grandchild', baz: 'qux') - expect(metadata('child/grandchild').options).to be == {foo: 'bar', baz: 'qux'} - end - - context 'and mergeable options' do - it 'should add each value to a list' do - create_options_yaml(ignore_for: 'dart-sass') - create_options_yaml('child', ignore_for: 'libsass') - create_options_yaml('child/grandchild', ignore_for: 'future-sass') - expect(metadata('child/grandchild').options).to( - be == {ignore_for: %w[dart-sass libsass future-sass]}) - end - - it 'should concatenate list values' do - create_options_yaml(ignore_for: 'dart-sass') - create_options_yaml('child', ignore_for: ['libsass', 'future-sass']) - expect(metadata('child').options).to( - be == {ignore_for: %w[dart-sass libsass future-sass]}) - end - end - end - end - - it 'should ignore impl when given ignore_for' do - create_options_yaml(ignore_for: ['dart-sass']) - expect(metadata.ignore_for?('dart-sass')).to be true - end - - it 'should ignore impl when given only_on' do - create_options_yaml(only_on: ['dart-sass']) - expect(metadata.ignore_for?('libsass')).to be true - end - - it 'should have precision' do - create_options_yaml(precision: 10) - expect(metadata.precision).to eq 10 - end - - context 'with todos' do - it 'should load todos from implementation names' do - create_options_yaml(todo: ['libsass']) - expect(metadata.todo?('libsass')).to be true - end - - it 'should load warning_todos from implementation names' do - create_options_yaml(warning_todo: ['libsass']) - expect(metadata.warning_todo?('libsass')).to be true - end - - it 'should load todos from issue numbers' do - create_options_yaml(todo: ['sass/libsass#2342']) - expect(metadata.todo?('libsass')).to be true - end - - it 'should load warning_todos from issue numbers' do - create_options_yaml(warning_todo: ['sass/libsass#2342']) - expect(metadata.warning_todo?('libsass')).to be true - end - end -end diff --git a/tsconfig.json b/tsconfig.json index 27e36773f6..3d0b7633c2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,5 +5,5 @@ "rootDir": ".", "lib": ["ES2020"] }, - "include": ["lib-js/**/*.ts", "test/**/*.ts"] + "include": ["lib/**/*.ts", "test/**/*.ts"] } From 03854d99087d780765a64785852a352545f1fe6f Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Thu, 8 Dec 2022 15:37:19 -0800 Subject: [PATCH 5/9] Update JS API tests as well --- js-api-spec/value/color.test.ts | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/js-api-spec/value/color.test.ts b/js-api-spec/value/color.test.ts index 919be53009..40fb72ef8d 100644 --- a/js-api-spec/value/color.test.ts +++ b/js-api-spec/value/color.test.ts @@ -69,7 +69,8 @@ describe('SassColor', () => { expect(() => rgb(255, 255, 255, 1)).not.toThrow(); }); - it('disallows invalid values', () => { + // TODO(#1828): Update these expectations + it.skip('disallows invalid values', () => { expect(() => rgb(-1, 0, 0, 0)).toThrow(); expect(() => rgb(0, -1, 0, 0)).toThrow(); expect(() => rgb(0, 0, -1, 0)).toThrow(); @@ -80,7 +81,8 @@ describe('SassColor', () => { expect(() => rgb(0, 0, 0, 1.1)).toThrow(); }); - it('rounds channels to the nearest integer', () => { + // TODO(#1828): Update these expectations + it.skip('rounds channels to the nearest integer', () => { expect(rgb(0.1, 50.4, 90.3)).toEqualWithHash(rgb(0, 50, 90)); expect(rgb(-0.1, 50.5, 90.7)).toEqualWithHash(rgb(0, 51, 91)); }); @@ -178,15 +180,16 @@ describe('SassColor', () => { it('has HWB channels', () => { expect(color.hue).toBe(120); - expect(color.whiteness).toBe(24.313725490196077); - expect(color.blackness).toBe(40.3921568627451); + expect(color.whiteness).toBe(24.360000000000003); + expect(color.blackness).toBe(40.36000000000001); }); it('has an alpha channel', () => { expect(color.alpha).toBe(1); }); - it('equals the same color', () => { + // TODO(#1828): Update these expectations + it.skip('equals the same color', () => { expect(color).toEqualWithHash(rgb(62, 152, 62)); expect(color).toEqualWithHash(hsl(120, 42, 42)); expect(color).toEqualWithHash( @@ -214,21 +217,22 @@ describe('SassColor', () => { it('has HSL channels', () => { expect(color.hue).toBe(120); - expect(color.saturation).toBe(16.078431372549026); + expect(color.saturation).toBe(16.000000000000007); expect(color.lightness).toBe(50); }); it('has HWB channels', () => { expect(color.hue).toBe(120); - expect(color.whiteness).toBe(41.96078431372549); - expect(color.blackness).toBe(41.96078431372548); + expect(color.whiteness).toBe(42); + expect(color.blackness).toBe(42); }); it('has an alpha channel', () => { expect(color.alpha).toBe(1); }); - it('equals the same color', () => { + // TODO(#1828): Update these expectations + it.skip('equals the same color', () => { expect(color).toEqualWithHash(rgb(107, 148, 107)); expect(color).toEqualWithHash(hsl(120, 16.078431372549026, 50)); expect(color).toEqualWithHash( @@ -272,7 +276,8 @@ describe('SassColor', () => { expect(color.change({alpha: 1}).alpha).toBe(1); }); - it('disallows invalid values', () => { + // TODO(#1828): Update these expectations + it.skip('disallows invalid values', () => { expect(() => color.change({red: -1})).toThrow(); expect(() => color.change({red: 256})).toThrow(); expect(() => color.change({green: -1})).toThrow(); @@ -283,7 +288,8 @@ describe('SassColor', () => { expect(() => color.change({alpha: 1.1})).toThrow(); }); - it('rounds channels to the nearest integer', () => { + // TODO(#1828): Update these expectations + it.skip('rounds channels to the nearest integer', () => { expect( color.change({red: 0.1, green: 50.4, blue: 90.3}) ).toEqualWithHash(rgb(0, 50, 90)); @@ -371,10 +377,10 @@ describe('SassColor', () => { it('allows valid values', () => { expect(color.change({whiteness: 0}).whiteness).toBe(0); - expect(color.change({whiteness: 100}).whiteness).toBe(60.0); + expect(color.change({whiteness: 100}).whiteness).toBe(60.141509433962256); expect(color.change({blackness: 0}).blackness).toBe(0); expect(color.change({blackness: 100}).blackness).toBe( - 93.33333333333333 + 93.4065934065934 ); expect(color.change({alpha: 0}).alpha).toBe(0); expect(color.change({alpha: 1}).alpha).toBe(1); From aa7c07a0678e6d733d4c9b4d268237144e5c85f1 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Thu, 8 Dec 2022 15:43:42 -0800 Subject: [PATCH 6/9] Skip dart-sass-embedded tests with `[skip dart-sass]` --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ec8be5099..59f1e89b99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,7 +164,10 @@ jobs: js_api_sass_embedded: name: "JS API | sass-embedded | Node ${{ matrix.node_version }} | ${{ matrix.os }}" runs-on: "${{ matrix.os }}" - if: "github.event_name != 'pull_request' || !contains(github.event.pull_request.body, 'skip sass-embedded')" + if: >- + github.event_name != 'pull_request' || + (!contains(github.event.pull_request.body, 'skip sass-embedded') && + !contains(github.event.pull_request.body, 'skip dart-sass'))" strategy: fail-fast: false From 38891c644a0fa852ea914708182ffe6ec14d7147 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Thu, 8 Dec 2022 15:47:03 -0800 Subject: [PATCH 7/9] Fix a typo --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 59f1e89b99..7d60afe0bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -167,7 +167,7 @@ jobs: if: >- github.event_name != 'pull_request' || (!contains(github.event.pull_request.body, 'skip sass-embedded') && - !contains(github.event.pull_request.body, 'skip dart-sass'))" + !contains(github.event.pull_request.body, 'skip dart-sass')) strategy: fail-fast: false From acefa77830ca836cf2ce6d77015af2c4e63cbe42 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Thu, 8 Dec 2022 15:48:23 -0800 Subject: [PATCH 8/9] npm run fix --- js-api-spec/value/color.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js-api-spec/value/color.test.ts b/js-api-spec/value/color.test.ts index 40fb72ef8d..8b8342eb6e 100644 --- a/js-api-spec/value/color.test.ts +++ b/js-api-spec/value/color.test.ts @@ -377,11 +377,11 @@ describe('SassColor', () => { it('allows valid values', () => { expect(color.change({whiteness: 0}).whiteness).toBe(0); - expect(color.change({whiteness: 100}).whiteness).toBe(60.141509433962256); - expect(color.change({blackness: 0}).blackness).toBe(0); - expect(color.change({blackness: 100}).blackness).toBe( - 93.4065934065934 + expect(color.change({whiteness: 100}).whiteness).toBe( + 60.141509433962256 ); + expect(color.change({blackness: 0}).blackness).toBe(0); + expect(color.change({blackness: 100}).blackness).toBe(93.4065934065934); expect(color.change({alpha: 0}).alpha).toBe(0); expect(color.change({alpha: 1}).alpha).toBe(1); }); From 92fb2e560f4c92a39a36ece27b258f042ce2405f Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Thu, 8 Dec 2022 15:59:25 -0800 Subject: [PATCH 9/9] Undo @debug output updates --- spec/libsass-closed-issues/issue_1240.hrx | 6 +++--- spec/libsass-closed-issues/issue_1768.hrx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/libsass-closed-issues/issue_1240.hrx b/spec/libsass-closed-issues/issue_1240.hrx index 760455d3a2..051ad6855b 100644 --- a/spec/libsass-closed-issues/issue_1240.hrx +++ b/spec/libsass-closed-issues/issue_1240.hrx @@ -23,6 +23,6 @@ div { <===> warning input.scss:5 DEBUG: 1 -input.scss:6 DEBUG: (2, 3) -input.scss:7 DEBUG: (1 (2, 3)) -input.scss:8 DEBUG: (1 (2, 3)) +input.scss:6 DEBUG: 2, 3 +input.scss:7 DEBUG: 1 (2, 3) +input.scss:8 DEBUG: 1 (2, 3) diff --git a/spec/libsass-closed-issues/issue_1768.hrx b/spec/libsass-closed-issues/issue_1768.hrx index c587efd9a9..f77fffccff 100644 --- a/spec/libsass-closed-issues/issue_1768.hrx +++ b/spec/libsass-closed-issues/issue_1768.hrx @@ -7,6 +7,6 @@ <===> warning input.scss:1 DEBUG: () -input.scss:2 DEBUG: (foo, (), bar) -input.scss:3 DEBUG: (foo () bar) +input.scss:2 DEBUG: foo, (), bar +input.scss:3 DEBUG: foo () bar input.scss:4 DEBUG: (foo: (), bar: baz)