Skip to content

Commit

Permalink
Add tests for quote
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm committed Apr 14, 2019
1 parent e58d9b7 commit 30a7a93
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions spec/string-functions/quote.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<===> unquoted/input.scss
a {
a: quote(a);
}

<===> unquoted/output.css
a {
a: "a";
}

<===>
================================================================================
<===> quoted-double/input.scss
a {
a: quote("a");
}

<===> quoted-double/output.css
a {
a: "a";
}

<===>
================================================================================
<===> quoted-single/input.scss
a {
a: quote('a');
}

<===> quoted-single/output.css
a {
a: "a";
}

<===>
================================================================================
<===> quote-mark-selection-single/input.scss
a {
a: quote(unquote('"'));
}

<===> quote-mark-selection-single/output.css
a {
a: '"';
}

<===>
================================================================================
<===> quote-mark-selection-double/input.scss
a {
a: quote(unquote('"') + unquote("'"));
}

<===> quote-mark-selection-double/output.css
a {
a: "\"'";
}

<===>
================================================================================
<===> error/argument-type/input.scss
a {
a: quote((1, 2, 3));
}

<===> error/argument-type/error
Error: $string: 1, 2, 3 is not a string.
,
2 | a: quote((1, 2, 3));
| ^^^^^^^^^^^^^^^^
'
input.scss 2:6 root stylesheet

<===> error/argument-type/error-libsass
Error: argument `$string` of `quote($string)` must be a string
on line 2:6 of input.scss, in function `quote`
from line 2:6 of input.scss
>> a: quote((1, 2, 3));

-----^

0 comments on commit 30a7a93

Please sign in to comment.