-
Notifications
You must be signed in to change notification settings - Fork 89
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 @use member usage and load error tests #1349
Changes from all commits
07e62b6
6c9bd98
1361bc0
b73071a
7bff971
093a28a
356f23f
95c837a
831bd56
821bd8a
1bff139
8359a83
e0df66b
f74c74c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see where this error is coming from in dart-sass but could it include the names of the modules that have conflicting functions? It would make it easier to track down when many modules are used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's already a TODO for that: https://github.com/sass/dart-sass/blob/5a64dec4ec54ef4fc8fdf0ca0c16a83fec81463b/lib/src/async_environment.dart#L589