From 9159377af860283be2d66e1cf4b84ddfc88d6d04 Mon Sep 17 00:00:00 2001 From: amtoine Date: Sat, 11 Mar 2023 12:33:46 +0100 Subject: [PATCH] fix the tests by using `to nuon --raw` to have single-line results Commands used: ``` sd "to nuon\"" "to nuon --raw\"" **/*.rs git restore crates/nu-command/src/formats/to/nuon.rs ``` and some manuals tweaks as well. --- crates/nu-color-config/src/style_computer.rs | 2 +- crates/nu-command/src/debug/timeit.rs | 4 ++-- crates/nu-command/tests/commands/all.rs | 2 +- crates/nu-command/tests/commands/any.rs | 2 +- crates/nu-command/tests/commands/each.rs | 4 ++-- crates/nu-command/tests/commands/insert.rs | 4 ++-- crates/nu-command/tests/commands/math/mod.rs | 14 +++++++------- crates/nu-command/tests/commands/merge.rs | 12 ++++++------ crates/nu-command/tests/commands/mut_.rs | 4 ++-- crates/nu-command/tests/commands/select.rs | 8 ++++---- crates/nu-command/tests/commands/sort.rs | 14 +++++++------- crates/nu-command/tests/commands/update.rs | 4 ++-- crates/nu-command/tests/commands/upsert.rs | 6 +++--- crates/nu-command/tests/commands/where_.rs | 8 ++++---- crates/nu-command/tests/format_conversions/html.rs | 2 +- crates/nu-command/tests/format_conversions/nuon.rs | 4 ++-- crates/nu-protocol/tests/test_config.rs | 4 ++-- src/tests/test_parser.rs | 2 +- src/tests/test_table_operations.rs | 4 ++-- 19 files changed, 52 insertions(+), 52 deletions(-) diff --git a/crates/nu-color-config/src/style_computer.rs b/crates/nu-color-config/src/style_computer.rs index a40fac7894..b6fb78356f 100644 --- a/crates/nu-color-config/src/style_computer.rs +++ b/crates/nu-color-config/src/style_computer.rs @@ -258,7 +258,7 @@ fn test_computable_style_closure_basic() { } };"#, "[bell book candle] | table | ignore", - "ls | get name | to nuon", + "ls | get name | to nuon --raw", ]; let actual_repl = nu!(cwd: dirs.test(), nu_repl_code(&inp)); assert_eq!(actual_repl.err, ""); diff --git a/crates/nu-command/src/debug/timeit.rs b/crates/nu-command/src/debug/timeit.rs index 1430b2e635..be3f1a3ec9 100644 --- a/crates/nu-command/src/debug/timeit.rs +++ b/crates/nu-command/src/debug/timeit.rs @@ -111,7 +111,7 @@ fn test_time_closure() { use nu_test_support::{nu, nu_repl_code, playground::Playground}; Playground::setup("test_time_closure", |dirs, _| { let inp = [ - r#"[2 3 4] | timeit { to nuon | save foo.txt }"#, + r#"[2 3 4] | timeit { to nuon --raw | save foo.txt }"#, "open foo.txt", ]; let actual_repl = nu!(cwd: dirs.test(), nu_repl_code(&inp)); @@ -125,7 +125,7 @@ fn test_time_closure_2() { use nu_test_support::{nu, nu_repl_code, playground::Playground}; Playground::setup("test_time_closure", |dirs, _| { let inp = [ - r#"[2 3 4] | timeit {|e| {result: $e} | to nuon | save foo.txt }"#, + r#"[2 3 4] | timeit {|e| {result: $e} | to nuon --raw | save foo.txt }"#, "open foo.txt", ]; let actual_repl = nu!(cwd: dirs.test(), nu_repl_code(&inp)); diff --git a/crates/nu-command/tests/commands/all.rs b/crates/nu-command/tests/commands/all.rs index 41d137bea7..b6844d484b 100644 --- a/crates/nu-command/tests/commands/all.rs +++ b/crates/nu-command/tests/commands/all.rs @@ -125,7 +125,7 @@ fn all_uses_enumerate_index() { fn unique_env_each_iteration() { let actual = nu!( cwd: "tests/fixtures/formats", - "[1 2] | all { print ($env.PWD | str ends-with 'formats') | cd '/' | true } | to nuon" + "[1 2] | all { print ($env.PWD | str ends-with 'formats') | cd '/' | true } | to nuon --raw" ); assert_eq!(actual.out, "truetruetrue"); diff --git a/crates/nu-command/tests/commands/any.rs b/crates/nu-command/tests/commands/any.rs index 22104d8b5e..167b5252d9 100644 --- a/crates/nu-command/tests/commands/any.rs +++ b/crates/nu-command/tests/commands/any.rs @@ -101,7 +101,7 @@ fn any_uses_enumerate_index() { fn unique_env_each_iteration() { let actual = nu!( cwd: "tests/fixtures/formats", - "[1 2] | any { print ($env.PWD | str ends-with 'formats') | cd '/' | false } | to nuon" + "[1 2] | any { print ($env.PWD | str ends-with 'formats') | cd '/' | false } | to nuon --raw" ); assert_eq!(actual.out, "truetruefalse"); diff --git a/crates/nu-command/tests/commands/each.rs b/crates/nu-command/tests/commands/each.rs index 50dd8c6b30..65bd95bd7a 100644 --- a/crates/nu-command/tests/commands/each.rs +++ b/crates/nu-command/tests/commands/each.rs @@ -76,7 +76,7 @@ fn each_implicit_it_in_block() { fn each_uses_enumerate_index() { let actual = nu!( cwd: ".", pipeline( - r#"[7 8 9 10] | enumerate | each {|el| $el.index } | to nuon"# + r#"[7 8 9 10] | enumerate | each {|el| $el.index } | to nuon --raw"# )); assert_eq!(actual.out, "[0, 1, 2, 3]"); @@ -86,7 +86,7 @@ fn each_uses_enumerate_index() { fn each_while_uses_enumerate_index() { let actual = nu!( cwd: ".", pipeline( - r#"[7 8 9 10] | enumerate | each while {|el| $el.index } | to nuon"# + r#"[7 8 9 10] | enumerate | each while {|el| $el.index } | to nuon --raw"# )); assert_eq!(actual.out, "[0, 1, 2, 3]"); diff --git a/crates/nu-command/tests/commands/insert.rs b/crates/nu-command/tests/commands/insert.rs index 3aed2f92c9..056bfbd39a 100644 --- a/crates/nu-command/tests/commands/insert.rs +++ b/crates/nu-command/tests/commands/insert.rs @@ -17,7 +17,7 @@ fn insert_the_column() { #[test] fn doesnt_convert_record_to_table() { let actual = nu!( - cwd: ".", r#"{a:1} | insert b 2 | to nuon"# + cwd: ".", r#"{a:1} | insert b 2 | to nuon --raw"# ); assert_eq!(actual.out, "{a: 1, b: 2}"); @@ -90,7 +90,7 @@ fn insert_past_end_list() { fn insert_uses_enumerate_index() { let actual = nu!( cwd: ".", pipeline( - r#"[[a]; [7] [6]] | enumerate | insert b {|el| $el.index + 1 + $el.item.a } | flatten | to nuon"# + r#"[[a]; [7] [6]] | enumerate | insert b {|el| $el.index + 1 + $el.item.a } | flatten | to nuon --raw"# )); assert_eq!(actual.out, "[[index, a, b]; [0, 7, 8], [1, 6, 8]]"); diff --git a/crates/nu-command/tests/commands/math/mod.rs b/crates/nu-command/tests/commands/math/mod.rs index fd03b7109d..fc1445593a 100644 --- a/crates/nu-command/tests/commands/math/mod.rs +++ b/crates/nu-command/tests/commands/math/mod.rs @@ -480,7 +480,7 @@ fn adding_lists() { let actual = nu!( cwd: "tests/fixtures/formats", pipeline( r#" - [1 3] ++ [5 6] | to nuon + [1 3] ++ [5 6] | to nuon --raw "# )); @@ -492,7 +492,7 @@ fn adding_list_and_value() { let actual = nu!( cwd: "tests/fixtures/formats", pipeline( r#" - [1 3] ++ 5 | to nuon + [1 3] ++ 5 | to nuon --raw "# )); @@ -504,7 +504,7 @@ fn adding_value_and_list() { let actual = nu!( cwd: "tests/fixtures/formats", pipeline( r#" - 1 ++ [3 5] | to nuon + 1 ++ [3 5] | to nuon --raw "# )); @@ -516,7 +516,7 @@ fn adding_tables() { let actual = nu!( cwd: "tests/fixtures/formats", pipeline( r#" - [[a b]; [1 2]] ++ [[c d]; [10 11]] | to nuon + [[a b]; [1 2]] ++ [[c d]; [10 11]] | to nuon --raw "# )); assert_eq!(actual.out, "[{a: 1, b: 2}, {c: 10, d: 11}]"); @@ -538,7 +538,7 @@ fn append_binary_values() { let actual = nu!( cwd: "tests/fixtures/formats", pipeline( r#" - 0x[01 02] ++ 0x[03 04] | to nuon + 0x[01 02] ++ 0x[03 04] | to nuon --raw "# )); assert_eq!(actual.out, "0x[01020304]"); @@ -562,12 +562,12 @@ fn int_multiple_string() { fn int_multiple_list() { let actual = nu!( cwd: "tests/fixtures/formats", pipeline( - r#"3 * [1 2] | to nuon"# + r#"3 * [1 2] | to nuon --raw"# )); assert_eq!(actual.out, "[1, 2, 1, 2, 1, 2]"); let actual = nu!( cwd: "tests/fixtures/formats", pipeline( - r#"[1 2] * 3 | to nuon"# + r#"[1 2] * 3 | to nuon --raw"# )); assert_eq!(actual.out, "[1, 2, 1, 2, 1, 2]"); } diff --git a/crates/nu-command/tests/commands/merge.rs b/crates/nu-command/tests/commands/merge.rs index 3effea4301..83afb8008c 100644 --- a/crates/nu-command/tests/commands/merge.rs +++ b/crates/nu-command/tests/commands/merge.rs @@ -47,7 +47,7 @@ fn single_record_no_overwrite() { nu!( cwd: ".", pipeline( r#" - {a: 1, b: 5} | merge {c: 2} | to nuon + {a: 1, b: 5} | merge {c: 2} | to nuon --raw "# )) .out, @@ -61,7 +61,7 @@ fn single_record_overwrite() { nu!( cwd: ".", pipeline( r#" - {a: 1, b: 2} | merge {a: 2} | to nuon + {a: 1, b: 2} | merge {a: 2} | to nuon --raw "# )) .out, @@ -75,7 +75,7 @@ fn single_row_table_overwrite() { nu!( cwd: ".", pipeline( r#" - [[a b]; [1 4]] | merge [[a b]; [2 4]] | to nuon + [[a b]; [1 4]] | merge [[a b]; [2 4]] | to nuon --raw "# )) .out, @@ -89,7 +89,7 @@ fn single_row_table_no_overwrite() { nu!( cwd: ".", pipeline( r#" - [[a b]; [1 4]] | merge [[c d]; [2 4]] | to nuon + [[a b]; [1 4]] | merge [[c d]; [2 4]] | to nuon --raw "# )) .out, @@ -103,7 +103,7 @@ fn multi_row_table_no_overwrite() { nu!( cwd: ".", pipeline( r#" - [[a b]; [1 4] [8 9] [9 9]] | merge [[c d]; [2 4]] | to nuon + [[a b]; [1 4] [8 9] [9 9]] | merge [[c d]; [2 4]] | to nuon --raw "# )) .out, @@ -117,7 +117,7 @@ fn multi_row_table_overwrite() { nu!( cwd: ".", pipeline( r#" - [[a b]; [1 4] [8 9] [9 9]] | merge [[a b]; [7 7]] | to nuon + [[a b]; [1 4] [8 9] [9 9]] | merge [[a b]; [7 7]] | to nuon --raw "# )) .out, diff --git a/crates/nu-command/tests/commands/mut_.rs b/crates/nu-command/tests/commands/mut_.rs index 99f2ba6dc9..7544d36d97 100644 --- a/crates/nu-command/tests/commands/mut_.rs +++ b/crates/nu-command/tests/commands/mut_.rs @@ -101,7 +101,7 @@ fn mut_path_insert_list() { let actual = nu!( cwd: ".", pipeline( r#" - mut a = [0 1 2]; $a.3 = 3; $a | to nuon + mut a = [0 1 2]; $a.3 = 3; $a | to nuon --raw "# )); @@ -125,7 +125,7 @@ fn mut_path_upsert_list() { let actual = nu!( cwd: ".", pipeline( r#" - mut a = [[[3] 2] 1]; $a.0.0.1 = 0; $a.0.2 = 0; $a.2 = 0; $a | to nuon + mut a = [[[3] 2] 1]; $a.0.0.1 = 0; $a.0.2 = 0; $a.2 = 0; $a | to nuon --raw "# )); diff --git a/crates/nu-command/tests/commands/select.rs b/crates/nu-command/tests/commands/select.rs index e01eb2a0a3..876a6a41d1 100644 --- a/crates/nu-command/tests/commands/select.rs +++ b/crates/nu-command/tests/commands/select.rs @@ -178,7 +178,7 @@ fn select_ignores_errors_successfully2() { let actual = nu!( cwd: ".", pipeline( r#" - [{a: 1} {a: 2} {a: 3}] | select -i b | to nuon + [{a: 1} {a: 2} {a: 3}] | select -i b | to nuon --raw "# )); @@ -190,7 +190,7 @@ fn select_ignores_errors_successfully2() { fn select_ignores_errors_successfully3() { let actual = nu!( cwd: ".", pipeline( - r#"sys | select -i invalid_key | to nuon"# + r#"sys | select -i invalid_key | to nuon --raw"# )); assert_eq!(actual.out, "{invalid_key: null}".to_string()); @@ -201,7 +201,7 @@ fn select_ignores_errors_successfully3() { fn select_ignores_errors_successfully4() { let actual = nu!( cwd: ".", pipeline( - r#"[a b c] | select -i invalid_key | to nuon"# + r#"[a b c] | select -i invalid_key | to nuon --raw"# )); assert_eq!( @@ -226,7 +226,7 @@ fn select_ignores_errors_successfully5() { fn select_ignores_errors_successfully6() { let actual = nu!( cwd: ".", pipeline( - r#""key val\na 1\nb 2\n" | lines | split column -c " " | select -i "100" | to nuon"# + r#""key val\na 1\nb 2\n" | lines | split column -c " " | select -i "100" | to nuon --raw"# )); assert_eq!( diff --git a/crates/nu-command/tests/commands/sort.rs b/crates/nu-command/tests/commands/sort.rs index c72b3fa497..3a51948c81 100644 --- a/crates/nu-command/tests/commands/sort.rs +++ b/crates/nu-command/tests/commands/sort.rs @@ -50,7 +50,7 @@ fn sort_different_types() { fn sort_natural() { let actual = nu!( cwd: ".", pipeline( - r#"['1' '2' '3' '4' '5' '10' '100'] | sort -n | to nuon"# + r#"['1' '2' '3' '4' '5' '10' '100'] | sort -n | to nuon --raw"# )); assert_eq!(actual.out, r#"["1", "2", "3", "4", "5", "10", "100"]"#); @@ -60,7 +60,7 @@ fn sort_natural() { fn sort_record_natural() { let actual = nu!( cwd: ".", pipeline( - r#"{10:0,99:0,1:0,9:0,100:0} | sort -n | to nuon"# + r#"{10:0,99:0,1:0,9:0,100:0} | sort -n | to nuon --raw"# )); assert_eq!( @@ -73,7 +73,7 @@ fn sort_record_natural() { fn sort_record_insensitive() { let actual = nu!( cwd: ".", pipeline( - r#"{abe:1,zed:2,ABE:3} | sort -i | to nuon"# + r#"{abe:1,zed:2,ABE:3} | sort -i | to nuon --raw"# )); assert_eq!(actual.out, r#"{abe: 1, ABE: 3, zed: 2}"#); @@ -83,7 +83,7 @@ fn sort_record_insensitive() { fn sort_record_insensitive_reverse() { let actual = nu!( cwd: ".", pipeline( - r#"{abe:1,zed:2,ABE:3} | sort -ir | to nuon"# + r#"{abe:1,zed:2,ABE:3} | sort -ir | to nuon --raw"# )); assert_eq!(actual.out, r#"{zed: 2, ABE: 3, abe: 1}"#); @@ -93,7 +93,7 @@ fn sort_record_insensitive_reverse() { fn sort_record_values_natural() { let actual = nu!( cwd: ".", pipeline( - r#"{1:"1",2:"2",4:"100",3:"10"} | sort -vn | to nuon"# + r#"{1:"1",2:"2",4:"100",3:"10"} | sort -vn | to nuon --raw"# )); assert_eq!(actual.out, r#"{"1": "1", "2": "2", "3": "10", "4": "100"}"#); @@ -103,7 +103,7 @@ fn sort_record_values_natural() { fn sort_record_values_insensitive() { let actual = nu!( cwd: ".", pipeline( - r#"{1:abe,2:zed,3:ABE} | sort -vi | to nuon"# + r#"{1:abe,2:zed,3:ABE} | sort -vi | to nuon --raw"# )); assert_eq!(actual.out, r#"{"1": abe, "3": ABE, "2": zed}"#); @@ -113,7 +113,7 @@ fn sort_record_values_insensitive() { fn sort_record_values_insensitive_reverse() { let actual = nu!( cwd: ".", pipeline( - r#"{1:abe,2:zed,3:ABE} | sort -vir | to nuon"# + r#"{1:abe,2:zed,3:ABE} | sort -vir | to nuon --raw"# )); assert_eq!(actual.out, r#"{"2": zed, "3": ABE, "1": abe}"#); diff --git a/crates/nu-command/tests/commands/update.rs b/crates/nu-command/tests/commands/update.rs index 86d43aa6a1..ddaf6672ca 100644 --- a/crates/nu-command/tests/commands/update.rs +++ b/crates/nu-command/tests/commands/update.rs @@ -17,7 +17,7 @@ fn sets_the_column() { #[test] fn doesnt_convert_record_to_table() { let actual = nu!( - cwd: ".", r#"{a:1} | update a 2 | to nuon"# + cwd: ".", r#"{a:1} | update a 2 | to nuon --raw"# ); assert_eq!(actual.out, "{a: 2}"); @@ -119,7 +119,7 @@ fn update_nonexistent_column() { fn update_uses_enumerate_index() { let actual = nu!( cwd: ".", pipeline( - r#"[[a]; [7] [6]] | enumerate | update item.a {|el| $el.index + 1 + $el.item.a } | flatten | to nuon"# + r#"[[a]; [7] [6]] | enumerate | update item.a {|el| $el.index + 1 + $el.item.a } | flatten | to nuon --raw"# )); assert_eq!(actual.out, "[[index, a]; [0, 8], [1, 8]]"); diff --git a/crates/nu-command/tests/commands/upsert.rs b/crates/nu-command/tests/commands/upsert.rs index 73197e3d57..a82a41728d 100644 --- a/crates/nu-command/tests/commands/upsert.rs +++ b/crates/nu-command/tests/commands/upsert.rs @@ -17,7 +17,7 @@ fn sets_the_column() { #[test] fn doesnt_convert_record_to_table() { let actual = nu!( - cwd: ".", r#"{a:1} | upsert a 2 | to nuon"# + cwd: ".", r#"{a:1} | upsert a 2 | to nuon --raw"# ); assert_eq!(actual.out, "{a: 2}"); @@ -72,7 +72,7 @@ fn sets_the_column_from_a_subexpression() { fn upsert_uses_enumerate_index_inserting() { let actual = nu!( cwd: ".", pipeline( - r#"[[a]; [7] [6]] | enumerate | upsert b {|el| $el.index + 1 + $el.item.a } | flatten | to nuon"# + r#"[[a]; [7] [6]] | enumerate | upsert b {|el| $el.index + 1 + $el.item.a } | flatten | to nuon --raw"# )); assert_eq!(actual.out, "[[index, a, b]; [0, 7, 8], [1, 6, 8]]"); @@ -82,7 +82,7 @@ fn upsert_uses_enumerate_index_inserting() { fn upsert_uses_enumerate_index_updating() { let actual = nu!( cwd: ".", pipeline( - r#"[[a]; [7] [6]] | enumerate | upsert a {|el| $el.index + 1 + $el.item.a } | flatten | to nuon"# + r#"[[a]; [7] [6]] | enumerate | upsert a {|el| $el.index + 1 + $el.item.a } | flatten | to nuon --raw"# )); assert_eq!(actual.out, "[[index, a]; [0, 8], [1, 8]]"); diff --git a/crates/nu-command/tests/commands/where_.rs b/crates/nu-command/tests/commands/where_.rs index d9e0feca50..d3eb44e35f 100644 --- a/crates/nu-command/tests/commands/where_.rs +++ b/crates/nu-command/tests/commands/where_.rs @@ -35,7 +35,7 @@ fn where_inside_block_works() { fn filters_with_0_arity_block() { let actual = nu!( cwd: ".", - "[1 2 3 4] | where { $in < 3 } | to nuon" + "[1 2 3 4] | where { $in < 3 } | to nuon --raw" ); assert_eq!(actual.out, "[1, 2]"); @@ -45,7 +45,7 @@ fn filters_with_0_arity_block() { fn filters_with_1_arity_block() { let actual = nu!( cwd: ".", - "[1 2 3 6 7 8] | where {|e| $e < 5 } | to nuon" + "[1 2 3 6 7 8] | where {|e| $e < 5 } | to nuon --raw" ); assert_eq!(actual.out, "[1, 2, 3]"); @@ -55,7 +55,7 @@ fn filters_with_1_arity_block() { fn unique_env_each_iteration() { let actual = nu!( cwd: "tests/fixtures/formats", - "[1 2] | where { print ($env.PWD | str ends-with 'formats') | cd '/' | true } | to nuon" + "[1 2] | where { print ($env.PWD | str ends-with 'formats') | cd '/' | true } | to nuon --raw" ); assert_eq!(actual.out, "truetrue[1, 2]"); @@ -85,7 +85,7 @@ fn where_not_in_table() { fn where_uses_enumerate_index() { let actual = nu!( cwd: ".", - r#"[7 8 9 10] | enumerate | where {|el| $el.index < 2 } | to nuon"# + r#"[7 8 9 10] | enumerate | where {|el| $el.index < 2 } | to nuon --raw"# ); assert_eq!(actual.out, "[[index, item]; [0, 7], [1, 8]]"); diff --git a/crates/nu-command/tests/format_conversions/html.rs b/crates/nu-command/tests/format_conversions/html.rs index 9a1e18c6a2..d2df2566ee 100644 --- a/crates/nu-command/tests/format_conversions/html.rs +++ b/crates/nu-command/tests/format_conversions/html.rs @@ -80,7 +80,7 @@ fn test_no_color_flag() { fn test_list() { let actual = nu!( cwd: ".", - r#"to html --list | where name == C64 | get 0 | to nuon"# + r#"to html --list | where name == C64 | get 0 | to nuon --raw"# ); assert_eq!( actual.out, diff --git a/crates/nu-command/tests/format_conversions/nuon.rs b/crates/nu-command/tests/format_conversions/nuon.rs index 72ad87c718..c767aa3b9d 100644 --- a/crates/nu-command/tests/format_conversions/nuon.rs +++ b/crates/nu-command/tests/format_conversions/nuon.rs @@ -457,14 +457,14 @@ fn does_not_quote_strings_unnecessarily() { let actual = nu!( cwd: "tests/fixtures/formats", pipeline( r#" - let test = [["a", "b", "c d"]; [1 2 3] [4 5 6]]; $test | to nuon + let test = [["a", "b", "c d"]; [1 2 3] [4 5 6]]; $test | to nuon --raw "# )); assert_eq!(actual.out, "[[a, b, \"c d\"]; [1, 2, 3], [4, 5, 6]]"); let actual = nu!( cwd: "tests/fixtures/formats", pipeline( r#" - let a = {"ro name": "sam" rank: 10}; $a | to nuon + let a = {"ro name": "sam" rank: 10}; $a | to nuon --raw "# )); assert_eq!(actual.out, "{\"ro name\": sam, rank: 10}"); diff --git a/crates/nu-protocol/tests/test_config.rs b/crates/nu-protocol/tests/test_config.rs index 7a1624eb74..3cd2079475 100644 --- a/crates/nu-protocol/tests/test_config.rs +++ b/crates/nu-protocol/tests/test_config.rs @@ -34,7 +34,7 @@ fn filesize_metric_overrides_format() { fn filesize_format_auto_metric_true() { let code = &[ r#"let-env config = { filesize: { metric: true, format:"auto" } }"#, - r#"[2mb 2gb 2tb] | into string | to nuon"#, + r#"[2mb 2gb 2tb] | into string | to nuon --raw"#, ]; let actual = nu!(cwd: ".", nu_repl_code( code )); assert_eq!(actual.out, r#"["2.0 MB", "2.0 GB", "2.0 TB"]"#); @@ -44,7 +44,7 @@ fn filesize_format_auto_metric_true() { fn filesize_format_auto_metric_false() { let code = &[ r#"let-env config = { filesize: { metric: false, format:"auto" } }"#, - r#"[2mb 2gb 2tb] | into string | to nuon"#, + r#"[2mb 2gb 2tb] | into string | to nuon --raw"#, ]; let actual = nu!(cwd: ".", nu_repl_code( code )); assert_eq!(actual.out, r#"["1.9 MiB", "1.9 GiB", "1.8 TiB"]"#); diff --git a/src/tests/test_parser.rs b/src/tests/test_parser.rs index eff81e9600..5aaf1a455a 100644 --- a/src/tests/test_parser.rs +++ b/src/tests/test_parser.rs @@ -148,7 +148,7 @@ fn bad_var_name2() -> TestResult { #[test] fn long_flag() -> TestResult { run_test( - r#"([a, b, c] | enumerate | each --keep-empty { |e| if $e.index != 1 { 100 }}).1 | to nuon"#, + r#"([a, b, c] | enumerate | each --keep-empty { |e| if $e.index != 1 { 100 }}).1 | to nuon --raw"#, "null", ) } diff --git a/src/tests/test_table_operations.rs b/src/tests/test_table_operations.rs index a7a2e9caa5..f7c53a9ed7 100644 --- a/src/tests/test_table_operations.rs +++ b/src/tests/test_table_operations.rs @@ -259,7 +259,7 @@ fn length_defaulted_columns() -> TestResult { fn nullify_errors() -> TestResult { run_test("([{a:1} {a:2} {a:3}] | get -i foo | length) == 3", "true")?; run_test( - "([{a:1} {a:2} {a:3}] | get -i foo | to nuon) == '[null, null, null]'", + "([{a:1} {a:2} {a:3}] | get -i foo | to nuon --raw) == '[null, null, null]'", "true", ) } @@ -267,7 +267,7 @@ fn nullify_errors() -> TestResult { #[test] fn nullify_holes() -> TestResult { run_test( - "([{a:1} {b:2} {a:3}] | get -i a | to nuon) == '[1, null, 3]'", + "([{a:1} {b:2} {a:3}] | get -i a | to nuon --raw) == '[1, null, 3]'", "true", ) }