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:
15
len_test.go
Normal file
15
len_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user