2020-02-28 18:27:32 -05:00
|
|
|
#[macro_use]
|
|
|
|
mod macros;
|
|
|
|
|
|
|
|
test!(
|
2021-07-20 20:41:21 -04:00
|
|
|
charset_exists_when_output_not_ascii,
|
2020-02-28 18:27:32 -05:00
|
|
|
"a {\n color: 🦆;\n}\n",
|
|
|
|
"@charset \"UTF-8\";\na {\n color: 🦆;\n}\n"
|
|
|
|
);
|
|
|
|
test!(
|
2021-07-20 20:41:21 -04:00
|
|
|
charset_utf8_is_removed_when_ascii,
|
2020-02-28 18:27:32 -05:00
|
|
|
"@charset \"UTF-8\";\na {\n color: red;\n}\n",
|
|
|
|
"a {\n color: red;\n}\n"
|
|
|
|
);
|
|
|
|
test!(
|
2021-07-20 20:41:21 -04:00
|
|
|
unknown_charset_is_removed,
|
2020-02-28 18:27:32 -05:00
|
|
|
"@charset \"foo\";\na {\n color: red;\n}\n",
|
|
|
|
"a {\n color: red;\n}\n"
|
|
|
|
);
|
2021-07-20 20:41:21 -04:00
|
|
|
error!(
|
|
|
|
invalid_charset_value,
|
|
|
|
"@charset 1;",
|
|
|
|
"Error: Expected string."
|
|
|
|
);
|
|
|
|
error!(
|
|
|
|
invalid_charset_value_unquoted_string,
|
|
|
|
"@charset a;",
|
|
|
|
"Error: Expected string."
|
|
|
|
);
|