Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See sass/sass#1963
- Loading branch information
Showing
19 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.bracketed-lists { | ||
empty: []; | ||
single: [foo]; | ||
multiple: [foo, bar]; | ||
nested: [[foo], [[bar, baz]]]; | ||
space-separated: [foo bar baz]; | ||
trailing-comma: [foo, bar]; | ||
nth-comma: bar; | ||
nth-space: bar; | ||
comma-separator: comma; | ||
space-separator: space; | ||
set-nth: [foo, qux, baz]; | ||
append: [foo, bar, baz]; | ||
append-with-separator: [foo bar baz]; | ||
inspect-empty: []; | ||
inspect-simple: [foo, bar]; | ||
inspect-nested-bracketed: [[foo]]; | ||
inspect-nested-unbracketed: [(foo bar)]; | ||
inspect-nested-unbracketed-comma: [foo bar,]; | ||
inspect-nested-unbracketed-singleton: [(foo,)]; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.bracketed-lists { | ||
empty: []; | ||
single: [foo]; | ||
multiple: [foo, bar]; | ||
nested: [[foo], [[bar, baz]]]; | ||
space-separated: [foo bar baz]; | ||
trailing-comma: [foo, bar,]; | ||
|
||
// List functions treat it like a list. | ||
nth-comma: nth([foo, bar], 2); | ||
nth-space: nth([foo bar], 2); | ||
comma-separator: list-separator([foo, bar]); | ||
space-separator: list-separator([foo bar]); | ||
|
||
// List functions preserve bracketedness. | ||
set-nth: set-nth([foo, bar, baz], 2, qux); | ||
append: append([foo, bar], baz); | ||
append-with-separator: append([foo, bar], baz, $separator: space); | ||
|
||
// Inspection produces valid input. This also verifies that nested lists of | ||
// various sorts are parsed properly. | ||
inspect-empty: inspect([]); | ||
inspect-simple: inspect([foo, bar]); | ||
inspect-nested-bracketed: inspect([[foo]]); | ||
inspect-nested-unbracketed: inspect([(foo bar)]); | ||
inspect-nested-unbracketed-comma: inspect([foo bar,]); | ||
inspect-nested-unbracketed-singleton: inspect([(foo,)]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.is-bracketed { | ||
unbracketed-empty: false; | ||
unbracketed-singleton: false; | ||
unbracketed-multiple: false; | ||
bracketed-empty: true; | ||
bracketed-singleton: true; | ||
bracketed-multiple: true; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.is-bracketed { | ||
unbracketed-empty: is-bracketed(()); | ||
unbracketed-singleton: is-bracketed(foo); | ||
unbracketed-multiple: is-bracketed(foo bar); | ||
bracketed-empty: is-bracketed([]); | ||
bracketed-singleton: is-bracketed([foo]); | ||
bracketed-multiple: is-bracketed([foo bar]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
As of 3.5, `join()` is unique in that it takes multiple optional arguments that | ||
can be passed independently of one another. This may necessitate unusual | ||
implementation, so we go out of our way to verify that it disallows invalid | ||
calls. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Error: Unknown argument $invalid (true) for `join' | ||
on line 2 of /sass/spec/sass_3_5/functions/join/error/named/input.scss | ||
Use --trace for backtrace. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.join-named-error { | ||
error: join(foo, bar, $invalid: true); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
65 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Error: wrong number of arguments (5 for 2..4) for `join' | ||
on line 2 of /sass/spec/sass_3_5/functions/join/error/positional/input.scss | ||
Use --trace for backtrace. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.join-positional-error { | ||
error: join(foo, bar, comma, true, false); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
65 |
3 changes: 3 additions & 0 deletions
3
spec/sass_3_5/functions/join/error/positional_and_named/error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Error: wrong number of arguments (5 for 2..4) for `join' | ||
on line 2 of /sass/spec/sass_3_5/functions/join/error/positional_and_named/input.scss | ||
Use --trace for backtrace. |
Empty file.
2 changes: 2 additions & 0 deletions
2
spec/sass_3_5/functions/join/error/positional_and_named/input.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.join-positional-and-named-error { | ||
error: join(foo, bar, comma, true, false, $invalid: true); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
65 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.join { | ||
both-bracketed: [foo bar baz bang]; | ||
first-bracketed: [foo bar baz bang]; | ||
second-bracketed: foo bar baz bang; | ||
bracketed-true: [foo bar]; | ||
bracketed-false: foo bar; | ||
separator-and-bracketed: [foo, bar]; | ||
bracketed-and-separator: [foo, bar]; | ||
separator-and-bracketed-positional: [foo, bar]; | ||
unusual-bracketed-type: [foo bar]; | ||
bracketed-null: foo bar; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// 3.5 added the $bracketed parameter to join() and made it generally | ||
// bracketed-list-aware. | ||
.join { | ||
both-bracketed: join([foo bar], [baz bang]); | ||
first-bracketed: join([foo bar], baz bang); | ||
second-bracketed: join(foo bar, [baz bang]); | ||
bracketed-true: join(foo, bar, $bracketed: true); | ||
bracketed-false: join([foo], [bar], $bracketed: false); | ||
separator-and-bracketed: join(foo, bar, $separator: comma, $bracketed: true); | ||
bracketed-and-separator: join(foo, bar, $bracketed: true, $separator: comma); | ||
separator-and-bracketed-positional: | ||
join(foo, bar, comma, true); | ||
|
||
// All values are valid in boolean contexts. | ||
unusual-bracketed-type: join(foo, bar, $bracketed: foo); | ||
bracketed-null: join([foo], [bar], $bracketed: null); | ||
} |