Browse Source

codec: move missingfielder types from values_test to values_flex_test.go

Ugorji Nwoke 7 years ago
parent
commit
e5e69e061d
2 changed files with 30 additions and 30 deletions
  1. 30 0
      codec/values_flex_test.go
  2. 0 30
      codec/values_test.go

+ 30 - 0
codec/values_flex_test.go

@@ -67,6 +67,36 @@ type AnonInTestStrucIntf struct {
 	Tptr   *time.Time
 	Tptr   *time.Time
 }
 }
 
 
+type missingFielderT1 struct {
+	S string
+	B bool
+	f float64
+	i int64
+}
+
+func (t *missingFielderT1) CodecMissingField(field []byte, value interface{}) bool {
+	switch string(field) {
+	case "F":
+		t.f = value.(float64)
+	case "I":
+		t.i = value.(int64)
+	default:
+		return false
+	}
+	return true
+}
+
+func (t *missingFielderT1) CodecMissingFields() map[string]interface{} {
+	return map[string]interface{}{"F": t.f, "I": t.i}
+}
+
+type missingFielderT2 struct {
+	S string
+	B bool
+	F float64
+	I int64
+}
+
 var testWRepeated512 wrapBytes
 var testWRepeated512 wrapBytes
 var testStrucTime = time.Date(2012, 2, 2, 2, 2, 2, 2000, time.UTC).UTC()
 var testStrucTime = time.Date(2012, 2, 2, 2, 2, 2, 2000, time.UTC).UTC()
 
 

+ 0 - 30
codec/values_test.go

@@ -38,36 +38,6 @@ type stringUint64T struct {
 	U uint64
 	U uint64
 }
 }
 
 
-type missingFielderT1 struct {
-	S string
-	B bool
-	f float64
-	i int64
-}
-
-func (t *missingFielderT1) CodecMissingField(field []byte, value interface{}) bool {
-	switch string(field) {
-	case "F":
-		t.f = value.(float64)
-	case "I":
-		t.i = value.(int64)
-	default:
-		return false
-	}
-	return true
-}
-
-func (t *missingFielderT1) CodecMissingFields() map[string]interface{} {
-	return map[string]interface{}{"F": t.f, "I": t.i}
-}
-
-type missingFielderT2 struct {
-	S string
-	B bool
-	F float64
-	I int64
-}
-
 type AnonInTestStruc struct {
 type AnonInTestStruc struct {
 	AS         string
 	AS         string
 	AI64       int64
 	AI64       int64