Add tests for default value arguments
This commit is contained in:
parent
1636d775c5
commit
31506c7ce4
17
src/main.rs
17
src/main.rs
@ -1135,10 +1135,25 @@ mod test_mixins {
|
|||||||
"d {\n color: red;\n}\n"
|
"d {\n color: red;\n}\n"
|
||||||
);
|
);
|
||||||
test!(
|
test!(
|
||||||
mixin_default_value,
|
mixin_simple_default_value,
|
||||||
"@mixin a($b: red) {\n color: $b;\n}\nd {\n @include a;\n}\n",
|
"@mixin a($b: red) {\n color: $b;\n}\nd {\n @include a;\n}\n",
|
||||||
"d {\n color: red;\n}\n"
|
"d {\n color: red;\n}\n"
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
mixin_second_value_default,
|
||||||
|
"@mixin a($a, $b: blue) {\n color: $a $b;\n}\nd {\n @include a(red);\n}\n",
|
||||||
|
"d {\n color: red blue;\n}\n"
|
||||||
|
);
|
||||||
|
test!(
|
||||||
|
mixin_two_default_values,
|
||||||
|
"@mixin a($a: red, $b: blue) {\n color: $a $b;\n}\nd {\n @include a;\n}\n",
|
||||||
|
"d {\n color: red blue;\n}\n"
|
||||||
|
);
|
||||||
|
test!(
|
||||||
|
mixin_override_default_value_positionally,
|
||||||
|
"@mixin a($a: red) {\n color: $a;\n}\nd {\n @include a(blue);\n}\n",
|
||||||
|
"d {\n color: blue;\n}\n"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user