From 271999543df62b56589f07437689a374e32b0651 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Tue, 28 Jan 2025 13:20:59 -0500 Subject: [PATCH] Test whitespace in functions and parentheses --- spec/callable/whitespace.hrx | 18 ++++ spec/core_functions/global/newlines.hrx | 122 ++++++++++++++++++++++++ spec/core_functions/newlines.hrx | 62 ++++++++++++ spec/css/functions/newlines.hrx | 105 ++++++++++++++++++++ spec/values/maps/sass.hrx | 8 ++ 5 files changed, 315 insertions(+) create mode 100644 spec/core_functions/global/newlines.hrx create mode 100644 spec/core_functions/newlines.hrx create mode 100644 spec/css/functions/newlines.hrx diff --git a/spec/callable/whitespace.hrx b/spec/callable/whitespace.hrx index 143d0b798..30f192970 100644 --- a/spec/callable/whitespace.hrx +++ b/spec/callable/whitespace.hrx @@ -76,6 +76,14 @@ <===> newlines/function/after_colon/sass/output.css +<===> +================================================================================ +<===> newlines/function/space_after_colon/sass/input.sass +@function a($b, $c: d + e) + +<===> newlines/function/space_after_colon/sass/output.css + <===> ================================================================================ <===> newlines/function/before_paren/scss/input.scss @@ -234,6 +242,16 @@ $e: a(f, $c: <===> newlines/function_invocation/after_colon/sass/output.css +<===> +================================================================================ +<===> newlines/function_invocation/space_after_colon/sass/input.sass +@function a($b, $c:d) + @return null +$e: a(f, $c: g + h) + +<===> newlines/function_invocation/space_after_colon/sass/output.css + <===> ================================================================================ <===> newlines/function_invocation/before_paren/scss/input.scss diff --git a/spec/core_functions/global/newlines.hrx b/spec/core_functions/global/newlines.hrx new file mode 100644 index 000000000..d3c0633e1 --- /dev/null +++ b/spec/core_functions/global/newlines.hrx @@ -0,0 +1,122 @@ +<===> after_paren/input.sass +a + b: append( + c d, e) + +<===> after_paren/output.css +a { + b: c d e; +} + +<===> after_paren/warning +DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. +Use list.append instead. + +More info and automated migrator: https://sass-lang.com/d/import + + , +2 | b: append( + | ,------^ +3 | \ c d, e) + ' + input.sass 2:6 root stylesheet + +<===> +================================================================================ +<===> after_value/input.sass +a + b: append(c + d, e) + +<===> after_value/output.css +a { + b: c d e; +} + +<===> after_value/warning +DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. +Use list.append instead. + +More info and automated migrator: https://sass-lang.com/d/import + + , +2 | b: append(c + | ,------^ +3 | \ d, e) + ' + input.sass 2:6 root stylesheet + +<===> +================================================================================ +<===> before_comma/input.sass +a + b: append(c d + , e) + +<===> before_comma/output.css +a { + b: c d e; +} + +<===> before_comma/warning +DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. +Use list.append instead. + +More info and automated migrator: https://sass-lang.com/d/import + + , +2 | b: append(c d + | ,------^ +3 | \ , e) + ' + input.sass 2:6 root stylesheet + +<===> +================================================================================ +<===> after_comma/input.sass +a + b: append(c d, + e) + +<===> after_comma/output.css +a { + b: c d e; +} + +<===> after_comma/warning +DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. +Use list.append instead. + +More info and automated migrator: https://sass-lang.com/d/import + + , +2 | b: append(c d, + | ,------^ +3 | \ e) + ' + input.sass 2:6 root stylesheet + +<===> +================================================================================ +<===> before_paren/input.sass +a + b: append(c d, e + ) + +<===> before_paren/output.css +a { + b: c d e; +} + +<===> before_paren/warning +DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. +Use list.append instead. + +More info and automated migrator: https://sass-lang.com/d/import + + , +2 | b: append(c d, e + | ,------^ +3 | \ ) + ' + input.sass 2:6 root stylesheet diff --git a/spec/core_functions/newlines.hrx b/spec/core_functions/newlines.hrx new file mode 100644 index 000000000..ff75b3852 --- /dev/null +++ b/spec/core_functions/newlines.hrx @@ -0,0 +1,62 @@ +<===> after_paren/input.sass +@use "sass:list"; +a + b: list.append( + c d, e) + +<===> after_paren/output.css +a { + b: c d e; +} + +<===> +================================================================================ +<===> after_value/input.sass +@use "sass:list"; +a + b: list.append(c + d, e) + +<===> after_value/output.css +a { + b: c d e; +} + +<===> +================================================================================ +<===> before_comma/input.sass +@use "sass:list"; +a + b: list.append(c d + , e) + +<===> before_comma/output.css +a { + b: c d e; +} + +<===> +================================================================================ +<===> after_comma/input.sass +@use "sass:list"; +a + b: list.append(c d, + e) + +<===> after_comma/output.css +a { + b: c d e; +} + +<===> +================================================================================ +<===> before_paren/input.sass +@use "sass:list"; +a + b: list.append(c d, e + ) + +<===> before_paren/output.css +a { + b: c d e; +} diff --git a/spec/css/functions/newlines.hrx b/spec/css/functions/newlines.hrx new file mode 100644 index 000000000..811ae3b99 --- /dev/null +++ b/spec/css/functions/newlines.hrx @@ -0,0 +1,105 @@ +<===> value/before/input.sass +a + b: c( + d) + +<===> value/before/output.css +a { + b: c(d); +} + +<===> +================================================================================ +<===> value/after/input.sass +a + b: c(d + ) + +<===> value/after/output.css +a { + b: c(d); +} + +<===> +================================================================================ +<===> value/between/input.sass +a + b: c(d + e) + +<===> value/between/output.css +a { + b: c(d e); +} + +<===> +================================================================================ +<===> comma/before/input.sass +a + b: c(d + ,e) + +<===> comma/before/output.css +a { + b: c(d, e); +} + +<===> +================================================================================ +<===> comma/after/input.sass +a + b: c(d, + e) + +<===> comma/after/output.css +a { + b: c(d, e); +} + +<===> +================================================================================ +<===> trailing_comma/before/input.sass +a + b: c(d + ,) + +<===> trailing_comma/before/output.css +a { + b: c(d); +} + +<===> +================================================================================ +<===> trailing_comma/after/input.sass +a + b: c(d, + ) + +<===> trailing_comma/after/output.css +a { + b: c(d); +} + +<===> +================================================================================ +<===> slash/before/input.sass +a + b: c(d + / e) + +<===> slash/before/output.css +a { + b: c(d/e); +} + +<===> +================================================================================ +<===> slash/after/input.sass +a + b: c(d / + e) + +<===> slash/after/output.css +a { + b: c(d/e); +} diff --git a/spec/values/maps/sass.hrx b/spec/values/maps/sass.hrx index bd140dd2d..992ddd542 100644 --- a/spec/values/maps/sass.hrx +++ b/spec/values/maps/sass.hrx @@ -35,6 +35,14 @@ $a: (b: c <===> whitespace/after_first_value/output.css +<===> +================================================================================ +<===> whitespace/between_values/input.sass +$a: (b: c + d, d: e) + +<===> whitespace/between_values/output.css + <===> ================================================================================ <===> whitespace/after_comma/input.sass