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