mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 08:01:30 +02:00
fix range semantic in detect_columns, str substring, str index-of (#12894)
# Description Fixes: https://github.com/nushell/nushell/issues/7761 It's still unsure if we want to change the `range semantic` itself, but it's good to keep range semantic consistent between nushell commands. # User-Facing Changes ### Before ```nushell ❯ "abc" | str substring 1..=2 b ``` ### After ```nushell ❯ "abc" | str substring 1..=2 bc ``` # Tests + Formatting Adjust tests to fit new behavior
This commit is contained in:
@@ -3,7 +3,7 @@ use crate::repl::tests::{fail_test, run_test, TestResult};
|
||||
#[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 ')'); $s | str substring ($start + 1)..($end)"#,
|
||||
r#"let s = '[Rust 程序设计语言](title-page.md)'; let start = ($s | str index-of '('); let end = ($s | str index-of ')'); $s | str substring ($start + 1)..<($end)"#,
|
||||
"title-page.md",
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user