Skip to content

match_ignore_ascii_case fails to return value after some characters #126

@canova

Description

@canova

Simple test case:

diff --git a/src/tests.rs b/src/tests.rs
index 8419943..fe19381 100644
--- a/src/tests.rs
+++ b/src/tests.rs
@@ -843,3 +843,21 @@ fn procedural_masquerade_whitespace() {
         _ => panic!("4"),
     }
 }
+
+#[test]
+fn test_length() {
+    match_ignore_ascii_case! { "fo",
+        "bar" => {},
+        value => assert_eq!(value, "fo"),
+    }
+
+    match_ignore_ascii_case! { "foo",
+        "bar" => {},
+        value => assert_eq!(value, "foo"),
+    }
+
+    match_ignore_ascii_case! { "fooo",
+        "bar" => {},
+        value => assert_eq!(value, "fooo"),
+    }
+}

In this function, first two match_ignore_ascii_case passes but in the third macro, value returns "A". I have the same problem with this macro in servo/servo#15813 But it breaks after 11 characters.

cc @SimonSapin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions