mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 00:26:05 +02:00
Use long options for string (#10777)
This commit is contained in:
@ -49,7 +49,7 @@ fn detect_columns_with_flag_c() {
|
||||
for case in cases.into_iter() {
|
||||
let out = nu!(
|
||||
cwd: dirs.test(),
|
||||
"({} | detect columns -c {}) == {}",
|
||||
"({} | detect columns --combine-columns {}) == {}",
|
||||
case.0,
|
||||
case.2,
|
||||
case.1,
|
||||
@ -57,7 +57,7 @@ fn detect_columns_with_flag_c() {
|
||||
|
||||
assert_eq!(
|
||||
out.out, "true",
|
||||
"({} | detect columns -c {}) == {}",
|
||||
"({} | detect columns --combine-columns {}) == {}",
|
||||
case.0, case.2, case.1
|
||||
);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ fn parse_script_with_wrong_type() {
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(), pipeline(
|
||||
"
|
||||
nu-check -d --as-module script.nu
|
||||
nu-check --debug --as-module script.nu
|
||||
"
|
||||
));
|
||||
|
||||
@ -68,7 +68,7 @@ fn parse_script_failure() {
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(), pipeline(
|
||||
"
|
||||
nu-check -d script.nu
|
||||
nu-check --debug script.nu
|
||||
"
|
||||
));
|
||||
|
||||
@ -126,7 +126,7 @@ fn parse_module_with_wrong_type() {
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(), pipeline(
|
||||
"
|
||||
nu-check -d foo.nu
|
||||
nu-check --debug foo.nu
|
||||
"
|
||||
));
|
||||
|
||||
@ -154,7 +154,7 @@ fn parse_module_failure() {
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(), pipeline(
|
||||
"
|
||||
nu-check -d --as-module foo.nu
|
||||
nu-check --debug --as-module foo.nu
|
||||
"
|
||||
));
|
||||
|
||||
@ -319,7 +319,7 @@ fn parse_string_as_script() {
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(), pipeline(
|
||||
r#"
|
||||
echo $'two(char nl)lines' | nu-check -d --as-module
|
||||
echo $'two(char nl)lines' | nu-check --debug --as-module
|
||||
"#
|
||||
));
|
||||
|
||||
@ -545,7 +545,7 @@ fn parse_module_success_with_complex_external_stream() {
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(), pipeline(
|
||||
"
|
||||
open grep.nu | nu-check -d --as-module
|
||||
open grep.nu | nu-check --debug --as-module
|
||||
"
|
||||
));
|
||||
|
||||
@ -594,7 +594,7 @@ fn parse_with_flag_all_success_for_complex_external_stream() {
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(), pipeline(
|
||||
"
|
||||
open grep.nu | nu-check -ad
|
||||
open grep.nu | nu-check --all --debug
|
||||
"
|
||||
));
|
||||
|
||||
@ -643,7 +643,7 @@ fn parse_with_flag_all_failure_for_complex_external_stream() {
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(), pipeline(
|
||||
"
|
||||
open grep.nu | nu-check -ad
|
||||
open grep.nu | nu-check --all --debug
|
||||
"
|
||||
));
|
||||
|
||||
@ -692,7 +692,7 @@ fn parse_with_flag_all_failure_for_complex_list_stream() {
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(), pipeline(
|
||||
"
|
||||
open grep.nu | lines | nu-check -ad
|
||||
open grep.nu | lines | nu-check --all --debug
|
||||
"
|
||||
));
|
||||
|
||||
|
@ -186,8 +186,9 @@ fn select_ignores_errors_successfully3() {
|
||||
|
||||
#[test]
|
||||
fn select_ignores_errors_successfully4() {
|
||||
let actual =
|
||||
nu!(r#""key val\na 1\nb 2\n" | lines | split column -c " " | select foo? | to nuon"#);
|
||||
let actual = nu!(
|
||||
r#""key val\na 1\nb 2\n" | lines | split column --collapse-empty " " | select foo? | to nuon"#
|
||||
);
|
||||
|
||||
assert_eq!(actual.out, r#"[[foo]; [null], [null], [null]]"#.to_string());
|
||||
assert!(actual.err.is_empty());
|
||||
@ -211,7 +212,8 @@ fn select_failed2() {
|
||||
|
||||
#[test]
|
||||
fn select_failed3() {
|
||||
let actual = nu!(r#""key val\na 1\nb 2\n" | lines | split column -c " " | select "100""#);
|
||||
let actual =
|
||||
nu!(r#""key val\na 1\nb 2\n" | lines | split column --collapse-empty " " | select "100""#);
|
||||
|
||||
assert!(actual.out.is_empty());
|
||||
assert!(actual.err.contains("cannot find column"));
|
||||
|
@ -39,7 +39,7 @@ fn to_column() {
|
||||
open sample2.txt
|
||||
| lines
|
||||
| str trim
|
||||
| split column -r '\s*,\s*'
|
||||
| split column --regex '\s*,\s*'
|
||||
| get column2
|
||||
"
|
||||
));
|
||||
|
@ -29,7 +29,7 @@ fn trims() {
|
||||
fn error_trim_multiple_chars() {
|
||||
let actual = nu!(pipeline(
|
||||
r#"
|
||||
echo "does it work now?!" | str trim -c "?!"
|
||||
echo "does it work now?!" | str trim --char "?!"
|
||||
"#
|
||||
));
|
||||
|
||||
|
Reference in New Issue
Block a user