grass/tests/unary.rs

53 lines
1.3 KiB
Rust
Raw Normal View History

2020-03-21 12:14:02 -04:00
#![cfg(test)]
#[macro_use]
mod macros;
test!(unary_pos_unquoted_ident, "a {\n color: +foo;\n}\n");
test!(
unary_pos_whitespace,
"a {\n color: + foo;\n}\n",
"a {\n color: +foo;\n}\n"
);
test!(unary_pos_dblquoted_ident, "a {\n color: +\"foo\";\n}\n");
test!(
unary_pos_sglquoted_ident,
"a {\n color: +'foo';\n}\n",
"a {\n color: +\"foo\";\n}\n"
);
test!(unary_pos_color, "a {\n color: +\"foo\";\n}\n");
test!(
unary_pos_number,
"a {\n color: +1px;\n}\n",
"a {\n color: 1px;\n}\n"
);
test!(
unary_pos_in_list,
"a {\n color: bar,+ \"bar\" - foo;\n}\n",
"a {\n color: bar, +\"bar\"-foo;\n}\n"
);
test!(unary_neg_unquoted_ident, "a {\n color: -foo;\n}\n");
test!(unary_neg_dblquoted_ident, "a {\n color: -\"foo\";\n}\n");
test!(
unary_neg_sglquoted_ident,
"a {\n color: -'foo';\n}\n",
"a {\n color: -\"foo\";\n}\n"
);
test!(unary_neg_color, "a {\n color: -\"foo\";\n}\n");
test!(unary_neg_number, "a {\n color: -1px;\n}\n");
test!(
unary_neg_whitespace,
"a {\n color: - 1px;\n}\n",
"a {\n color: -1px;\n}\n"
);
test!(
unary_neg_number_type,
"a {\n color: type-of(- 1px);\n}\n",
"a {\n color: number;\n}\n"
);
2020-03-29 23:44:07 -04:00
test!(
unary_neg_variable,
"$a: 1;\n\na {\n color: -$a;\n}\n",
"a {\n color: -1;\n}\n"
);