grass/tests/media.rs
Connor Skees 91ef5dcfd5 refactor how newlines are emitted
still not perfect, but getting closer. this brings the bulma diff down
from around 1,700 lines to only 500 (all a result of newlines)
2020-07-04 22:52:11 -04:00

34 lines
733 B
Rust

#![cfg(test)]
#[macro_use]
mod macros;
test!(
basic_toplevel,
"@media foo {\n a {\n color: red;\n }\n}\n"
);
error!(
no_params,
"@media {\n a {\n color: red;\n }\n}\n", "Error: Expected identifier."
);
test!(
basic_nested,
"a {\n @media foo {\n color: red;\n }\n}\n",
"@media foo {\n a {\n color: red;\n }\n}\n"
);
test!(empty_body, "@media (min-width: 2px) {}", "");
test!(
newlines_are_not_emitted_for_child_styles,
"a {
@media screen {
b {
color: red;
}
c {
color: green;
}
}
}",
"@media screen {\n a b {\n color: red;\n }\n a c {\n color: green;\n }\n}\n"
);