mirror of
https://github.com/typst/typst
synced 2025-05-15 01:25:28 +08:00
Add test for ends-with fix
This commit is contained in:
parent
dacab7869f
commit
a6f347fbb7
@ -123,14 +123,10 @@ impl Str {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// There might still be a match overlapping this one, so
|
// There might still be a match overlapping this one, so
|
||||||
// restart at the next code point
|
// restart at the next code point.
|
||||||
if let Some(c) = &self[mat.start()..].chars().next() {
|
let Some(c) = self[mat.start()..].chars().next() else { break };
|
||||||
start_byte = mat.start() + c.len_utf8();
|
start_byte = mat.start() + c.len_utf8();
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,6 +81,9 @@
|
|||||||
#test("Typst".ends-with(regex("\d*")), true)
|
#test("Typst".ends-with(regex("\d*")), true)
|
||||||
#test("Typst".ends-with(regex("\d+")), false)
|
#test("Typst".ends-with(regex("\d+")), false)
|
||||||
#test("Typ12".ends-with(regex("\d+")), true)
|
#test("Typ12".ends-with(regex("\d+")), true)
|
||||||
|
#test("typst13".ends-with(regex("1[0-9]")), true)
|
||||||
|
#test("typst113".ends-with(regex("1[0-9]")), true)
|
||||||
|
#test("typst23".ends-with(regex("1[0-9]")), false)
|
||||||
|
|
||||||
---
|
---
|
||||||
// Test the `find` and `position` methods.
|
// Test the `find` and `position` methods.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user