From c511ebcb1533ca1d0cfc81116561ff24ee9cf2e6 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 15 Oct 2025 01:07:39 -0400 Subject: [PATCH] tape: Add bools to tests --- tape/dynamic_test.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tape/dynamic_test.go b/tape/dynamic_test.go index 1023063..969183f 100644 --- a/tape/dynamic_test.go +++ b/tape/dynamic_test.go @@ -15,6 +15,8 @@ var samplePayloads = [][]byte { /* uint16 */ []byte { byte(LI.WithCN(1)), 0x45, 0x67 }, /* uint32 */ []byte { byte(LI.WithCN(3)), 0x45, 0x67, 0x89, 0xAB }, /* uint64 */ []byte { byte(LI.WithCN(7)), 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0x01, 0x23 }, + /* bool */ []byte { byte(SI.WithCN(0)) }, + /* bool */ []byte { byte(SI.WithCN(1)) }, /* string */ []byte { byte(SBA.WithCN(7)), 'p', 'u', 'p', 'e', 'v', 'e', 'r' }, /* []byte */ []byte { byte(SBA.WithCN(5)), 'b', 'l', 'a', 'r', 'g' }, /* []string */ []byte { @@ -45,6 +47,8 @@ var sampleValues = []any { /* uint16 */ uint16(0x4567), /* uint32 */ uint32(0x456789AB), /* uint64 */ uint64(0x456789ABCDEF0123), + /* bool */ false, + /* bool */ true, /* string */ "pupever", /* []byte */ "blarg", /* []string */ []string { @@ -84,7 +88,9 @@ func TestEncodeAnyTable(test *testing.T) { 0x3456: userDefinedInteger(0x3921), 0x1F1F: float32(67.26), 0x0F0F: float64(5.3), - }, KTV.WithCN(0), tu.S(9).AddVar( + 0xAAAA: false, + 0xBBBB: true, + }, KTV.WithCN(0), tu.S(11).AddVar( []byte { 0xF3, 0xB9, byte(LSI.WithCN(3)), @@ -138,6 +144,14 @@ func TestEncodeAnyTable(test *testing.T) { byte(FP.WithCN(7)), 0x40, 0x15, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, }, + []byte { + 0xAA, 0xAA, + byte(SI.WithCN(0)), + }, + []byte { + 0xBB, 0xBB, + byte(SI.WithCN(1)), + }, )) if err != nil { test.Fatal(err) } }