gitee.com/quant1x/num@v0.3.2/binary/endian_test.go (about)

     1  package binary
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  )
     7  
     8  func TestIsLittleEndian(t *testing.T) {
     9  	fmt.Println(IsLittleEndian)
    10  	tests := []struct {
    11  		name string
    12  		want bool
    13  	}{
    14  		{
    15  			name: "detect big or little",
    16  			want: true, // GO 默认是big endian
    17  		},
    18  	}
    19  	for _, tt := range tests {
    20  		t.Run(tt.name, func(t *testing.T) {
    21  			if got := defaultEndian(); got != tt.want {
    22  				t.Errorf("IsLittleEndian() = %v, want %v", got, tt.want)
    23  			}
    24  		})
    25  	}
    26  }