Skip to content

Commit

Permalink
Add specs for @forward
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed May 31, 2019
1 parent a6ddf69 commit b767f75
Show file tree
Hide file tree
Showing 17 changed files with 2,168 additions and 0 deletions.
89 changes: 89 additions & 0 deletions spec/core_functions/function_exists.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,95 @@ a {
b: true;
}

<===>
================================================================================
<===> through_forward/options.yml
---
:todo:
- libsass # sass/libsass#2807

<===>
================================================================================
<===> through_forward/bare/input.scss
@use "midstream" as *;
a {b: function-exists(c)}

<===> through_forward/bare/_midstream.scss
@forward "upstream";

<===> through_forward/bare/_upstream.scss
@function c() {@return null}

<===> through_forward/bare/output.css
a {
b: true;
}

<===>
================================================================================
<===> through_forward/as/input.scss
@use "midstream" as *;
a {
with-prefix: function-exists(b-c);
without-prefix: function-exists(c);
}

<===> through_forward/as/_midstream.scss
@forward "upstream" as b-*;

<===> through_forward/as/_upstream.scss
@function c() {@return null}

<===> through_forward/as/output.css
a {
with-prefix: true;
without-prefix: false;
}

<===>
================================================================================
<===> through_forward/show/input.scss
@use "midstream" as *;
a {
shown: function-exists(b);
not-shown: function-exists(c);
}

<===> through_forward/show/_midstream.scss
@forward "upstream" show b;

<===> through_forward/show/_upstream.scss
@function b() {@return null}
@function c() {@return null}

<===> through_forward/show/output.css
a {
shown: true;
not-shown: false;
}

<===>
================================================================================
<===> through_forward/hide/input.scss
@use "midstream" as *;
a {
hidden: function-exists(b);
not-hidden: function-exists(c);
}

<===> through_forward/hide/_midstream.scss
@forward "upstream" hide b;

<===> through_forward/hide/_upstream.scss
@function b() {@return null}
@function c() {@return null}

<===> through_forward/hide/output.css
a {
hidden: false;
not-hidden: true;
}

<===>
================================================================================
<===> non_existent/input.scss
Expand Down
125 changes: 125 additions & 0 deletions spec/core_functions/get_function.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,87 @@ a {
b: 12;
}

<===>
================================================================================
<===> through_forward/options.yml
---
:todo:
- libsass # sass/libsass#2807

<===>
================================================================================
<===> through_forward/bare/input.scss
@use "midstream" as *;
a {b: call(get-function(c))}

<===> through_forward/bare/_midstream.scss
@forward "upstream";

<===> through_forward/bare/_upstream.scss
@function c() {@return c}

<===> through_forward/bare/output.css
a {
b: c;
}

<===>
================================================================================
<===> through_forward/as/input.scss
@use "midstream" as *;
a {
b: call(get-function(c-d));
}

<===> through_forward/as/_midstream.scss
@forward "upstream" as c-*;

<===> through_forward/as/_upstream.scss
@function d() {@return d}

<===> through_forward/as/output.css
a {
b: d;
}

<===>
================================================================================
<===> through_forward/show/input.scss
@use "midstream" as *;
a {
b: call(get-function(c));
}

<===> through_forward/show/_midstream.scss
@forward "upstream" show c;

<===> through_forward/show/_upstream.scss
@function c() {@return c}

<===> through_forward/show/output.css
a {
b: c;
}

<===>
================================================================================
<===> through_forward/hide/input.scss
@use "midstream" as *;
a {
b: call(get-function(d));
}

<===> through_forward/hide/_midstream.scss
@forward "upstream" hide c;

<===> through_forward/hide/_upstream.scss
@function d() {@return d}

<===> through_forward/hide/output.css
a {
b: d;
}

<===>
================================================================================
<===> plain_css/input.scss
Expand Down Expand Up @@ -325,6 +406,50 @@ Error: Function not found: does-not-exist
'
input.scss 1:7 root stylesheet

<===>
================================================================================
<===> error/through_forward/show/input.scss
@use "midstream" as *;
a {
b: call(get-function(d));
}

<===> error/through_forward/show/_midstream.scss
@forward "upstream" show c;

<===> error/through_forward/show/_upstream.scss
@function d() {@return c}

<===> error/through_forward/show/error
Error: Function not found: d
,
3 | b: call(get-function(d));
| ^^^^^^^^^^^^^^^
'
input.scss 3:11 root stylesheet

<===>
================================================================================
<===> error/through_forward/hide/input.scss
@use "midstream" as *;
a {
b: call(get-function(c));
}

<===> error/through_forward/hide/_midstream.scss
@forward "upstream" hide c;

<===> error/through_forward/hide/_upstream.scss
@function c() {@return c}

<===> error/through_forward/hide/error
Error: Function not found: c
,
3 | b: call(get-function(c));
| ^^^^^^^^^^^^^^^
'
input.scss 3:11 root stylesheet

<===>
================================================================================
<===> error/division/input.scss
Expand Down
89 changes: 89 additions & 0 deletions spec/core_functions/global_variable_exists.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,95 @@ a {
b: true;
}

<===>
================================================================================
<===> through_forward/options.yml
---
:todo:
- libsass # sass/libsass#2807

<===>
================================================================================
<===> through_forward/bare/input.scss
@use "midstream" as *;
a {b: variable-exists(c)}

<===> through_forward/bare/_midstream.scss
@forward "upstream";

<===> through_forward/bare/_upstream.scss
$c: null;

<===> through_forward/bare/output.css
a {
b: true;
}

<===>
================================================================================
<===> through_forward/as/input.scss
@use "midstream" as *;
a {
with-prefix: global-variable-exists(b-c);
without-prefix: global-variable-exists(c);
}

<===> through_forward/as/_midstream.scss
@forward "upstream" as b-*;

<===> through_forward/as/_upstream.scss
$c: null;

<===> through_forward/as/output.css
a {
with-prefix: true;
without-prefix: false;
}

<===>
================================================================================
<===> through_forward/show/input.scss
@use "midstream" as *;
a {
shown: global-variable-exists(b);
not-shown: global-variable-exists(c);
}

<===> through_forward/show/_midstream.scss
@forward "upstream" show $b;

<===> through_forward/show/_upstream.scss
$b: null;
$c: null;

<===> through_forward/show/output.css
a {
shown: true;
not-shown: false;
}

<===>
================================================================================
<===> through_forward/hide/input.scss
@use "midstream" as *;
a {
hidden: global-variable-exists(b);
not-hidden: global-variable-exists(c);
}

<===> through_forward/hide/_midstream.scss
@forward "upstream" hide $b;

<===> through_forward/hide/_upstream.scss
$b: null;
$c: null;

<===> through_forward/hide/output.css
a {
hidden: false;
not-hidden: true;
}

<===>
================================================================================
<===> dash_insensitive/input.scss
Expand Down
Loading

0 comments on commit b767f75

Please sign in to comment.