From 85fbacb197e7b0de89facf334a40c59a2e1e7b8d Mon Sep 17 00:00:00 2001 From: Maxim Zhiburt Date: Mon, 12 Jun 2023 01:33:54 +0300 Subject: [PATCH] nu-table: Bump tabled to 0.12.1 (#9341) close #9335 I am not sure whether the fix was better to be delived as a minor bump but it is what is is. Could you @fdncred test it somehow? I did it by checking out back the the original commit before the PR refered in the issue. --------- Signed-off-by: Maxim Zhiburt Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com> --- Cargo.lock | 33 ++++++++----------- crates/nu-command/Cargo.toml | 2 +- crates/nu-command/tests/commands/table.rs | 40 +++++++++++------------ crates/nu-table/Cargo.toml | 3 +- crates/nu-table/tests/constrains.rs | 6 ++-- 5 files changed, 39 insertions(+), 45 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81d427e3c4..cd5f614975 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,6 +95,15 @@ dependencies = [ "ansitok", ] +[[package]] +name = "ansi-str" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cf4578926a981ab0ca955dc023541d19de37112bc24c1a197bd806d3d86ad1d" +dependencies = [ + "ansitok", +] + [[package]] name = "ansitok" version = "0.2.0" @@ -2875,7 +2884,7 @@ name = "nu-explore" version = "0.81.1" dependencies = [ "ahash 0.8.3", - "ansi-str", + "ansi-str 0.7.2", "crossterm 0.26.1", "lscolors", "nu-ansi-term", @@ -3406,7 +3415,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fdfe703c51ddc52887ad78fc69cd2ea78d895ffcd6e955c9d03566db8ab5bb1" dependencies = [ - "ansi-str", + "ansi-str 0.7.2", "ansitok", "bytecount", "fnv", @@ -5135,30 +5144,16 @@ dependencies = [ [[package]] name = "tabled" -version = "0.12.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da1a2e56bbf7bfdd08aaa7592157a742205459eff774b73bc01809ae2d99dc2a" +checksum = "0ce69a5028cd9576063ec1f48edb2c75339fd835e6094ef3e05b3a079bf594a6" dependencies = [ - "ansi-str", + "ansi-str 0.8.0", "ansitok", "papergrid", - "tabled_derive", "unicode-width", ] -[[package]] -name = "tabled_derive" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99f688a08b54f4f02f0a3c382aefdb7884d3d69609f785bd253dc033243e3fe4" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "target-features" version = "0.1.4" diff --git a/crates/nu-command/Cargo.toml b/crates/nu-command/Cargo.toml index 4b48109a73..53a74d7009 100644 --- a/crates/nu-command/Cargo.toml +++ b/crates/nu-command/Cargo.toml @@ -89,7 +89,7 @@ serde_yaml = "0.9" sha2 = "0.10" sqlparser = { version = "0.33", features = ["serde"], optional = true } sysinfo = "0.29" -tabled = "0.12" +tabled = { version = "0.12.2", features = ["color"], default-features = false } terminal_size = "0.2" titlecase = "2.0" toml = "0.7" diff --git a/crates/nu-command/tests/commands/table.rs b/crates/nu-command/tests/commands/table.rs index d1bbfa54da..058c457466 100644 --- a/crates/nu-command/tests/commands/table.rs +++ b/crates/nu-command/tests/commands/table.rs @@ -784,22 +784,21 @@ fn test_expand_big_0() { "│ │ │ │ │ │ │ │ field} │ │ │ │", "│ │ │ │ │ │ │ pkg-fmt │ tgz │ │ │ │", "│ │ │ │ │ │ │ pkg-url │ { repo │ │ │ │", - "│ │ │ │ │ │ │ │ │ │ │ │", - "│ │ │ │ │ │ │ │ }/rele │ │ │ │", - "│ │ │ │ │ │ │ │ ases/d │ │ │ │", - "│ │ │ │ │ │ │ │ ownloa │ │ │ │", - "│ │ │ │ │ │ │ │ d/{ │ │ │ │", - "│ │ │ │ │ │ │ │ versio │ │ │ │", - "│ │ │ │ │ │ │ │ n }/{ │ │ │ │", + "│ │ │ │ │ │ │ │ }/rel │ │ │ │", + "│ │ │ │ │ │ │ │ eases/ │ │ │ │", + "│ │ │ │ │ │ │ │ downlo │ │ │ │", + "│ │ │ │ │ │ │ │ ad/{ v │ │ │ │", + "│ │ │ │ │ │ │ │ ersion │ │ │ │", + "│ │ │ │ │ │ │ │ }/{ │ │ │ │", "│ │ │ │ │ │ │ │ name │ │ │ │", + "│ │ │ │ │ │ │ │ }-{ ve │ │ │ │", + "│ │ │ │ │ │ │ │ rsion │ │ │ │", "│ │ │ │ │ │ │ │ }-{ │ │ │ │", - "│ │ │ │ │ │ │ │ versio │ │ │ │", - "│ │ │ │ │ │ │ │ n }-{ │ │ │ │", "│ │ │ │ │ │ │ │ target │ │ │ │", - "│ │ │ │ │ │ │ │ }.{ │ │ │ │", - "│ │ │ │ │ │ │ │ archiv │ │ │ │", - "│ │ │ │ │ │ │ │ e-form │ │ │ │", - "│ │ │ │ │ │ │ │ at } │ │ │ │", + "│ │ │ │ │ │ │ │ }.{ a │ │ │ │", + "│ │ │ │ │ │ │ │ rchive │ │ │ │", + "│ │ │ │ │ │ │ │ -forma │ │ │ │", + "│ │ │ │ │ │ │ │ t } │ │ │ │", "│ │ │ │ │ │ ╰───────────┴────────╯ │ │ │", "│ │ │ │ ╰──────────┴────────────────────────╯ │ │", "│ │ │ name │ nu │ │", @@ -1046,6 +1045,8 @@ fn test_expand_big_0() { "open sample.toml | table --expand --width=60" )); + _print_lines(&actual.out, 60); + let expected = join_lines([ "╭──────────────────┬───────────────────────────────────────╮", "│ │ ╭───┬─────────┬────────────╮ │", @@ -1230,9 +1231,8 @@ fn test_expand_big_0() { "│ package │ │ │ ╭───┬───────────╮ │ │", "│ │ │ authors │ │ 0 │ The │ │ │", "│ │ │ │ │ │ Nushell │ │ │", - "│ │ │ │ │ │ Project │ │ │", - "│ │ │ │ │ │ Developer │ │ │", - "│ │ │ │ │ │ s │ │ │", + "│ │ │ │ │ │ Project D │ │ │", + "│ │ │ │ │ │ evelopers │ │ │", "│ │ │ │ ╰───┴───────────╯ │ │", "│ │ │ default-run │ nu │ │", "│ │ │ description │ A new type of │ │", @@ -1266,9 +1266,8 @@ fn test_expand_big_0() { "│ │ ╭───────────┬───────────────────────╮ │", "│ patch │ │ │ ╭──────────┬────────╮ │ │", "│ │ │ crates-io │ │ reedline │ {recor │ │ │", - "│ │ │ │ │ │ d 2 │ │ │", - "│ │ │ │ │ │ fields │ │ │", - "│ │ │ │ │ │ } │ │ │", + "│ │ │ │ │ │ d 2 fi │ │ │", + "│ │ │ │ │ │ elds} │ │ │", "│ │ │ │ ╰──────────┴────────╯ │ │", "│ │ ╰───────────┴───────────────────────╯ │", "│ target │ {record 3 fields} │", @@ -1312,6 +1311,8 @@ fn test_expand_big_0() { "open sample.toml | table --expand --width=40" )); + _print_lines(&actual.out, 40); + let expected = join_lines([ "╭──────────────────┬───────────────────╮", "│ bench │ [table 1 row] │", @@ -1607,7 +1608,6 @@ fn table_expande_with_no_header_internally_1() { let actual = nu!(format!("{} | table --expand --width 136", nu_value.trim())); - println!("{}", actual.out); assert_eq!( actual.out, join_lines([ diff --git a/crates/nu-table/Cargo.toml b/crates/nu-table/Cargo.toml index 913b0cadd9..cd264fe222 100644 --- a/crates/nu-table/Cargo.toml +++ b/crates/nu-table/Cargo.toml @@ -16,8 +16,7 @@ nu-utils = { path = "../nu-utils", version = "0.81.1" } nu-engine = { path = "../nu-engine", version = "0.81.1" } nu-color-config = { path = "../nu-color-config", version = "0.81.1" } nu-ansi-term = "0.47.0" - -tabled = { version = "0.12", features = ["color"], default-features = false } +tabled = { version = "0.12.2", features = ["color"], default-features = false } ahash = "0.8.3" [dev-dependencies] diff --git a/crates/nu-table/tests/constrains.rs b/crates/nu-table/tests/constrains.rs index a9d5b078a4..2a26eef418 100644 --- a/crates/nu-table/tests/constrains.rs +++ b/crates/nu-table/tests/constrains.rs @@ -124,9 +124,9 @@ fn wrap_keep_words_test() { (10, None), (11, None), (12, Some("┏━━━━┳━━━━━┓\n┃ 12 ┃ ... ┃\n┃ 3 ┃ ┃\n┃ 45 ┃ ┃\n┃ 67 ┃ ┃\n┃ 8 ┃ ┃\n┣━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━┻━━━━━┛")), - (13, Some("┏━━━━━┳━━━━━┓\n┃ 123 ┃ ... ┃\n┃ ┃ ┃\n┃ 456 ┃ ┃\n┃ 78 ┃ ┃\n┣━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━┻━━━━━┛")), - (21, Some("┏━━━━━━┳━━━━━━┳━━━━━┓\n┃ 123 ┃ qweq ┃ ... ┃\n┃ 4567 ┃ w ┃ ┃\n┃ 8 ┃ eqwe ┃ ┃\n┣━━━━━━╋━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ ... ┃\n┃ 0 ┃ 1 ┃ ... ┃\n┗━━━━━━┻━━━━━━┻━━━━━┛")), - (29, Some("┏━━━━━━━━━━┳━━━━━━━━━━┳━━━━━┓\n┃ 123 ┃ qweqw ┃ ... ┃\n┃ 45678 ┃ eqwe ┃ ┃\n┣━━━━━━━━━━╋━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ ... ┃\n┃ 0 ┃ 1 ┃ ... ┃\n┗━━━━━━━━━━┻━━━━━━━━━━┻━━━━━┛")), + (13, Some("┏━━━━━┳━━━━━┓\n┃ 123 ┃ ... ┃\n┃ 45 ┃ ┃\n┃ 678 ┃ ┃\n┣━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━┻━━━━━┛")), + (21, Some("┏━━━━━━┳━━━━━━┳━━━━━┓\n┃ 123 ┃ qweq ┃ ... ┃\n┃ 4567 ┃ w ┃ ┃\n┃ 8 ┃ eqwe ┃ ┃\n┣━━━━━━╋━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ ... ┃\n┃ 0 ┃ 1 ┃ ... ┃\n┗━━━━━━┻━━━━━━┻━━━━━┛")), + (29, Some("┏━━━━━━━━━━┳━━━━━━━━━━┳━━━━━┓\n┃ 123 ┃ qweqw ┃ ... ┃\n┃ 45678 ┃ eqwe ┃ ┃\n┣━━━━━━━━━━╋━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ ... ┃\n┃ 0 ┃ 1 ┃ ... ┃\n┗━━━━━━━━━━┻━━━━━━━━━━┻━━━━━┛")), (49, Some("┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweqw eqwe ┃ xxx xx xx x xx ┃ ... ┃\n┃ ┃ ┃ x xx xx ┃ ┃\n┣━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━┻━━━━━┛")), ];