Skip to content

Commit e57596f

Browse files
committed
fix parser
1 parent 54bdcff commit e57596f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/lib.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -699,11 +699,18 @@ mod tests {
699699
StringOrInitOrOptions::StringOrInit(str_or_init) => {
700700
if i == 0 {
701701
input = str_or_init;
702-
} else {
702+
} else if i == 1 {
703703
base_url = match str_or_init {
704704
StringOrInit::String(str) => Some(str.clone()),
705705
StringOrInit::Init(_) => None,
706706
};
707+
} else if matches!(&case.expected_obj, Some(StringOrInit::String(s)) if s == "error")
708+
{
709+
println!("Expected not to pass due to bad parameters");
710+
println!("✅ Passed");
711+
return;
712+
} else {
713+
panic!("Failed to parse testcase");
707714
}
708715
}
709716
StringOrInitOrOptions::Options(opts) => {

src/testdata/urlpatterntestdata.json

-1
Original file line numberDiff line numberDiff line change
@@ -2782,7 +2782,6 @@
27822782
}
27832783
},
27842784
{
2785-
"skip": "this does not error. same happens in Chrome as well.",
27862785
"pattern": [ "/foo?bar#baz", { "ignoreCase": true },
27872786
"https://example.com:8080" ],
27882787
"inputs": [{ "pathname": "/FOO", "search": "BAR", "hash": "BAZ",

0 commit comments

Comments
 (0)