...

Source file src/github.com/josharian/native/endian_test.go

Documentation: github.com/josharian/native

     1  package native_test
     2  
     3  import (
     4  	"encoding/binary"
     5  	"testing"
     6  
     7  	"github.com/josharian/native"
     8  )
     9  
    10  func TestPrintEndianness(t *testing.T) {
    11  	t.Logf("native endianness is %v", native.Endian)
    12  
    13  	var want binary.ByteOrder = binary.BigEndian
    14  	if !native.IsBigEndian {
    15  		want = binary.LittleEndian
    16  	}
    17  	if native.Endian != want {
    18  		t.Errorf("IsBigEndian = %v not consistent with native.Endian = %T", native.IsBigEndian, want)
    19  	}
    20  }
    21  

View as plain text