switch substring to bytes (#538)

* switch substring to bytes

* Add a test
This commit is contained in:
JT
2021-12-21 11:49:02 +11:00
committed by GitHub
parent 1609101e62
commit fc7ed1bfe4
2 changed files with 19 additions and 5 deletions

View File

@ -1316,3 +1316,11 @@ fn flatten_should_flatten_inner_table() -> TestResult {
"123",
)
}
#[test]
fn cjk_in_substrings() -> TestResult {
run_test(
r#"let s = '[Rust 程序设计语言](title-page.md)'; let start = ($s | str index-of '('); let end = ($s | str index-of ')'); echo ($s | str substring $"($start + 1),($end)")"#,
"title-page.md",
)
}