Skip to content

Commit

Permalink
utils/wrappers: fix typo in test (ava-labs#1271)
Browse files Browse the repository at this point in the history
  • Loading branch information
gyuho authored Mar 31, 2022
1 parent 2821e0d commit 47d755d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions utils/wrappers/packing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,17 @@ func TestPackerUnpackInt(t *testing.T) {
}

func TestPackerPackLong(t *testing.T) {
p := Packer{MaxSize: 8}
maxSize := 8
p := Packer{MaxSize: maxSize}

p.PackLong(0x0102030405060708)

if p.Errored() {
t.Fatal(p.Err)
}

if size := len(p.Bytes); size != 8 {
t.Fatalf("Packer.PackLong wrote %d byte(s) but expected %d byte(s)", size, 8)
if size := len(p.Bytes); size != maxSize {
t.Fatalf("Packer.PackLong wrote %d byte(s) but expected %d byte(s)", size, maxSize)
}

expected := []byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}
Expand Down Expand Up @@ -315,7 +316,7 @@ func TestPackerPackBytes(t *testing.T) {
}

if size := len(p.Bytes); size != 8 {
t.Fatalf("Packer.PackBytes wrote %d byte(s) but expected %d byte(s)", size, 7)
t.Fatalf("Packer.PackBytes wrote %d byte(s) but expected %d byte(s)", size, 8)
}

expected := []byte("\x00\x00\x00\x04Avax")
Expand Down

0 comments on commit 47d755d

Please sign in to comment.