Allow attributes in test macros
This commit is contained in:
parent
585786318f
commit
92809b1d03
@ -4,11 +4,13 @@
|
||||
mod macros;
|
||||
|
||||
test!(
|
||||
#[ignore]
|
||||
utf8_input,
|
||||
"a {\n color: 🦆;\n}\n",
|
||||
"@charset \"UTF-8\";\na {\n color: 🦆;\n}\n"
|
||||
);
|
||||
test!(
|
||||
#[ignore]
|
||||
ascii_charset_utf8,
|
||||
"@charset \"UTF-8\";\na {\n color: red;\n}\n",
|
||||
"a {\n color: red;\n}\n"
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! test {
|
||||
($func:ident, $input:expr) => {
|
||||
($( #[$attr:meta] ),*$func:ident, $input:expr) => {
|
||||
$(#[$attr])*
|
||||
#[test]
|
||||
#[allow(non_snake_case)]
|
||||
fn $func() {
|
||||
@ -17,7 +18,8 @@ macro_rules! test {
|
||||
);
|
||||
}
|
||||
};
|
||||
($func:ident, $input:expr, $output:expr) => {
|
||||
($( #[$attr:meta] ),*$func:ident, $input:expr, $output:expr) => {
|
||||
$(#[$attr])*
|
||||
#[test]
|
||||
#[allow(non_snake_case)]
|
||||
fn $func() {
|
||||
@ -36,7 +38,8 @@ macro_rules! test {
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! error {
|
||||
($func:ident, $input:expr, $err:expr) => {
|
||||
($( #[$attr:meta] ),*$func:ident, $input:expr, $err:expr) => {
|
||||
$(#[$attr])*
|
||||
#[test]
|
||||
#[allow(non_snake_case)]
|
||||
fn $func() {
|
||||
|
@ -184,6 +184,7 @@ test!(
|
||||
"a {\n color: Xabcd;\n}\n"
|
||||
);
|
||||
test!(
|
||||
#[ignore]
|
||||
str_insert_double_width_char,
|
||||
"a {\n color: str-insert(\"👭\", \"c\", 2);\n}\n",
|
||||
"@charset \"UTF-8\";\na {\n color: \"👭c\";\n}\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user