Skip to content

Commit 592601a

Browse files
authored
Add some dash-insensitivity specs for meta functions (#1452)
See sass/sass#792
1 parent 32c983a commit 592601a

File tree

4 files changed

+96
-0
lines changed

4 files changed

+96
-0
lines changed

spec/core_functions/meta/function_exists.hrx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,30 @@ a {
3535
b: true;
3636
}
3737

38+
<===>
39+
================================================================================
40+
<===> same_module/dash_insensitive/dash_to_underscore/input.scss
41+
@function a_b() {@return null}
42+
43+
c {d: function-exists(a-b)}
44+
45+
<===> same_module/dash_insensitive/dash_to_underscore/output.css
46+
c {
47+
d: true;
48+
}
49+
50+
<===>
51+
================================================================================
52+
<===> same_module/dash_insensitive/underscore_to_dash/input.scss
53+
@function a-b() {@return null}
54+
55+
c {d: function-exists(a_b)}
56+
57+
<===> same_module/dash_insensitive/underscore_to_dash/output.css
58+
c {
59+
d: true;
60+
}
61+
3862
<===>
3963
================================================================================
4064
<===> same_module/non_existent/input.scss

spec/core_functions/meta/get_function/same_module.hrx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,27 @@ a {
6969
sass-fn: #ff9999;
7070
css-fn: lighten(red, 30%);
7171
}
72+
73+
<===>
74+
================================================================================
75+
<===> dash_insensitive/dash_to_underscore/input.scss
76+
@function add_two($v) {@return $v + 2}
77+
78+
a {b: call(get-function(add-two), 10)}
79+
80+
<===> dash_insensitive/dash_to_underscore/output.css
81+
a {
82+
b: 12;
83+
}
84+
85+
<===>
86+
================================================================================
87+
<===> dash_insensitive/underscore_to_dash/input.scss
88+
@function add-two($v) {@return $v + 2}
89+
90+
a {b: call(get-function(add_two), 10)}
91+
92+
<===> dash_insensitive/underscore_to_dash/output.css
93+
a {
94+
b: 12;
95+
}

spec/core_functions/meta/global_variable_exists.hrx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,30 @@ a {
3535
b: true;
3636
}
3737

38+
<===>
39+
================================================================================
40+
<===> dash_insensitive/dash_to_underscore/input.scss
41+
$a_b: null;
42+
43+
c {d: global-variable-exists(a-b)}
44+
45+
<===> dash_insensitive/dash_to_underscore/output.css
46+
c {
47+
d: true;
48+
}
49+
50+
<===>
51+
================================================================================
52+
<===> dash_insensitive/underscore_to_dash/input.scss
53+
$a-b: null;
54+
55+
c {d: global-variable-exists(a_b)}
56+
57+
<===> dash_insensitive/underscore_to_dash/output.css
58+
c {
59+
d: true;
60+
}
61+
3862
<===>
3963
================================================================================
4064
<===> same_module/non_existent/input.scss

spec/core_functions/meta/variable_exists.hrx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,30 @@ a {
2121
b: true;
2222
}
2323

24+
<===>
25+
================================================================================
26+
<===> dash_insensitive/dash_to_underscore/input.scss
27+
$a_b: null;
28+
29+
c {d: variable-exists(a-b)}
30+
31+
<===> dash_insensitive/dash_to_underscore/output.css
32+
c {
33+
d: true;
34+
}
35+
36+
<===>
37+
================================================================================
38+
<===> dash_insensitive/underscore_to_dash/input.scss
39+
$a-b: null;
40+
41+
c {d: variable-exists(a_b)}
42+
43+
<===> dash_insensitive/underscore_to_dash/output.css
44+
c {
45+
d: true;
46+
}
47+
2448
<===>
2549
================================================================================
2650
<===> through_import/input.scss

0 commit comments

Comments
 (0)