-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1349 from sass/use-members
Add @use member usage and load error tests
- Loading branch information
Showing
37 changed files
with
3,166 additions
and
404 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,201 @@ | ||
<===> global/input.scss | ||
@function global-function() {@return null} | ||
|
||
a {b: function-exists(global-function)} | ||
|
||
<===> global/output.css | ||
a { | ||
b: true; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> local/options.yml | ||
--- | ||
:todo: | ||
- libsass # sass/libsass#2831 | ||
|
||
<===> local/input.scss | ||
a { | ||
@function local-function() {@return null} | ||
b: function-exists(local-function); | ||
} | ||
|
||
<===> local/output.css | ||
a { | ||
b: true; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> dash_insensitive/input.scss | ||
@function global-function() {@return null} | ||
|
||
a {b: function-exists(global_function)} | ||
|
||
<===> dash_insensitive/output.css | ||
a { | ||
b: true; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> through_import/input.scss | ||
@import "other"; | ||
a {b: function-exists(global-function)} | ||
|
||
<===> through_import/other.scss | ||
@function global-function() {@return null} | ||
|
||
<===> through_import/output.css | ||
a { | ||
b: true; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> through_use/options.yml | ||
--- | ||
:todo: | ||
- libsass # sass/libsass#2807 | ||
:ignore_for: | ||
- ruby-sass | ||
|
||
<===> through_use/input.scss | ||
@use "other" as *; | ||
a {b: function-exists(global-function)} | ||
|
||
<===> through_use/other.scss | ||
@function global-function() {@return null} | ||
|
||
<===> through_use/output.css | ||
a { | ||
b: true; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> non_existent/input.scss | ||
a { | ||
b: function-exists(non-existent); | ||
} | ||
|
||
<===> non_existent/output.css | ||
a { | ||
b: false; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> keyword/input.scss | ||
a {b: function-exists($name: foo)} | ||
|
||
<===> keyword/output.css | ||
a { | ||
b: false; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> error/argument/type/input.scss | ||
a {b: function-exists(12px)} | ||
|
||
<===> error/argument/type/error | ||
Error: $name: 12px is not a string. | ||
, | ||
1 | a {b: function-exists(12px)} | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
' | ||
/sass/spec/core_functions/function_exists/error/argument/type/input.scss 1:7 root stylesheet | ||
|
||
<===> error/argument/type/error-ruby-sass | ||
Error: $name: 12px is not a string for `function-exists' | ||
on line 1 of /sass/spec/core_functions/function_exists/error/argument/type/input.scss | ||
Use --trace for backtrace. | ||
|
||
<===> error/argument/type/error-libsass | ||
Error: $name: 12px is not a string for `function-exists' | ||
on line 1:7 of /sass/spec/core_functions/function_exists/error/argument/type/input.scss, in function `function-exists` | ||
from line 1:7 of /sass/spec/core_functions/function_exists/error/argument/type/input.scss | ||
>> a {b: function-exists(12px)} | ||
|
||
------^ | ||
|
||
<===> | ||
================================================================================ | ||
<===> error/argument/too_few/input.scss | ||
a {b: function-exists()} | ||
|
||
<===> error/argument/too_few/error | ||
Error: Missing argument $name. | ||
, | ||
1 | a {b: function-exists()} | ||
| ^^^^^^^^^^^^^^^^^ | ||
' | ||
/sass/spec/core_functions/function_exists/error/argument/too_few/input.scss 1:7 root stylesheet | ||
|
||
<===> error/argument/too_few/error-ruby-sass | ||
Error: wrong number of arguments (0 for 1) for `function-exists' | ||
on line 1 of /sass/spec/core_functions/function_exists/error/argument/too_few/input.scss | ||
Use --trace for backtrace. | ||
|
||
<===> error/argument/too_few/error-libsass | ||
Error: Function function-exists is missing argument $name. | ||
on line 1 of /sass/spec/core_functions/function_exists/error/argument/too_few/input.scss | ||
>> a {b: function-exists()} | ||
|
||
------^ | ||
|
||
<===> | ||
================================================================================ | ||
<===> error/argument/too_many/input.scss | ||
a {b: function-exists(foo, bar)} | ||
|
||
<===> error/argument/too_many/error | ||
Error: Only 1 argument allowed, but 2 were passed. | ||
, | ||
1 | a {b: function-exists(foo, bar)} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
' | ||
/sass/spec/core_functions/function_exists/error/argument/too_many/input.scss 1:7 root stylesheet | ||
|
||
<===> error/argument/too_many/error-ruby-sass | ||
Error: wrong number of arguments (2 for 1) for `function-exists' | ||
on line 1 of /sass/spec/core_functions/function_exists/error/argument/too_many/input.scss | ||
Use --trace for backtrace. | ||
|
||
<===> error/argument/too_many/error-libsass | ||
Error: wrong number of arguments (2 for 1) for `function-exists' | ||
on line 1:7 of /sass/spec/core_functions/function_exists/error/argument/too_many/input.scss | ||
>> a {b: function-exists(foo, bar)} | ||
|
||
------^ | ||
|
||
<===> | ||
================================================================================ | ||
<===> conflict/options.yml | ||
--- | ||
:todo: | ||
- libsass # sass/libsass#2807 | ||
:ignore_for: | ||
- ruby-sass | ||
|
||
<===> conflict/input.scss | ||
@use "other1" as *; | ||
@use "other2" as *; | ||
|
||
a {b: function-exists(member)} | ||
|
||
<===> conflict/other1.scss | ||
@function member() {@return from other1} | ||
|
||
<===> conflict/other2.scss | ||
@function member() {@return from other2} | ||
|
||
<===> conflict/error | ||
Error: Multiple global modules have a function named "member". | ||
, | ||
4 | a {b: function-exists(member)} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
' | ||
/sass/spec/core_functions/function_exists/conflict/input.scss 4:7 root stylesheet |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
spec/core_functions/get-function/errors/function-exists.hrx
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
spec/core_functions/get-function/errors/illegal-argument.hrx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.