diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 25b7762d3a12cf8a8927743b2ef782f17059928d..8377911e31caf2cc936b2696cdfd356e29383ce7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: variables: NUSHELL_ARCH: "x86_64-unknown-linux-musl" - NUSHELL_VERSION: "0.93.0" + NUSHELL_VERSION: "0.95.0" workflow: rules: diff --git a/.nushell/binary.nu b/.nushell/binary.nu index 0fb28ee6f437f57bac788c5e18886fae325c5878..2f30ec71138b5209f0a6ee93369d052daeaf10e4 100644 --- a/.nushell/binary.nu +++ b/.nushell/binary.nu @@ -1,16 +1,3 @@ -# decode a list of integer bytes into the underlying encoded string -export def "bytes decode" [encoding: string = "utf-8"]: list<int> -> string { - each { into binary | bytes at 0..1 } | bytes collect | decode $encoding -} - -# encode an encoded string into the underlying list of integer bytes -export def "bytes encode" [encoding: string = "utf-8"]: string -> list<int> { - let bytes = $in | encode $encoding - seq 1 ($bytes | bytes length) | each {|i| - $bytes | bytes at ($i - 1)..($i) | into int - } -} - export def "bytes from_int" []: [int -> binary, list<int> -> binary] { each { into binary --compact } | bytes collect } diff --git a/README.md b/README.md index 35f4be8d36d37311ffd20688348dc654898d2feb..cbbd5afb26220b809b558166357a9062ffa7ffc0 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ below is an example of how to use the binary application with Nushell: ``` > **Note** -> requires Nushell 0.93.0 or later +> requires Nushell 0.95.0 or later tests for the binary application can also be run with ```bash diff --git a/komodo.nu b/komodo.nu index 38b51c1af6dca9e3fec00544d328621aacd806aa..c23b7929f72a52313682a9d33eadb2b94d78467a 100644 --- a/komodo.nu +++ b/komodo.nu @@ -150,7 +150,7 @@ export def "komodo prove" [ } let type = $fec_params | describe --detailed | update columns { sort } - let expected = { type: record, lazy: false, columns: { k: int, n: int } } + let expected = { type: record, columns: { k: int, n: int } } if $type != $expected { error make { msg: $"(ansi red_bold)invalid `--fec-params`(ansi reset)", diff --git a/tests/binary.nu b/tests/binary.nu index 1cb755f6973d16eb5d880a2b8f5ff9f69bf2593e..21a5a736ba76fee4d6f52c1c925ad720558f79d5 100644 --- a/tests/binary.nu +++ b/tests/binary.nu @@ -1,6 +1,4 @@ -use ../.nushell binary [ - "bytes decode", "bytes encode", "bytes from_int", "bytes to_int" -] +use ../.nushell binary [ "bytes from_int", "bytes to_int" ] use std assert @@ -18,8 +16,4 @@ def main [] { let bytes = random-bytes 1_000 assert equal ($bytes | bytes from_int | bytes to_int) $bytes - - const input = "hello world!" - assert equal ($input | bytes encode) $hello_world_int - assert equal ($input | bytes encode | bytes decode) $input }