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 <zhiburt@gmail.com>
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
This commit is contained in:
Maxim Zhiburt 2023-06-12 01:33:54 +03:00 committed by GitHub
parent 73921f4bd7
commit 85fbacb197
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 45 deletions

33
Cargo.lock generated
View file

@ -95,6 +95,15 @@ dependencies = [
"ansitok", "ansitok",
] ]
[[package]]
name = "ansi-str"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cf4578926a981ab0ca955dc023541d19de37112bc24c1a197bd806d3d86ad1d"
dependencies = [
"ansitok",
]
[[package]] [[package]]
name = "ansitok" name = "ansitok"
version = "0.2.0" version = "0.2.0"
@ -2875,7 +2884,7 @@ name = "nu-explore"
version = "0.81.1" version = "0.81.1"
dependencies = [ dependencies = [
"ahash 0.8.3", "ahash 0.8.3",
"ansi-str", "ansi-str 0.7.2",
"crossterm 0.26.1", "crossterm 0.26.1",
"lscolors", "lscolors",
"nu-ansi-term", "nu-ansi-term",
@ -3406,7 +3415,7 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fdfe703c51ddc52887ad78fc69cd2ea78d895ffcd6e955c9d03566db8ab5bb1" checksum = "1fdfe703c51ddc52887ad78fc69cd2ea78d895ffcd6e955c9d03566db8ab5bb1"
dependencies = [ dependencies = [
"ansi-str", "ansi-str 0.7.2",
"ansitok", "ansitok",
"bytecount", "bytecount",
"fnv", "fnv",
@ -5135,30 +5144,16 @@ dependencies = [
[[package]] [[package]]
name = "tabled" name = "tabled"
version = "0.12.0" version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da1a2e56bbf7bfdd08aaa7592157a742205459eff774b73bc01809ae2d99dc2a" checksum = "0ce69a5028cd9576063ec1f48edb2c75339fd835e6094ef3e05b3a079bf594a6"
dependencies = [ dependencies = [
"ansi-str", "ansi-str 0.8.0",
"ansitok", "ansitok",
"papergrid", "papergrid",
"tabled_derive",
"unicode-width", "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]] [[package]]
name = "target-features" name = "target-features"
version = "0.1.4" version = "0.1.4"

View file

@ -89,7 +89,7 @@ serde_yaml = "0.9"
sha2 = "0.10" sha2 = "0.10"
sqlparser = { version = "0.33", features = ["serde"], optional = true } sqlparser = { version = "0.33", features = ["serde"], optional = true }
sysinfo = "0.29" sysinfo = "0.29"
tabled = "0.12" tabled = { version = "0.12.2", features = ["color"], default-features = false }
terminal_size = "0.2" terminal_size = "0.2"
titlecase = "2.0" titlecase = "2.0"
toml = "0.7" toml = "0.7"

View file

@ -784,22 +784,21 @@ fn test_expand_big_0() {
"│ │ │ │ │ │ │ │ field} │ │ │ │", "│ │ │ │ │ │ │ │ field} │ │ │ │",
"│ │ │ │ │ │ │ pkg-fmt │ tgz │ │ │ │", "│ │ │ │ │ │ │ pkg-fmt │ tgz │ │ │ │",
"│ │ │ │ │ │ │ pkg-url │ { repo │ │ │ │", "│ │ │ │ │ │ │ pkg-url │ { repo │ │ │ │",
"│ │ │ │ │ │ │ │ │ │ │ │", "│ │ │ │ │ │ │ │ }/rel │ │ │ │",
"│ │ │ │ │ │ │ │ }/rele │ │ │ │", "│ │ │ │ │ │ │ │ eases/ │ │ │ │",
"│ │ │ │ │ │ │ │ ases/d │ │ │ │", "│ │ │ │ │ │ │ │ downlo │ │ │ │",
"│ │ │ │ │ │ │ │ ownloa │ │ │ │", "│ │ │ │ │ │ │ │ ad/{ v │ │ │ │",
"│ │ │ │ │ │ │ │ d/{ │ │ │ │", "│ │ │ │ │ │ │ │ ersion │ │ │ │",
"│ │ │ │ │ │ │ │ versio │ │ │ │", "│ │ │ │ │ │ │ │ }/{ │ │ │ │",
"│ │ │ │ │ │ │ │ n }/{ │ │ │ │",
"│ │ │ │ │ │ │ │ name │ │ │ │", "│ │ │ │ │ │ │ │ name │ │ │ │",
"│ │ │ │ │ │ │ │ }-{ ve │ │ │ │",
"│ │ │ │ │ │ │ │ rsion │ │ │ │",
"│ │ │ │ │ │ │ │ }-{ │ │ │ │", "│ │ │ │ │ │ │ │ }-{ │ │ │ │",
"│ │ │ │ │ │ │ │ versio │ │ │ │",
"│ │ │ │ │ │ │ │ n }-{ │ │ │ │",
"│ │ │ │ │ │ │ │ target │ │ │ │", "│ │ │ │ │ │ │ │ target │ │ │ │",
"│ │ │ │ │ │ │ │ }.{ │ │ │ │", "│ │ │ │ │ │ │ │ }.{ a │ │ │ │",
"│ │ │ │ │ │ │ │ archiv │ │ │ │", "│ │ │ │ │ │ │ │ rchive │ │ │ │",
"│ │ │ │ │ │ │ │ e-form │ │ │ │", "│ │ │ │ │ │ │ │ -forma │ │ │ │",
"│ │ │ │ │ │ │ │ at } │ │ │ │", "│ │ │ │ │ │ │ │ t } │ │ │ │",
"│ │ │ │ │ │ ╰───────────┴────────╯ │ │ │", "│ │ │ │ │ │ ╰───────────┴────────╯ │ │ │",
"│ │ │ │ ╰──────────┴────────────────────────╯ │ │", "│ │ │ │ ╰──────────┴────────────────────────╯ │ │",
"│ │ │ name │ nu │ │", "│ │ │ name │ nu │ │",
@ -1046,6 +1045,8 @@ fn test_expand_big_0() {
"open sample.toml | table --expand --width=60" "open sample.toml | table --expand --width=60"
)); ));
_print_lines(&actual.out, 60);
let expected = join_lines([ let expected = join_lines([
"╭──────────────────┬───────────────────────────────────────╮", "╭──────────────────┬───────────────────────────────────────╮",
"│ │ ╭───┬─────────┬────────────╮ │", "│ │ ╭───┬─────────┬────────────╮ │",
@ -1230,9 +1231,8 @@ fn test_expand_big_0() {
"│ package │ │ │ ╭───┬───────────╮ │ │", "│ package │ │ │ ╭───┬───────────╮ │ │",
"│ │ │ authors │ │ 0 │ The │ │ │", "│ │ │ authors │ │ 0 │ The │ │ │",
"│ │ │ │ │ │ Nushell │ │ │", "│ │ │ │ │ │ Nushell │ │ │",
"│ │ │ │ │ │ Project │ │ │", "│ │ │ │ │ │ Project D │ │ │",
"│ │ │ │ │ │ Developer │ │ │", "│ │ │ │ │ │ evelopers │ │ │",
"│ │ │ │ │ │ s │ │ │",
"│ │ │ │ ╰───┴───────────╯ │ │", "│ │ │ │ ╰───┴───────────╯ │ │",
"│ │ │ default-run │ nu │ │", "│ │ │ default-run │ nu │ │",
"│ │ │ description │ A new type of │ │", "│ │ │ description │ A new type of │ │",
@ -1266,9 +1266,8 @@ fn test_expand_big_0() {
"│ │ ╭───────────┬───────────────────────╮ │", "│ │ ╭───────────┬───────────────────────╮ │",
"│ patch │ │ │ ╭──────────┬────────╮ │ │", "│ patch │ │ │ ╭──────────┬────────╮ │ │",
"│ │ │ crates-io │ │ reedline │ {recor │ │ │", "│ │ │ crates-io │ │ reedline │ {recor │ │ │",
"│ │ │ │ │ │ d 2 │ │ │", "│ │ │ │ │ │ d 2 fi │ │ │",
"│ │ │ │ │ │ fields │ │ │", "│ │ │ │ │ │ elds} │ │ │",
"│ │ │ │ │ │ } │ │ │",
"│ │ │ │ ╰──────────┴────────╯ │ │", "│ │ │ │ ╰──────────┴────────╯ │ │",
"│ │ ╰───────────┴───────────────────────╯ │", "│ │ ╰───────────┴───────────────────────╯ │",
"│ target │ {record 3 fields} │", "│ target │ {record 3 fields} │",
@ -1312,6 +1311,8 @@ fn test_expand_big_0() {
"open sample.toml | table --expand --width=40" "open sample.toml | table --expand --width=40"
)); ));
_print_lines(&actual.out, 40);
let expected = join_lines([ let expected = join_lines([
"╭──────────────────┬───────────────────╮", "╭──────────────────┬───────────────────╮",
"│ bench │ [table 1 row] │", "│ 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())); let actual = nu!(format!("{} | table --expand --width 136", nu_value.trim()));
println!("{}", actual.out);
assert_eq!( assert_eq!(
actual.out, actual.out,
join_lines([ join_lines([

View file

@ -16,8 +16,7 @@ nu-utils = { path = "../nu-utils", version = "0.81.1" }
nu-engine = { path = "../nu-engine", 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-color-config = { path = "../nu-color-config", version = "0.81.1" }
nu-ansi-term = "0.47.0" nu-ansi-term = "0.47.0"
tabled = { version = "0.12.2", features = ["color"], default-features = false }
tabled = { version = "0.12", features = ["color"], default-features = false }
ahash = "0.8.3" ahash = "0.8.3"
[dev-dependencies] [dev-dependencies]

View file

@ -124,9 +124,9 @@ fn wrap_keep_words_test() {
(10, None), (10, None),
(11, None), (11, None),
(12, Some("┏━━━━┳━━━━━┓\n┃ 12 ┃ ... ┃\n┃ 3 ┃ ┃\n┃ 45 ┃ ┃\n┃ 67 ┃ ┃\n┃ 8 ┃ ┃\n┣━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━┻━━━━━┛")), (12, Some("┏━━━━┳━━━━━┓\n┃ 12 ┃ ... ┃\n┃ 3 ┃ ┃\n┃ 45 ┃ ┃\n┃ 67 ┃ ┃\n┃ 8 ┃ ┃\n┣━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━┻━━━━━┛")),
(13, Some("┏━━━━━┳━━━━━┓\n┃ 123 ┃ ... ┃\n ┃ ┃\n456 ┃ ┃\n78 ┃ ┃\n┣━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━┻━━━━━┛")), (13, Some("┏━━━━━┳━━━━━┓\n┃ 123 ┃ ... ┃\n45 ┃ ┃\n678 ┃ ┃\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┗━━━━━━┻━━━━━━┻━━━━━┛")), (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┗━━━━━━━━━━┻━━━━━━━━━━┻━━━━━┛")), (29, Some("┏━━━━━━━━━━┳━━━━━━━━━━┳━━━━━┓\n123 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┗━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━┻━━━━━┛")), (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┗━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━┻━━━━━┛")),
]; ];