aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRichard Viney <richard.viney@gmail.com>2024-01-30 22:51:42 +1300
committerLouis Pilfold <louis@lpil.uk>2024-02-15 11:26:10 +0000
commitbd785507c5238ac1293137decb612a50a725bc75 (patch)
tree0c1c0169616801daa5593adb0097a884ba65e7c7 /test
parent5bc0aa4c7881b98d49804b80789ed279d944d70e (diff)
downloadgleam_stdlib-bd785507c5238ac1293137decb612a50a725bc75.tar.gz
gleam_stdlib-bd785507c5238ac1293137decb612a50a725bc75.zip
Add bit_array.inspect and bit_array.inspect_base16
Diffstat (limited to 'test')
-rw-r--r--test/gleam/bit_array_test.gleam22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/gleam/bit_array_test.gleam b/test/gleam/bit_array_test.gleam
index 903b0c8..ca94f1a 100644
--- a/test/gleam/bit_array_test.gleam
+++ b/test/gleam/bit_array_test.gleam
@@ -279,3 +279,25 @@ pub fn base16_decode_test() {
bit_array.base16_decode("a1b2c3d4e5f67891")
|> should.equal(Ok(<<161, 178, 195, 212, 229, 246, 120, 145>>))
}
+
+pub fn inspect_test() {
+ bit_array.inspect(<<>>)
+ |> should.equal("<<>>")
+
+ bit_array.inspect(<<80>>)
+ |> should.equal("<<80>>")
+
+ bit_array.inspect(<<0, 20, 0x20, 255>>)
+ |> should.equal("<<0, 20, 32, 255>>")
+}
+
+pub fn inspect_base16_test() {
+ bit_array.inspect_base16(<<>>)
+ |> should.equal("<<>>")
+
+ bit_array.inspect_base16(<<0x80>>)
+ |> should.equal("<<80>>")
+
+ bit_array.inspect_base16(<<0, 20, 0x20, 255>>)
+ |> should.equal("<<00 14 20 FF>>")
+}