From bd785507c5238ac1293137decb612a50a725bc75 Mon Sep 17 00:00:00 2001 From: Richard Viney Date: Tue, 30 Jan 2024 22:51:42 +1300 Subject: Add bit_array.inspect and bit_array.inspect_base16 --- test/gleam/bit_array_test.gleam | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test') 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>>") +} -- cgit v1.2.3