diff --git a/spec/core_functions/function_exists.hrx b/spec/core_functions/function_exists.hrx index f9429d46e5..f57de9f86a 100644 --- a/spec/core_functions/function_exists.hrx +++ b/spec/core_functions/function_exists.hrx @@ -52,6 +52,27 @@ 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 @@ -149,3 +170,32 @@ Error: wrong number of arguments (2 for 1) for `function-exists' >> 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 diff --git a/spec/core_functions/get_function.hrx b/spec/core_functions/get_function.hrx index 20e2cc9456..fe83b8573e 100644 --- a/spec/core_functions/get_function.hrx +++ b/spec/core_functions/get_function.hrx @@ -53,6 +53,27 @@ a { b: 12; } +<===> +================================================================================ +<===> through_use/options.yml +--- +:todo: +- libsass # sass/libsass#2807 +:ignore_for: +- ruby-sass + +<===> through_use/input.scss +@use "other" as *; +a {b: call(get-function(add-two), 10)} + +<===> through_use/other.scss +@function add-two($v) {@return $v + 2} + +<===> through_use/output.css +a { + b: 12; +} + <===> ================================================================================ <===> plain_css/input.scss @@ -359,3 +380,32 @@ Error: $name: get-function("add-two") is not a string. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' /sass/spec/core_functions/get_function/error/function_exists/input.scss 8:10 root stylesheet + +<===> +================================================================================ +<===> conflict/options.yml +--- +:todo: +- libsass # sass/libsass#2807 +:ignore_for: +- ruby-sass + +<===> conflict/input.scss +@use "other1" as *; +@use "other2" as *; + +a {b: get-function(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: get-function(member)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + /sass/spec/core_functions/get_function/conflict/input.scss 4:7 root stylesheet diff --git a/spec/core_functions/global_variable_exists.hrx b/spec/core_functions/global_variable_exists.hrx index 25d50f7846..cf60004549 100644 --- a/spec/core_functions/global_variable_exists.hrx +++ b/spec/core_functions/global_variable_exists.hrx @@ -35,6 +35,27 @@ 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: global-variable-exists(global-variable)} + +<===> through_use/other.scss +$global-variable: null; + +<===> through_use/output.css +a { + b: true; +} + <===> ================================================================================ <===> dash_insensitive/input.scss @@ -144,3 +165,32 @@ Error: wrong number of arguments (2 for 1) for `global-variable-exists' >> a {b: global-variable-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: global-variable-exists(member)} + +<===> conflict/other1.scss +$member: from other1; + +<===> conflict/other2.scss +$member: from other2; + +<===> conflict/error +Error: Multiple global modules have a variable named "$member". + , +4 | a {b: global-variable-exists(member)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + /sass/spec/core_functions/global_variable_exists/conflict/input.scss 4:7 root stylesheet diff --git a/spec/core_functions/mixin_exists.hrx b/spec/core_functions/mixin_exists.hrx index bbe8fa47fe..835aebd605 100644 --- a/spec/core_functions/mixin_exists.hrx +++ b/spec/core_functions/mixin_exists.hrx @@ -41,6 +41,13 @@ a { <===> ================================================================================ +<===> through_import/options.yml +--- +:todo: +- libsass # sass/libsass#2807 +:ignore_for: +- ruby-sass + <===> through_import/input.scss @import "other"; a {b: mixin-exists(global-mixin)} @@ -53,6 +60,20 @@ a { b: true; } +<===> +================================================================================ +<===> through_use/input.scss +@use "other" as *; +a {b: mixin-exists(global-mixin)} + +<===> through_use/other.scss +@mixin global-mixin() {} + +<===> through_use/output.css +a { + b: true; +} + <===> ================================================================================ <===> non_existent/input.scss @@ -150,3 +171,32 @@ Error: wrong number of arguments (2 for 1) for `mixin-exists' >> a {b: mixin-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: mixin-exists(member)} + +<===> conflict/other1.scss +@mixin member() {} + +<===> conflict/other2.scss +@mixin member() {} + +<===> conflict/error +Error: Multiple global modules have a mixin named "member". + , +4 | a {b: mixin-exists(member)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + /sass/spec/core_functions/mixin_exists/conflict/input.scss 4:7 root stylesheet diff --git a/spec/core_functions/variable_exists.hrx b/spec/core_functions/variable_exists.hrx index babb9411f5..6dee884098 100644 --- a/spec/core_functions/variable_exists.hrx +++ b/spec/core_functions/variable_exists.hrx @@ -35,6 +35,27 @@ 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: variable-exists(global-variable)} + +<===> through_use/other.scss +$global-variable: null; + +<===> through_use/output.css +a { + b: true; +} + <===> ================================================================================ <===> dash_insensitive/input.scss @@ -144,3 +165,32 @@ Error: wrong number of arguments (2 for 1) for `variable-exists' >> a {b: variable-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: variable-exists(member)} + +<===> conflict/other1.scss +$member: from other1; + +<===> conflict/other2.scss +$member: from other2; + +<===> conflict/error +Error: Multiple global modules have a variable named "$member". + , +4 | a {b: variable-exists(member)} + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + /sass/spec/core_functions/variable_exists/conflict/input.scss 4:7 root stylesheet