1
0
mirror of https://github.com/fumiama/unibase2n.git synced 2026-07-01 09:20:32 +08:00

finish DecodeLen & len unit test

This commit is contained in:
源文雨
2022-10-01 08:42:22 +08:00
parent 570a6efb28
commit a68a04bbe9
2 changed files with 56 additions and 1 deletions

15
len_test.go Normal file
View File

@@ -0,0 +1,15 @@
package unibase2n
import "testing"
func TestEnDecodeLen(t *testing.T) {
bs := Base{bit: 1}
for ; bs.bit < 16; bs.bit++ {
for i := 1; i <= 65536; i++ {
in := bs.DecodeLen(bs.EncodeLen(i))
if i != in {
t.Fatal("bit:", bs.bit, "in:", i, "!= out:", in)
}
}
}
}