susumu.yata
null+****@clear*****
Mon Jun 22 15:17:58 JST 2015
susumu.yata 2015-06-22 15:17:58 +0900 (Mon, 22 Jun 2015) New Revision: e2c27aa4f03375f00b74bba0c94659671a2df8a0 https://github.com/groonga/grngo/commit/e2c27aa4f03375f00b74bba0c94659671a2df8a0 Message: Add tests for (U)IntXX keys. GitHub: #5 Modified files: grngo_test.go Modified: grngo_test.go (+43 -1) =================================================================== --- grngo_test.go 2015-06-22 15:02:45 +0900 (7c9c3b9) +++ grngo_test.go 2015-06-22 15:17:58 +0900 (d14dc06) @@ -214,8 +214,22 @@ func generateRandomKey(keyType string) interface{} { switch keyType { case "Bool": return (rand.Int() & 1) == 1 + case "Int8": + return int64(int8(rand.Int())) + case "Int16": + return int64(int16(rand.Int())) + case "Int32": + return int64(int32(rand.Int())) case "Int64": return rand.Int63() + case "UInt8": + return int64(uint8(rand.Int())) + case "UInt16": + return int64(uint16(rand.Int())) + case "UInt32": + return int64(rand.Uint32()) + case "UInt64": + return rand.Int63() case "Float": return rand.Float64() case "WGS84GeoPoint": @@ -265,10 +279,38 @@ func TestTableInsertRowWithBoolKey(t *testing.T) { testTableInsertRow(t, "Bool") } -func TestTableInsertRowWithIntKey(t *testing.T) { +func TestTableInsertRowWithInt8Key(t *testing.T) { + testTableInsertRow(t, "Int8") +} + +func TestTableInsertRowWithInt16Key(t *testing.T) { + testTableInsertRow(t, "Int16") +} + +func TestTableInsertRowWithInt32Key(t *testing.T) { + testTableInsertRow(t, "Int32") +} + +func TestTableInsertRowWithInt64Key(t *testing.T) { testTableInsertRow(t, "Int64") } +func TestTableInsertRowWithUInt8Key(t *testing.T) { + testTableInsertRow(t, "UInt8") +} + +func TestTableInsertRowWithUInt16Key(t *testing.T) { + testTableInsertRow(t, "UInt16") +} + +func TestTableInsertRowWithUInt32Key(t *testing.T) { + testTableInsertRow(t, "UInt32") +} + +func TestTableInsertRowWithUInt64Key(t *testing.T) { + testTableInsertRow(t, "UInt64") +} + func TestTableInsertRowWithFloatKey(t *testing.T) { testTableInsertRow(t, "Float") } -------------- next part -------------- HTML����������������������������...Download