grass/tests/equality.rs

64 lines
1.3 KiB
Rust
Raw Normal View History

2020-04-26 23:21:18 -04:00
#[macro_use]
mod macros;
test!(
color_equals_color,
"a {\n color: red == red;\n}\n",
"a {\n color: true;\n}\n"
);
test!(
color_does_not_equal_color,
"a {\n color: red != red;\n}\n",
"a {\n color: false;\n}\n"
);
test!(
unquoted_ident_eq_unquoted_ident,
"a {\n color: foo == foo;\n}\n",
"a {\n color: true;\n}\n"
);
test!(
dblquoted_ident_eq_unquoted_ident,
"a {\n color: \"foo\" == foo;\n}\n",
"a {\n color: true;\n}\n"
);
test!(
dblquoted_ident_eq_sglquoted_ident,
"a {\n color: \"foo\" == 'foo';\n}\n",
"a {\n color: true;\n}\n"
);
test!(
dblquoted_eq_number,
"a {\n color: \"foo\" == 1;\n}\n",
"a {\n color: false;\n}\n"
);
test!(
uncomparable_units,
"a {\n color: 1rem==1px;\n}\n",
"a {\n color: false;\n}\n"
);
test!(
first_unit_none,
"a {\n color: 1==1px;\n}\n",
"a {\n color: false;\n}\n"
);
test!(
second_unit_none,
"a {\n color: 1rem==1;\n}\n",
"a {\n color: false;\n}\n"
);
test!(
different_quoting_inside_list_eq,
2020-06-01 21:36:08 -04:00
"a {\n color: (\"foo\",) == (foo,);\n}\n",
"a {\n color: true;\n}\n"
);
test!(
different_quoting_inside_list_ne,
2020-06-01 21:36:08 -04:00
"a {\n color: (\"foo\",) != (foo,);\n}\n",
"a {\n color: false;\n}\n"
);
2020-07-10 00:17:15 -04:00
test!(
map_keys_equivalent,
"a {\n color: (0mm: a)==(0cm: a);\n}\n",
"a {\n color: true;\n}\n"
);