mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 10:45:41 +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:
@ -269,7 +269,7 @@ fn substring_errors_if_start_index_is_greater_than_end_index() {
|
||||
cwd: dirs.test(), pipeline(
|
||||
r#"
|
||||
open sample.toml
|
||||
| str substring 6..5 fortune.teller.phone
|
||||
| str substring 6..4 fortune.teller.phone
|
||||
"#
|
||||
));
|
||||
|
||||
@ -342,7 +342,7 @@ fn substrings_the_input_and_treats_start_index_as_zero_if_blank_start_index_give
|
||||
cwd: dirs.test(), pipeline(
|
||||
r#"
|
||||
open sample.toml
|
||||
| str substring ..2 package.name
|
||||
| str substring ..1 package.name
|
||||
| get package.name
|
||||
"#
|
||||
));
|
||||
|
Reference in New Issue
Block a user