Remove SCSS unit tests

The behavior tested by them is redundantly tested in the integration
tests. In addition, the behavior inside format.rs is redundant and will
eventually be removed.
This commit is contained in:
ConnorSkees 2020-04-18 18:46:17 -04:00
parent 759e5fdfef
commit 8955042359

View File

@ -53,73 +53,3 @@ impl<W: Write> PrettyPrinter<W> {
Ok(()) Ok(())
} }
} }
#[cfg(test)]
mod test_scss {
use super::StyleSheet;
macro_rules! test {
($func:ident, $input:literal) => {
#[test]
fn $func() {
assert_eq!(
String::from($input),
StyleSheet::new($input.to_string())
.expect(concat!("failed to parse on ", $input))
.to_string()
);
}
};
($func:ident, $input:literal, $output:literal) => {
#[test]
fn $func() {
assert_eq!(
String::from($output),
StyleSheet::new($input.to_string())
.expect(concat!("failed to parse on ", $input))
.to_string()
);
}
};
}
test!(empty, "");
test!(basic_nesting, "a {\n b {\n }\n}\n");
test!(mul_nesting, "a, b {\n a, b {\n }\n}\n");
test!(basic_style, "a {\n color: red;\n}\n");
test!(two_styles, "a {\n color: red;\n color: blue;\n}\n");
test!(
nested_style_in_parent,
"a {\n color: red;\n b {\n }\n}\n"
);
test!(
nested_style_in_child,
"a {\n b {\n color: red;\n }\n}\n"
);
test!(
nested_style_in_both,
"a {\n color: red;\n b {\n color: red;\n }\n}\n"
);
test!(
deeply_nested_selector,
"\
a {
b {
c {
d {
e {
f {
g {
h {
i {
}
}
}
}
}
}
}
}
}
"
);
}