2020-05-20 20:13:53 -04:00
|
|
|
#[macro_use]
|
|
|
|
mod macros;
|
|
|
|
|
|
|
|
test!(
|
|
|
|
basic_unknown_at_rule,
|
2020-11-20 04:34:36 -05:00
|
|
|
"@foo {\n a {\n color: red;\n }\n}\n",
|
2020-05-20 20:13:53 -04:00
|
|
|
"@foo {\n a {\n color: red;\n }\n}\n"
|
|
|
|
);
|
2020-11-20 04:34:36 -05:00
|
|
|
test!(
|
|
|
|
unknown_at_rule_no_selector,
|
|
|
|
"@foo {\n color: red;\n}\n",
|
|
|
|
"@foo {\n color: red;\n}\n"
|
|
|
|
);
|
|
|
|
test!(unknown_at_rule_no_body, "@foo;\n", "@foo;\n");
|
2021-07-24 22:21:11 -04:00
|
|
|
test!(unknown_at_rule_empty_body, "@foo {}\n", "@foo {}\n");
|
2020-05-20 20:13:53 -04:00
|
|
|
test!(unknown_at_rule_no_body_eof, "@foo", "@foo;\n");
|
|
|
|
test!(
|
|
|
|
unknown_at_rule_interpolated_eof_no_body,
|
|
|
|
"@#{()if(0,0<0,0)}",
|
|
|
|
"@false;\n"
|
|
|
|
);
|
2020-05-24 13:50:45 -04:00
|
|
|
test!(nothing_after_hash, "@foo #", "@foo #;\n");
|
2020-07-10 22:24:03 -04:00
|
|
|
test!(
|
|
|
|
style_following,
|
|
|
|
"@foo (a: b) {
|
|
|
|
a {
|
|
|
|
color: red;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
a {
|
|
|
|
color: green;
|
|
|
|
}",
|
|
|
|
"@foo (a: b) {\n a {\n color: red;\n }\n}\na {\n color: green;\n}\n"
|
|
|
|
);
|
2021-07-24 22:21:11 -04:00
|
|
|
test!(
|
|
|
|
no_semicolon_no_params_no_body,
|
|
|
|
"a {
|
|
|
|
@b
|
|
|
|
}
|
|
|
|
|
|
|
|
a {
|
|
|
|
color: red;
|
|
|
|
}",
|
|
|
|
"a {\n @b;\n}\n\na {\n color: red;\n}\n"
|
|
|
|
);
|
|
|
|
test!(
|
|
|
|
no_semicolon_has_params_no_body,
|
|
|
|
"a {
|
|
|
|
@foo bar
|
|
|
|
}
|
|
|
|
|
|
|
|
a {
|
|
|
|
color: red;
|
|
|
|
}",
|
|
|
|
"a {\n @foo bar;\n}\n\na {\n color: red;\n}\n"
|
|
|
|
);
|
|
|
|
test!(
|
|
|
|
no_body_remains_inside_style_rule,
|
|
|
|
"a {
|
|
|
|
@box-shadow: $btn-focus-box-shadow, $btn-active-box-shadow;
|
|
|
|
}
|
|
|
|
|
|
|
|
a {
|
|
|
|
color: red;
|
|
|
|
}",
|
|
|
|
"a {\n @box-shadow : $btn-focus-box-shadow, $btn-active-box-shadow;\n}\n\na {\n color: red;\n}\n"
|
|
|
|
);
|
|
|
|
test!(
|
|
|
|
empty_body_moves_outside_style_rule,
|
|
|
|
"a {
|
|
|
|
@b {}
|
|
|
|
}
|
|
|
|
|
|
|
|
a {
|
|
|
|
color: red;
|
|
|
|
}",
|
|
|
|
"@b {}\n\na {\n color: red;\n}\n"
|
|
|
|
);
|
|
|
|
test!(
|
|
|
|
#[ignore = "not sure how dart-sass is parsing this to include the semicolon in the params"]
|
|
|
|
params_contain_silent_comment_and_semicolon,
|
|
|
|
"a {
|
|
|
|
@box-shadow: $btn-focus-box-shadow, // $btn-active-box-shadow;
|
|
|
|
}",
|
|
|
|
"a {\n @box-shadow : $btn-focus-box-shadow, / $btn-active-box-shadow;\n}\n"
|
|
|
|
);
|
2020-08-07 11:39:14 -04:00
|
|
|
test!(contains_multiline_comment, "@foo /**/;\n", "@foo;\n");
|