Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for quote #1380

Merged
merged 1 commit into from
Apr 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
glebm marked this conversation as resolved.
Show resolved Hide resolved
}

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

<===>
================================================================================
<===> quoted-double/input.scss
glebm marked this conversation as resolved.
Show resolved Hide resolved
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
glebm marked this conversation as resolved.
Show resolved Hide resolved
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));

-----^