Test for returning variable in function and calling functions with variables as parameter

This commit is contained in:
ConnorSkees 2020-01-26 11:47:46 -05:00
parent 65030eb7ea
commit c183ea8c1e

View File

@ -592,6 +592,11 @@ mod test_mixins {
"@mixin a($a, $b) {\n color: $a $b;\n}\nd {\n @include a($b: blue, $a: red);\n}\n",
"d {\n color: red blue;\n}\n"
);
test!(
variable_in_call_args,
"@mixin a($a) {\n color: $a;\n}\nd {\n $c: red;\n @include a($c);\n}\n",
"d {\n color: red;\n}\n"
);
}
#[cfg(test)]
@ -682,6 +687,11 @@ mod test_functions {
"@function a($c) {\n @return $c;\n}\n\nb {\ncolor: a(1);\n}\n",
"b {\n color: 1;\n}\n"
);
test!(
return_variable,
"@function a($a) {\n @return $a;\n}\n\nb {\ncolor: a(1);\n}\n",
"b {\n color: 1;\n}\n"
);
// test!(
// return_no_semicolon,
// "@function a() {\n @return 1\n}\n\nb {\ncolor: a();\n}\n",