1
0
mirror of https://github.com/sjwhitworth/golearn.git synced 2025-04-30 13:48:57 +08:00
golearn/base/edf/util_test.go

21 lines
421 B
Go
Raw Normal View History

2014-08-02 16:22:14 +01:00
package edf
// Utility function tests
import (
. "github.com/smartystreets/goconvey/convey"
"testing"
)
func TestInt32Conversion(t *testing.T) {
Convey("Given deadbeef", t, func() {
buf := make([]byte, 4)
original := uint32(0xDEAD)
uint32ToBytes(original, buf)
converted := uint32FromBytes(buf)
Convey("Decoded value should be the original...", func() {
So(converted, ShouldEqual, original)
})
})
}