Skip to content

Commit

Permalink
✅ test: add Buffer testing case
Browse files Browse the repository at this point in the history
  • Loading branch information
jingyuexing committed Apr 15, 2024
1 parent d9dedb8 commit 7530695
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ func TestNumberConver(t *testing.T) {

result2 := utils.ToChineseNumber(20, 10, false)
fmt.Printf("%s\n", result2)

result4 := utils.ToChineseNumber(100,10,false)
fmt.Printf("%s\n",result4)
}

func TestOmit(t *testing.T) {
Expand Down Expand Up @@ -434,3 +437,17 @@ func TestReferenceString(t *testing.T){
fmt.Printf("%s\n",ref("error"))

}

func TestBuffer(t *testing.T){
bf := utils.NewBuffer()
bf = bf.Load("320c3a83c202880e83fa0814320c3a83c202880e83fa10")
fmt.Printf("%#v\n",bf)

if bf[0] != 0x32 {
t.Error(fmt.Sprintf("TestBuffer expect: %d,but got %d",0x32,bf[0]))
}

if bf[22] != 0x10 {
t.Error(fmt.Sprintf("TestBuffer expect: %d,but got %d",0x10,bf[22]))
}
}

0 comments on commit 7530695

Please sign in to comment.