Procházet zdrojové kódy

Reorganize output_tests for maps

As I added more and more cases, I found the dir structure hard to
navigate.  The new structure follows how you read a type:

e.g. map[string]*string -> map/string/ptr_string

This exposed some redundant cases and some missing cases, too. Now
map[string] is the "main" test case that exercises all the variants of
value types, and the other key types are just to prove that they
basically work.
Tim Hockin před 8 roky
rodič
revize
9fc858b117
100 změnil soubory, kde provedl 32 přidání a 1787 odebrání
  1. 0 0
      output_tests/map/int16/string/json_test.go
  2. 3 0
      output_tests/map/int16/string/types.go
  3. 0 0
      output_tests/map/int32/string/json_test.go
  4. 0 0
      output_tests/map/int32/string/types.go
  5. 0 0
      output_tests/map/int8/string/json_test.go
  6. 3 0
      output_tests/map/int8/string/types.go
  7. 0 0
      output_tests/map/string/bool/json_test.go
  8. 0 0
      output_tests/map/string/bool/types.go
  9. 0 0
      output_tests/map/string/byte/json_test.go
  10. 0 0
      output_tests/map/string/byte/types.go
  11. 0 0
      output_tests/map/string/float64/json_test.go
  12. 0 0
      output_tests/map/string/float64/types.go
  13. 0 0
      output_tests/map/string/int32/json_test.go
  14. 0 0
      output_tests/map/string/int32/types.go
  15. 0 0
      output_tests/map/string/map_string_string/json_test.go
  16. 0 0
      output_tests/map/string/map_string_string/types.go
  17. 0 0
      output_tests/map/string/ptr_bool/json_test.go
  18. 0 0
      output_tests/map/string/ptr_bool/types.go
  19. 0 0
      output_tests/map/string/ptr_float64/json_test.go
  20. 0 0
      output_tests/map/string/ptr_float64/types.go
  21. 0 0
      output_tests/map/string/ptr_int32/json_test.go
  22. 0 0
      output_tests/map/string/ptr_int32/types.go
  23. 0 0
      output_tests/map/string/ptr_map_string_string/json_test.go
  24. 3 0
      output_tests/map/string/ptr_map_string_string/types.go
  25. 0 0
      output_tests/map/string/ptr_slice_string/json_test.go
  26. 3 0
      output_tests/map/string/ptr_slice_string/types.go
  27. 0 0
      output_tests/map/string/ptr_string/json_test.go
  28. 0 0
      output_tests/map/string/ptr_string/types.go
  29. 0 0
      output_tests/map/string/ptr_struct/json_test.go
  30. 0 0
      output_tests/map/string/ptr_struct/types.go
  31. 0 0
      output_tests/map/string/ptr_struct_various/json_test.go
  32. 0 0
      output_tests/map/string/ptr_struct_various/types.go
  33. 0 0
      output_tests/map/string/ptr_uint8/json_test.go
  34. 0 0
      output_tests/map/string/ptr_uint8/types.go
  35. 0 0
      output_tests/map/string/slice_string/json_test.go
  36. 0 0
      output_tests/map/string/slice_string/types.go
  37. 0 0
      output_tests/map/string/string/json_test.go
  38. 0 0
      output_tests/map/string/string/types.go
  39. 0 0
      output_tests/map/string/string_alias/json_test.go
  40. 0 0
      output_tests/map/string/string_alias/types.go
  41. 0 0
      output_tests/map/string/struct/json_test.go
  42. 0 0
      output_tests/map/string/struct/types.go
  43. 0 0
      output_tests/map/string/struct_empty/json_test.go
  44. 3 0
      output_tests/map/string/struct_empty/types.go
  45. 0 0
      output_tests/map/string/struct_empty_alias/json_test.go
  46. 5 0
      output_tests/map/string/struct_empty_alias/types.go
  47. 0 0
      output_tests/map/string/struct_ptr_string/json_test.go
  48. 5 0
      output_tests/map/string/struct_ptr_string/types.go
  49. 0 0
      output_tests/map/string/struct_various/json_test.go
  50. 1 3
      output_tests/map/string/struct_various/types.go
  51. 0 0
      output_tests/map/string/uint8/json_test.go
  52. 0 0
      output_tests/map/string/uint8/types.go
  53. 0 0
      output_tests/map/string_alias/string/json_test.go
  54. 0 0
      output_tests/map/string_alias/string/types.go
  55. 0 0
      output_tests/map/string_alias/string_alias/json_test.go
  56. 0 0
      output_tests/map/string_alias/string_alias/types.go
  57. 0 0
      output_tests/map/uint16/string/json_test.go
  58. 3 0
      output_tests/map/uint16/string/types.go
  59. 0 0
      output_tests/map/uint32/string/json_test.go
  60. 3 0
      output_tests/map/uint32/string/types.go
  61. 0 0
      output_tests/map/uint8/string/json_test.go
  62. 0 0
      output_tests/map/uint8/string/types.go
  63. 0 3
      output_tests/maps/builtins/int32/bool/types.go
  64. 0 3
      output_tests/maps/builtins/int32/byte/types.go
  65. 0 3
      output_tests/maps/builtins/int32/float32/types.go
  66. 0 3
      output_tests/maps/builtins/int32/float64/types.go
  67. 0 3
      output_tests/maps/builtins/int32/int32/types.go
  68. 0 3
      output_tests/maps/builtins/int32/int8/types.go
  69. 0 5
      output_tests/maps/builtins/int32/string_alias/types.go
  70. 0 3
      output_tests/maps/builtins/int32/uint8/types.go
  71. 0 3
      output_tests/maps/builtins/string/float32/types.go
  72. 0 3
      output_tests/maps/builtins/string/int8/types.go
  73. 0 3
      output_tests/maps/builtins/string/map/types.go
  74. 0 3
      output_tests/maps/builtins/string/slice/types.go
  75. 0 14
      output_tests/maps/builtins/string/struct/types.go
  76. 0 5
      output_tests/maps/builtins/string_alias/bool/types.go
  77. 0 5
      output_tests/maps/builtins/string_alias/byte/types.go
  78. 0 5
      output_tests/maps/builtins/string_alias/float32/types.go
  79. 0 5
      output_tests/maps/builtins/string_alias/float64/types.go
  80. 0 5
      output_tests/maps/builtins/string_alias/int32/types.go
  81. 0 139
      output_tests/maps/builtins/string_alias/int8/json_test.go
  82. 0 5
      output_tests/maps/builtins/string_alias/int8/types.go
  83. 0 139
      output_tests/maps/builtins/string_alias/map/json_test.go
  84. 0 3
      output_tests/maps/builtins/string_alias/map/types.go
  85. 0 139
      output_tests/maps/builtins/string_alias/ptr_struct/json_test.go
  86. 0 14
      output_tests/maps/builtins/string_alias/ptr_struct/types.go
  87. 0 139
      output_tests/maps/builtins/string_alias/slice/json_test.go
  88. 0 3
      output_tests/maps/builtins/string_alias/slice/types.go
  89. 0 139
      output_tests/maps/builtins/string_alias/string/json_test.go
  90. 0 139
      output_tests/maps/builtins/string_alias/string_alias/json_test.go
  91. 0 139
      output_tests/maps/builtins/string_alias/struct/json_test.go
  92. 0 139
      output_tests/maps/builtins/string_alias/uint8/json_test.go
  93. 0 5
      output_tests/maps/builtins/string_alias/uint8/types.go
  94. 0 139
      output_tests/maps/builtins/uint8/bool/json_test.go
  95. 0 3
      output_tests/maps/builtins/uint8/bool/types.go
  96. 0 139
      output_tests/maps/builtins/uint8/byte/json_test.go
  97. 0 3
      output_tests/maps/builtins/uint8/byte/types.go
  98. 0 139
      output_tests/maps/builtins/uint8/float32/json_test.go
  99. 0 3
      output_tests/maps/builtins/uint8/float32/types.go
  100. 0 139
      output_tests/maps/builtins/uint8/float64/json_test.go

+ 0 - 0
output_tests/maps/builtins/int32/bool/json_test.go → output_tests/map/int16/string/json_test.go


+ 3 - 0
output_tests/map/int16/string/types.go

@@ -0,0 +1,3 @@
+package test
+
+type T map[int16]string

+ 0 - 0
output_tests/maps/builtins/int32/byte/json_test.go → output_tests/map/int32/string/json_test.go


+ 0 - 0
output_tests/maps/builtins/int32/string/types.go → output_tests/map/int32/string/types.go


+ 0 - 0
output_tests/maps/builtins/int32/float32/json_test.go → output_tests/map/int8/string/json_test.go


+ 3 - 0
output_tests/map/int8/string/types.go

@@ -0,0 +1,3 @@
+package test
+
+type T map[int8]string

+ 0 - 0
output_tests/maps/builtins/int32/float64/json_test.go → output_tests/map/string/bool/json_test.go


+ 0 - 0
output_tests/maps/builtins/string/bool/types.go → output_tests/map/string/bool/types.go


+ 0 - 0
output_tests/maps/builtins/int32/int32/json_test.go → output_tests/map/string/byte/json_test.go


+ 0 - 0
output_tests/maps/builtins/string/byte/types.go → output_tests/map/string/byte/types.go


+ 0 - 0
output_tests/maps/builtins/int32/int8/json_test.go → output_tests/map/string/float64/json_test.go


+ 0 - 0
output_tests/maps/builtins/string/float64/types.go → output_tests/map/string/float64/types.go


+ 0 - 0
output_tests/maps/builtins/int32/map/json_test.go → output_tests/map/string/int32/json_test.go


+ 0 - 0
output_tests/maps/builtins/string/int32/types.go → output_tests/map/string/int32/types.go


+ 0 - 0
output_tests/maps/builtins/int32/ptr_struct/json_test.go → output_tests/map/string/map_string_string/json_test.go


+ 0 - 0
output_tests/maps/builtins/int32/map/types.go → output_tests/map/string/map_string_string/types.go


+ 0 - 0
output_tests/maps/builtins/int32/slice/json_test.go → output_tests/map/string/ptr_bool/json_test.go


+ 0 - 0
output_tests/maps/pointers/string/ptr_bool/types.go → output_tests/map/string/ptr_bool/types.go


+ 0 - 0
output_tests/maps/builtins/int32/string/json_test.go → output_tests/map/string/ptr_float64/json_test.go


+ 0 - 0
output_tests/maps/pointers/string/ptr_float64/types.go → output_tests/map/string/ptr_float64/types.go


+ 0 - 0
output_tests/maps/builtins/int32/string_alias/json_test.go → output_tests/map/string/ptr_int32/json_test.go


+ 0 - 0
output_tests/maps/pointers/string/ptr_int32/types.go → output_tests/map/string/ptr_int32/types.go


+ 0 - 0
output_tests/maps/builtins/int32/struct/json_test.go → output_tests/map/string/ptr_map_string_string/json_test.go


+ 3 - 0
output_tests/map/string/ptr_map_string_string/types.go

@@ -0,0 +1,3 @@
+package test
+
+type T map[string]*map[string]string

+ 0 - 0
output_tests/maps/builtins/int32/uint8/json_test.go → output_tests/map/string/ptr_slice_string/json_test.go


+ 3 - 0
output_tests/map/string/ptr_slice_string/types.go

@@ -0,0 +1,3 @@
+package test
+
+type T map[string]*[]string

+ 0 - 0
output_tests/maps/builtins/string/bool/json_test.go → output_tests/map/string/ptr_string/json_test.go


+ 0 - 0
output_tests/maps/pointers/string/ptr_string/types.go → output_tests/map/string/ptr_string/types.go


+ 0 - 0
output_tests/maps/builtins/string/byte/json_test.go → output_tests/map/string/ptr_struct/json_test.go


+ 0 - 0
output_tests/maps/builtins/int32/ptr_struct/types.go → output_tests/map/string/ptr_struct/types.go


+ 0 - 0
output_tests/maps/builtins/string/float32/json_test.go → output_tests/map/string/ptr_struct_various/json_test.go


+ 0 - 0
output_tests/maps/builtins/string/ptr_struct/types.go → output_tests/map/string/ptr_struct_various/types.go


+ 0 - 0
output_tests/maps/builtins/string/float64/json_test.go → output_tests/map/string/ptr_uint8/json_test.go


+ 0 - 0
output_tests/maps/pointers/string/ptr_uint8/types.go → output_tests/map/string/ptr_uint8/types.go


+ 0 - 0
output_tests/maps/builtins/string/int32/json_test.go → output_tests/map/string/slice_string/json_test.go


+ 0 - 0
output_tests/maps/builtins/int32/slice/types.go → output_tests/map/string/slice_string/types.go


+ 0 - 0
output_tests/maps/builtins/string/int8/json_test.go → output_tests/map/string/string/json_test.go


+ 0 - 0
output_tests/maps/builtins/string/string/types.go → output_tests/map/string/string/types.go


+ 0 - 0
output_tests/maps/builtins/string/map/json_test.go → output_tests/map/string/string_alias/json_test.go


+ 0 - 0
output_tests/maps/builtins/string/string_alias/types.go → output_tests/map/string/string_alias/types.go


+ 0 - 0
output_tests/maps/builtins/string/ptr_struct/json_test.go → output_tests/map/string/struct/json_test.go


+ 0 - 0
output_tests/maps/builtins/int32/struct/types.go → output_tests/map/string/struct/types.go


+ 0 - 0
output_tests/maps/builtins/string/slice/json_test.go → output_tests/map/string/struct_empty/json_test.go


+ 3 - 0
output_tests/map/string/struct_empty/types.go

@@ -0,0 +1,3 @@
+package test
+
+type T map[string]struct{}

+ 0 - 0
output_tests/maps/builtins/string/string/json_test.go → output_tests/map/string/struct_empty_alias/json_test.go


+ 5 - 0
output_tests/map/string/struct_empty_alias/types.go

@@ -0,0 +1,5 @@
+package test
+
+type A struct{}
+
+type T map[string]A

+ 0 - 0
output_tests/maps/builtins/string/string_alias/json_test.go → output_tests/map/string/struct_ptr_string/json_test.go


+ 5 - 0
output_tests/map/string/struct_ptr_string/types.go

@@ -0,0 +1,5 @@
+package test
+
+type T map[string]struct {
+	F *string
+}

+ 0 - 0
output_tests/maps/builtins/string/struct/json_test.go → output_tests/map/string/struct_various/json_test.go


+ 1 - 3
output_tests/maps/builtins/string_alias/struct/types.go → output_tests/map/string/struct_various/types.go

@@ -1,6 +1,6 @@
 package test
 
-type Struct struct {
+type T map[string]struct {
 	String string
 	Int    int32
 	Float  float64
@@ -10,5 +10,3 @@ type Struct struct {
 	Slice []string
 	Map   map[string]string
 }
-
-type T map[string]Struct

+ 0 - 0
output_tests/maps/builtins/string/uint8/json_test.go → output_tests/map/string/uint8/json_test.go


+ 0 - 0
output_tests/maps/builtins/string/uint8/types.go → output_tests/map/string/uint8/types.go


+ 0 - 0
output_tests/maps/builtins/string_alias/bool/json_test.go → output_tests/map/string_alias/string/json_test.go


+ 0 - 0
output_tests/maps/builtins/string_alias/string/types.go → output_tests/map/string_alias/string/types.go


+ 0 - 0
output_tests/maps/builtins/string_alias/byte/json_test.go → output_tests/map/string_alias/string_alias/json_test.go


+ 0 - 0
output_tests/maps/builtins/string_alias/string_alias/types.go → output_tests/map/string_alias/string_alias/types.go


+ 0 - 0
output_tests/maps/builtins/string_alias/float32/json_test.go → output_tests/map/uint16/string/json_test.go


+ 3 - 0
output_tests/map/uint16/string/types.go

@@ -0,0 +1,3 @@
+package test
+
+type T map[uint16]string

+ 0 - 0
output_tests/maps/builtins/string_alias/float64/json_test.go → output_tests/map/uint32/string/json_test.go


+ 3 - 0
output_tests/map/uint32/string/types.go

@@ -0,0 +1,3 @@
+package test
+
+type T map[uint32]string

+ 0 - 0
output_tests/maps/builtins/string_alias/int32/json_test.go → output_tests/map/uint8/string/json_test.go


+ 0 - 0
output_tests/maps/builtins/uint8/string/types.go → output_tests/map/uint8/string/types.go


+ 0 - 3
output_tests/maps/builtins/int32/bool/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[int32]bool

+ 0 - 3
output_tests/maps/builtins/int32/byte/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[int32]byte

+ 0 - 3
output_tests/maps/builtins/int32/float32/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[int32]float32

+ 0 - 3
output_tests/maps/builtins/int32/float64/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[int32]float64

+ 0 - 3
output_tests/maps/builtins/int32/int32/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[int32]int32

+ 0 - 3
output_tests/maps/builtins/int32/int8/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[int32]int8

+ 0 - 5
output_tests/maps/builtins/int32/string_alias/types.go

@@ -1,5 +0,0 @@
-package test
-
-type StringAlias string
-
-type T map[int32]StringAlias

+ 0 - 3
output_tests/maps/builtins/int32/uint8/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[int32]uint8

+ 0 - 3
output_tests/maps/builtins/string/float32/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[string]float32

+ 0 - 3
output_tests/maps/builtins/string/int8/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[string]int8

+ 0 - 3
output_tests/maps/builtins/string/map/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[string]map[string]string

+ 0 - 3
output_tests/maps/builtins/string/slice/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[string][]string

+ 0 - 14
output_tests/maps/builtins/string/struct/types.go

@@ -1,14 +0,0 @@
-package test
-
-type Struct struct {
-	String string
-	Int    int32
-	Float  float64
-	Struct struct {
-		X string
-	}
-	Slice []string
-	Map   map[string]string
-}
-
-type T map[string]Struct

+ 0 - 5
output_tests/maps/builtins/string_alias/bool/types.go

@@ -1,5 +0,0 @@
-package test
-
-type StringAlias string
-
-type T map[StringAlias]bool

+ 0 - 5
output_tests/maps/builtins/string_alias/byte/types.go

@@ -1,5 +0,0 @@
-package test
-
-type StringAlias string
-
-type T map[StringAlias]byte

+ 0 - 5
output_tests/maps/builtins/string_alias/float32/types.go

@@ -1,5 +0,0 @@
-package test
-
-type StringAlias string
-
-type T map[StringAlias]float32

+ 0 - 5
output_tests/maps/builtins/string_alias/float64/types.go

@@ -1,5 +0,0 @@
-package test
-
-type StringAlias string
-
-type T map[StringAlias]float64

+ 0 - 5
output_tests/maps/builtins/string_alias/int32/types.go

@@ -1,5 +0,0 @@
-package test
-
-type StringAlias string
-
-type T map[StringAlias]int32

+ 0 - 139
output_tests/maps/builtins/string_alias/int8/json_test.go

@@ -1,139 +0,0 @@
-package test
-
-import (
-	"bytes"
-	"encoding/json"
-	"testing"
-
-	"github.com/davecgh/go-spew/spew"
-	fuzz "github.com/google/gofuzz"
-	jsoniter "github.com/json-iterator/go"
-)
-
-func Test_Roundtrip(t *testing.T) {
-	fz := fuzz.New().MaxDepth(10).NilChance(0.3)
-	for i := 0; i < 1000; i++ {
-		var before T
-		fz.Fuzz(&before)
-
-		jbStd, err := json.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with stdlib: %v", err)
-		}
-		jbIter, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with jsoniter: %v", err)
-		}
-		if string(jbStd) != string(jbIter) {
-			t.Errorf("marshal expected:\n    %s\ngot:\n    %s\nobj:\n    %s",
-				indent(jbStd, "    "), indent(jbIter, "    "), dump(before))
-		}
-
-		var afterStd T
-		err = json.Unmarshal(jbIter, &afterStd)
-		if err != nil {
-			t.Errorf("failed to unmarshal with stdlib: %v", err)
-		}
-		var afterIter T
-		err = jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(jbIter, &afterIter)
-		if err != nil {
-			t.Errorf("failed to unmarshal with jsoniter: %v", err)
-		}
-		if fingerprint(afterStd) != fingerprint(afterIter) {
-			t.Errorf("unmarshal expected:\n    %s\ngot:\n    %s\nvia:\n    %s",
-				dump(afterStd), dump(afterIter), indent(jbIter, "    "))
-		}
-	}
-}
-
-const indentStr = ">  "
-
-func fingerprint(obj interface{}) string {
-	c := spew.ConfigState{
-		SortKeys: true,
-		SpewKeys: true,
-	}
-	return c.Sprintf("%v", obj)
-}
-
-func dump(obj interface{}) string {
-	cfg := spew.ConfigState{
-		Indent: indentStr,
-	}
-	return cfg.Sdump(obj)
-}
-
-func indent(src []byte, prefix string) string {
-	var buf bytes.Buffer
-	json.Indent(&buf, src, prefix, indentStr)
-	return buf.String()
-}
-
-func benchmarkMarshal(t *testing.B, name string, fn func(interface{}) ([]byte, error)) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var obj T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&obj)
-	for i := 0; i < t.N; i++ {
-		jb, err := fn(obj)
-		if err != nil {
-			t.Fatalf("%s failed to marshal:\n input: %s\n  error: %v", name, dump(obj), err)
-		}
-		_ = jb
-	}
-}
-
-func benchmarkUnmarshal(t *testing.B, name string, fn func(data []byte, v interface{}) error) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var before T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&before)
-	jb, err := json.Marshal(before)
-	if err != nil {
-		t.Fatalf("failed to marshal: %v", err)
-	}
-
-	for i := 0; i < t.N; i++ {
-		var after T
-		err = fn(jb, &after)
-		if err != nil {
-			t.Fatalf("%s failed to unmarshal:\n  input: %q\n  error: %v", name, string(jb), err)
-		}
-	}
-}
-
-func BenchmarkStandardMarshal(t *testing.B) {
-	benchmarkMarshal(t, "stdlib", json.Marshal)
-}
-
-func BenchmarkStandardUnmarshal(t *testing.B) {
-	benchmarkUnmarshal(t, "stdlib", json.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalFastest(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalFastest(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalDefault(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-default", jsoniter.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalDefault(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-default", jsoniter.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalCompatible(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalCompatible(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal)
-}

+ 0 - 5
output_tests/maps/builtins/string_alias/int8/types.go

@@ -1,5 +0,0 @@
-package test
-
-type StringAlias string
-
-type T map[StringAlias]int8

+ 0 - 139
output_tests/maps/builtins/string_alias/map/json_test.go

@@ -1,139 +0,0 @@
-package test
-
-import (
-	"bytes"
-	"encoding/json"
-	"testing"
-
-	"github.com/davecgh/go-spew/spew"
-	fuzz "github.com/google/gofuzz"
-	jsoniter "github.com/json-iterator/go"
-)
-
-func Test_Roundtrip(t *testing.T) {
-	fz := fuzz.New().MaxDepth(10).NilChance(0.3)
-	for i := 0; i < 1000; i++ {
-		var before T
-		fz.Fuzz(&before)
-
-		jbStd, err := json.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with stdlib: %v", err)
-		}
-		jbIter, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with jsoniter: %v", err)
-		}
-		if string(jbStd) != string(jbIter) {
-			t.Errorf("marshal expected:\n    %s\ngot:\n    %s\nobj:\n    %s",
-				indent(jbStd, "    "), indent(jbIter, "    "), dump(before))
-		}
-
-		var afterStd T
-		err = json.Unmarshal(jbIter, &afterStd)
-		if err != nil {
-			t.Errorf("failed to unmarshal with stdlib: %v", err)
-		}
-		var afterIter T
-		err = jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(jbIter, &afterIter)
-		if err != nil {
-			t.Errorf("failed to unmarshal with jsoniter: %v", err)
-		}
-		if fingerprint(afterStd) != fingerprint(afterIter) {
-			t.Errorf("unmarshal expected:\n    %s\ngot:\n    %s\nvia:\n    %s",
-				dump(afterStd), dump(afterIter), indent(jbIter, "    "))
-		}
-	}
-}
-
-const indentStr = ">  "
-
-func fingerprint(obj interface{}) string {
-	c := spew.ConfigState{
-		SortKeys: true,
-		SpewKeys: true,
-	}
-	return c.Sprintf("%v", obj)
-}
-
-func dump(obj interface{}) string {
-	cfg := spew.ConfigState{
-		Indent: indentStr,
-	}
-	return cfg.Sdump(obj)
-}
-
-func indent(src []byte, prefix string) string {
-	var buf bytes.Buffer
-	json.Indent(&buf, src, prefix, indentStr)
-	return buf.String()
-}
-
-func benchmarkMarshal(t *testing.B, name string, fn func(interface{}) ([]byte, error)) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var obj T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&obj)
-	for i := 0; i < t.N; i++ {
-		jb, err := fn(obj)
-		if err != nil {
-			t.Fatalf("%s failed to marshal:\n input: %s\n  error: %v", name, dump(obj), err)
-		}
-		_ = jb
-	}
-}
-
-func benchmarkUnmarshal(t *testing.B, name string, fn func(data []byte, v interface{}) error) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var before T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&before)
-	jb, err := json.Marshal(before)
-	if err != nil {
-		t.Fatalf("failed to marshal: %v", err)
-	}
-
-	for i := 0; i < t.N; i++ {
-		var after T
-		err = fn(jb, &after)
-		if err != nil {
-			t.Fatalf("%s failed to unmarshal:\n  input: %q\n  error: %v", name, string(jb), err)
-		}
-	}
-}
-
-func BenchmarkStandardMarshal(t *testing.B) {
-	benchmarkMarshal(t, "stdlib", json.Marshal)
-}
-
-func BenchmarkStandardUnmarshal(t *testing.B) {
-	benchmarkUnmarshal(t, "stdlib", json.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalFastest(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalFastest(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalDefault(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-default", jsoniter.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalDefault(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-default", jsoniter.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalCompatible(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalCompatible(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal)
-}

+ 0 - 3
output_tests/maps/builtins/string_alias/map/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[string]map[string]string

+ 0 - 139
output_tests/maps/builtins/string_alias/ptr_struct/json_test.go

@@ -1,139 +0,0 @@
-package test
-
-import (
-	"bytes"
-	"encoding/json"
-	"testing"
-
-	"github.com/davecgh/go-spew/spew"
-	fuzz "github.com/google/gofuzz"
-	jsoniter "github.com/json-iterator/go"
-)
-
-func Test_Roundtrip(t *testing.T) {
-	fz := fuzz.New().MaxDepth(10).NilChance(0.3)
-	for i := 0; i < 1000; i++ {
-		var before T
-		fz.Fuzz(&before)
-
-		jbStd, err := json.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with stdlib: %v", err)
-		}
-		jbIter, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with jsoniter: %v", err)
-		}
-		if string(jbStd) != string(jbIter) {
-			t.Errorf("marshal expected:\n    %s\ngot:\n    %s\nobj:\n    %s",
-				indent(jbStd, "    "), indent(jbIter, "    "), dump(before))
-		}
-
-		var afterStd T
-		err = json.Unmarshal(jbIter, &afterStd)
-		if err != nil {
-			t.Errorf("failed to unmarshal with stdlib: %v", err)
-		}
-		var afterIter T
-		err = jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(jbIter, &afterIter)
-		if err != nil {
-			t.Errorf("failed to unmarshal with jsoniter: %v", err)
-		}
-		if fingerprint(afterStd) != fingerprint(afterIter) {
-			t.Errorf("unmarshal expected:\n    %s\ngot:\n    %s\nvia:\n    %s",
-				dump(afterStd), dump(afterIter), indent(jbIter, "    "))
-		}
-	}
-}
-
-const indentStr = ">  "
-
-func fingerprint(obj interface{}) string {
-	c := spew.ConfigState{
-		SortKeys: true,
-		SpewKeys: true,
-	}
-	return c.Sprintf("%v", obj)
-}
-
-func dump(obj interface{}) string {
-	cfg := spew.ConfigState{
-		Indent: indentStr,
-	}
-	return cfg.Sdump(obj)
-}
-
-func indent(src []byte, prefix string) string {
-	var buf bytes.Buffer
-	json.Indent(&buf, src, prefix, indentStr)
-	return buf.String()
-}
-
-func benchmarkMarshal(t *testing.B, name string, fn func(interface{}) ([]byte, error)) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var obj T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&obj)
-	for i := 0; i < t.N; i++ {
-		jb, err := fn(obj)
-		if err != nil {
-			t.Fatalf("%s failed to marshal:\n input: %s\n  error: %v", name, dump(obj), err)
-		}
-		_ = jb
-	}
-}
-
-func benchmarkUnmarshal(t *testing.B, name string, fn func(data []byte, v interface{}) error) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var before T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&before)
-	jb, err := json.Marshal(before)
-	if err != nil {
-		t.Fatalf("failed to marshal: %v", err)
-	}
-
-	for i := 0; i < t.N; i++ {
-		var after T
-		err = fn(jb, &after)
-		if err != nil {
-			t.Fatalf("%s failed to unmarshal:\n  input: %q\n  error: %v", name, string(jb), err)
-		}
-	}
-}
-
-func BenchmarkStandardMarshal(t *testing.B) {
-	benchmarkMarshal(t, "stdlib", json.Marshal)
-}
-
-func BenchmarkStandardUnmarshal(t *testing.B) {
-	benchmarkUnmarshal(t, "stdlib", json.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalFastest(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalFastest(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalDefault(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-default", jsoniter.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalDefault(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-default", jsoniter.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalCompatible(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalCompatible(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal)
-}

+ 0 - 14
output_tests/maps/builtins/string_alias/ptr_struct/types.go

@@ -1,14 +0,0 @@
-package test
-
-type Struct struct {
-	String string
-	Int    int32
-	Float  float64
-	Struct struct {
-		X string
-	}
-	Slice []string
-	Map   map[string]string
-}
-
-type T map[string]*Struct

+ 0 - 139
output_tests/maps/builtins/string_alias/slice/json_test.go

@@ -1,139 +0,0 @@
-package test
-
-import (
-	"bytes"
-	"encoding/json"
-	"testing"
-
-	"github.com/davecgh/go-spew/spew"
-	fuzz "github.com/google/gofuzz"
-	jsoniter "github.com/json-iterator/go"
-)
-
-func Test_Roundtrip(t *testing.T) {
-	fz := fuzz.New().MaxDepth(10).NilChance(0.3)
-	for i := 0; i < 1000; i++ {
-		var before T
-		fz.Fuzz(&before)
-
-		jbStd, err := json.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with stdlib: %v", err)
-		}
-		jbIter, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with jsoniter: %v", err)
-		}
-		if string(jbStd) != string(jbIter) {
-			t.Errorf("marshal expected:\n    %s\ngot:\n    %s\nobj:\n    %s",
-				indent(jbStd, "    "), indent(jbIter, "    "), dump(before))
-		}
-
-		var afterStd T
-		err = json.Unmarshal(jbIter, &afterStd)
-		if err != nil {
-			t.Errorf("failed to unmarshal with stdlib: %v", err)
-		}
-		var afterIter T
-		err = jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(jbIter, &afterIter)
-		if err != nil {
-			t.Errorf("failed to unmarshal with jsoniter: %v", err)
-		}
-		if fingerprint(afterStd) != fingerprint(afterIter) {
-			t.Errorf("unmarshal expected:\n    %s\ngot:\n    %s\nvia:\n    %s",
-				dump(afterStd), dump(afterIter), indent(jbIter, "    "))
-		}
-	}
-}
-
-const indentStr = ">  "
-
-func fingerprint(obj interface{}) string {
-	c := spew.ConfigState{
-		SortKeys: true,
-		SpewKeys: true,
-	}
-	return c.Sprintf("%v", obj)
-}
-
-func dump(obj interface{}) string {
-	cfg := spew.ConfigState{
-		Indent: indentStr,
-	}
-	return cfg.Sdump(obj)
-}
-
-func indent(src []byte, prefix string) string {
-	var buf bytes.Buffer
-	json.Indent(&buf, src, prefix, indentStr)
-	return buf.String()
-}
-
-func benchmarkMarshal(t *testing.B, name string, fn func(interface{}) ([]byte, error)) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var obj T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&obj)
-	for i := 0; i < t.N; i++ {
-		jb, err := fn(obj)
-		if err != nil {
-			t.Fatalf("%s failed to marshal:\n input: %s\n  error: %v", name, dump(obj), err)
-		}
-		_ = jb
-	}
-}
-
-func benchmarkUnmarshal(t *testing.B, name string, fn func(data []byte, v interface{}) error) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var before T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&before)
-	jb, err := json.Marshal(before)
-	if err != nil {
-		t.Fatalf("failed to marshal: %v", err)
-	}
-
-	for i := 0; i < t.N; i++ {
-		var after T
-		err = fn(jb, &after)
-		if err != nil {
-			t.Fatalf("%s failed to unmarshal:\n  input: %q\n  error: %v", name, string(jb), err)
-		}
-	}
-}
-
-func BenchmarkStandardMarshal(t *testing.B) {
-	benchmarkMarshal(t, "stdlib", json.Marshal)
-}
-
-func BenchmarkStandardUnmarshal(t *testing.B) {
-	benchmarkUnmarshal(t, "stdlib", json.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalFastest(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalFastest(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalDefault(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-default", jsoniter.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalDefault(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-default", jsoniter.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalCompatible(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalCompatible(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal)
-}

+ 0 - 3
output_tests/maps/builtins/string_alias/slice/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[string][]string

+ 0 - 139
output_tests/maps/builtins/string_alias/string/json_test.go

@@ -1,139 +0,0 @@
-package test
-
-import (
-	"bytes"
-	"encoding/json"
-	"testing"
-
-	"github.com/davecgh/go-spew/spew"
-	fuzz "github.com/google/gofuzz"
-	jsoniter "github.com/json-iterator/go"
-)
-
-func Test_Roundtrip(t *testing.T) {
-	fz := fuzz.New().MaxDepth(10).NilChance(0.3)
-	for i := 0; i < 1000; i++ {
-		var before T
-		fz.Fuzz(&before)
-
-		jbStd, err := json.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with stdlib: %v", err)
-		}
-		jbIter, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with jsoniter: %v", err)
-		}
-		if string(jbStd) != string(jbIter) {
-			t.Errorf("marshal expected:\n    %s\ngot:\n    %s\nobj:\n    %s",
-				indent(jbStd, "    "), indent(jbIter, "    "), dump(before))
-		}
-
-		var afterStd T
-		err = json.Unmarshal(jbIter, &afterStd)
-		if err != nil {
-			t.Errorf("failed to unmarshal with stdlib: %v", err)
-		}
-		var afterIter T
-		err = jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(jbIter, &afterIter)
-		if err != nil {
-			t.Errorf("failed to unmarshal with jsoniter: %v", err)
-		}
-		if fingerprint(afterStd) != fingerprint(afterIter) {
-			t.Errorf("unmarshal expected:\n    %s\ngot:\n    %s\nvia:\n    %s",
-				dump(afterStd), dump(afterIter), indent(jbIter, "    "))
-		}
-	}
-}
-
-const indentStr = ">  "
-
-func fingerprint(obj interface{}) string {
-	c := spew.ConfigState{
-		SortKeys: true,
-		SpewKeys: true,
-	}
-	return c.Sprintf("%v", obj)
-}
-
-func dump(obj interface{}) string {
-	cfg := spew.ConfigState{
-		Indent: indentStr,
-	}
-	return cfg.Sdump(obj)
-}
-
-func indent(src []byte, prefix string) string {
-	var buf bytes.Buffer
-	json.Indent(&buf, src, prefix, indentStr)
-	return buf.String()
-}
-
-func benchmarkMarshal(t *testing.B, name string, fn func(interface{}) ([]byte, error)) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var obj T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&obj)
-	for i := 0; i < t.N; i++ {
-		jb, err := fn(obj)
-		if err != nil {
-			t.Fatalf("%s failed to marshal:\n input: %s\n  error: %v", name, dump(obj), err)
-		}
-		_ = jb
-	}
-}
-
-func benchmarkUnmarshal(t *testing.B, name string, fn func(data []byte, v interface{}) error) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var before T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&before)
-	jb, err := json.Marshal(before)
-	if err != nil {
-		t.Fatalf("failed to marshal: %v", err)
-	}
-
-	for i := 0; i < t.N; i++ {
-		var after T
-		err = fn(jb, &after)
-		if err != nil {
-			t.Fatalf("%s failed to unmarshal:\n  input: %q\n  error: %v", name, string(jb), err)
-		}
-	}
-}
-
-func BenchmarkStandardMarshal(t *testing.B) {
-	benchmarkMarshal(t, "stdlib", json.Marshal)
-}
-
-func BenchmarkStandardUnmarshal(t *testing.B) {
-	benchmarkUnmarshal(t, "stdlib", json.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalFastest(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalFastest(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalDefault(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-default", jsoniter.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalDefault(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-default", jsoniter.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalCompatible(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalCompatible(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal)
-}

+ 0 - 139
output_tests/maps/builtins/string_alias/string_alias/json_test.go

@@ -1,139 +0,0 @@
-package test
-
-import (
-	"bytes"
-	"encoding/json"
-	"testing"
-
-	"github.com/davecgh/go-spew/spew"
-	fuzz "github.com/google/gofuzz"
-	jsoniter "github.com/json-iterator/go"
-)
-
-func Test_Roundtrip(t *testing.T) {
-	fz := fuzz.New().MaxDepth(10).NilChance(0.3)
-	for i := 0; i < 1000; i++ {
-		var before T
-		fz.Fuzz(&before)
-
-		jbStd, err := json.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with stdlib: %v", err)
-		}
-		jbIter, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with jsoniter: %v", err)
-		}
-		if string(jbStd) != string(jbIter) {
-			t.Errorf("marshal expected:\n    %s\ngot:\n    %s\nobj:\n    %s",
-				indent(jbStd, "    "), indent(jbIter, "    "), dump(before))
-		}
-
-		var afterStd T
-		err = json.Unmarshal(jbIter, &afterStd)
-		if err != nil {
-			t.Errorf("failed to unmarshal with stdlib: %v", err)
-		}
-		var afterIter T
-		err = jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(jbIter, &afterIter)
-		if err != nil {
-			t.Errorf("failed to unmarshal with jsoniter: %v", err)
-		}
-		if fingerprint(afterStd) != fingerprint(afterIter) {
-			t.Errorf("unmarshal expected:\n    %s\ngot:\n    %s\nvia:\n    %s",
-				dump(afterStd), dump(afterIter), indent(jbIter, "    "))
-		}
-	}
-}
-
-const indentStr = ">  "
-
-func fingerprint(obj interface{}) string {
-	c := spew.ConfigState{
-		SortKeys: true,
-		SpewKeys: true,
-	}
-	return c.Sprintf("%v", obj)
-}
-
-func dump(obj interface{}) string {
-	cfg := spew.ConfigState{
-		Indent: indentStr,
-	}
-	return cfg.Sdump(obj)
-}
-
-func indent(src []byte, prefix string) string {
-	var buf bytes.Buffer
-	json.Indent(&buf, src, prefix, indentStr)
-	return buf.String()
-}
-
-func benchmarkMarshal(t *testing.B, name string, fn func(interface{}) ([]byte, error)) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var obj T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&obj)
-	for i := 0; i < t.N; i++ {
-		jb, err := fn(obj)
-		if err != nil {
-			t.Fatalf("%s failed to marshal:\n input: %s\n  error: %v", name, dump(obj), err)
-		}
-		_ = jb
-	}
-}
-
-func benchmarkUnmarshal(t *testing.B, name string, fn func(data []byte, v interface{}) error) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var before T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&before)
-	jb, err := json.Marshal(before)
-	if err != nil {
-		t.Fatalf("failed to marshal: %v", err)
-	}
-
-	for i := 0; i < t.N; i++ {
-		var after T
-		err = fn(jb, &after)
-		if err != nil {
-			t.Fatalf("%s failed to unmarshal:\n  input: %q\n  error: %v", name, string(jb), err)
-		}
-	}
-}
-
-func BenchmarkStandardMarshal(t *testing.B) {
-	benchmarkMarshal(t, "stdlib", json.Marshal)
-}
-
-func BenchmarkStandardUnmarshal(t *testing.B) {
-	benchmarkUnmarshal(t, "stdlib", json.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalFastest(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalFastest(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalDefault(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-default", jsoniter.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalDefault(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-default", jsoniter.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalCompatible(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalCompatible(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal)
-}

+ 0 - 139
output_tests/maps/builtins/string_alias/struct/json_test.go

@@ -1,139 +0,0 @@
-package test
-
-import (
-	"bytes"
-	"encoding/json"
-	"testing"
-
-	"github.com/davecgh/go-spew/spew"
-	fuzz "github.com/google/gofuzz"
-	jsoniter "github.com/json-iterator/go"
-)
-
-func Test_Roundtrip(t *testing.T) {
-	fz := fuzz.New().MaxDepth(10).NilChance(0.3)
-	for i := 0; i < 1000; i++ {
-		var before T
-		fz.Fuzz(&before)
-
-		jbStd, err := json.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with stdlib: %v", err)
-		}
-		jbIter, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with jsoniter: %v", err)
-		}
-		if string(jbStd) != string(jbIter) {
-			t.Errorf("marshal expected:\n    %s\ngot:\n    %s\nobj:\n    %s",
-				indent(jbStd, "    "), indent(jbIter, "    "), dump(before))
-		}
-
-		var afterStd T
-		err = json.Unmarshal(jbIter, &afterStd)
-		if err != nil {
-			t.Errorf("failed to unmarshal with stdlib: %v", err)
-		}
-		var afterIter T
-		err = jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(jbIter, &afterIter)
-		if err != nil {
-			t.Errorf("failed to unmarshal with jsoniter: %v", err)
-		}
-		if fingerprint(afterStd) != fingerprint(afterIter) {
-			t.Errorf("unmarshal expected:\n    %s\ngot:\n    %s\nvia:\n    %s",
-				dump(afterStd), dump(afterIter), indent(jbIter, "    "))
-		}
-	}
-}
-
-const indentStr = ">  "
-
-func fingerprint(obj interface{}) string {
-	c := spew.ConfigState{
-		SortKeys: true,
-		SpewKeys: true,
-	}
-	return c.Sprintf("%v", obj)
-}
-
-func dump(obj interface{}) string {
-	cfg := spew.ConfigState{
-		Indent: indentStr,
-	}
-	return cfg.Sdump(obj)
-}
-
-func indent(src []byte, prefix string) string {
-	var buf bytes.Buffer
-	json.Indent(&buf, src, prefix, indentStr)
-	return buf.String()
-}
-
-func benchmarkMarshal(t *testing.B, name string, fn func(interface{}) ([]byte, error)) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var obj T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&obj)
-	for i := 0; i < t.N; i++ {
-		jb, err := fn(obj)
-		if err != nil {
-			t.Fatalf("%s failed to marshal:\n input: %s\n  error: %v", name, dump(obj), err)
-		}
-		_ = jb
-	}
-}
-
-func benchmarkUnmarshal(t *testing.B, name string, fn func(data []byte, v interface{}) error) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var before T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&before)
-	jb, err := json.Marshal(before)
-	if err != nil {
-		t.Fatalf("failed to marshal: %v", err)
-	}
-
-	for i := 0; i < t.N; i++ {
-		var after T
-		err = fn(jb, &after)
-		if err != nil {
-			t.Fatalf("%s failed to unmarshal:\n  input: %q\n  error: %v", name, string(jb), err)
-		}
-	}
-}
-
-func BenchmarkStandardMarshal(t *testing.B) {
-	benchmarkMarshal(t, "stdlib", json.Marshal)
-}
-
-func BenchmarkStandardUnmarshal(t *testing.B) {
-	benchmarkUnmarshal(t, "stdlib", json.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalFastest(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalFastest(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalDefault(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-default", jsoniter.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalDefault(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-default", jsoniter.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalCompatible(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalCompatible(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal)
-}

+ 0 - 139
output_tests/maps/builtins/string_alias/uint8/json_test.go

@@ -1,139 +0,0 @@
-package test
-
-import (
-	"bytes"
-	"encoding/json"
-	"testing"
-
-	"github.com/davecgh/go-spew/spew"
-	fuzz "github.com/google/gofuzz"
-	jsoniter "github.com/json-iterator/go"
-)
-
-func Test_Roundtrip(t *testing.T) {
-	fz := fuzz.New().MaxDepth(10).NilChance(0.3)
-	for i := 0; i < 1000; i++ {
-		var before T
-		fz.Fuzz(&before)
-
-		jbStd, err := json.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with stdlib: %v", err)
-		}
-		jbIter, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with jsoniter: %v", err)
-		}
-		if string(jbStd) != string(jbIter) {
-			t.Errorf("marshal expected:\n    %s\ngot:\n    %s\nobj:\n    %s",
-				indent(jbStd, "    "), indent(jbIter, "    "), dump(before))
-		}
-
-		var afterStd T
-		err = json.Unmarshal(jbIter, &afterStd)
-		if err != nil {
-			t.Errorf("failed to unmarshal with stdlib: %v", err)
-		}
-		var afterIter T
-		err = jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(jbIter, &afterIter)
-		if err != nil {
-			t.Errorf("failed to unmarshal with jsoniter: %v", err)
-		}
-		if fingerprint(afterStd) != fingerprint(afterIter) {
-			t.Errorf("unmarshal expected:\n    %s\ngot:\n    %s\nvia:\n    %s",
-				dump(afterStd), dump(afterIter), indent(jbIter, "    "))
-		}
-	}
-}
-
-const indentStr = ">  "
-
-func fingerprint(obj interface{}) string {
-	c := spew.ConfigState{
-		SortKeys: true,
-		SpewKeys: true,
-	}
-	return c.Sprintf("%v", obj)
-}
-
-func dump(obj interface{}) string {
-	cfg := spew.ConfigState{
-		Indent: indentStr,
-	}
-	return cfg.Sdump(obj)
-}
-
-func indent(src []byte, prefix string) string {
-	var buf bytes.Buffer
-	json.Indent(&buf, src, prefix, indentStr)
-	return buf.String()
-}
-
-func benchmarkMarshal(t *testing.B, name string, fn func(interface{}) ([]byte, error)) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var obj T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&obj)
-	for i := 0; i < t.N; i++ {
-		jb, err := fn(obj)
-		if err != nil {
-			t.Fatalf("%s failed to marshal:\n input: %s\n  error: %v", name, dump(obj), err)
-		}
-		_ = jb
-	}
-}
-
-func benchmarkUnmarshal(t *testing.B, name string, fn func(data []byte, v interface{}) error) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var before T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&before)
-	jb, err := json.Marshal(before)
-	if err != nil {
-		t.Fatalf("failed to marshal: %v", err)
-	}
-
-	for i := 0; i < t.N; i++ {
-		var after T
-		err = fn(jb, &after)
-		if err != nil {
-			t.Fatalf("%s failed to unmarshal:\n  input: %q\n  error: %v", name, string(jb), err)
-		}
-	}
-}
-
-func BenchmarkStandardMarshal(t *testing.B) {
-	benchmarkMarshal(t, "stdlib", json.Marshal)
-}
-
-func BenchmarkStandardUnmarshal(t *testing.B) {
-	benchmarkUnmarshal(t, "stdlib", json.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalFastest(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalFastest(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalDefault(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-default", jsoniter.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalDefault(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-default", jsoniter.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalCompatible(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalCompatible(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal)
-}

+ 0 - 5
output_tests/maps/builtins/string_alias/uint8/types.go

@@ -1,5 +0,0 @@
-package test
-
-type StringAlias string
-
-type T map[StringAlias]uint8

+ 0 - 139
output_tests/maps/builtins/uint8/bool/json_test.go

@@ -1,139 +0,0 @@
-package test
-
-import (
-	"bytes"
-	"encoding/json"
-	"testing"
-
-	"github.com/davecgh/go-spew/spew"
-	fuzz "github.com/google/gofuzz"
-	jsoniter "github.com/json-iterator/go"
-)
-
-func Test_Roundtrip(t *testing.T) {
-	fz := fuzz.New().MaxDepth(10).NilChance(0.3)
-	for i := 0; i < 1000; i++ {
-		var before T
-		fz.Fuzz(&before)
-
-		jbStd, err := json.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with stdlib: %v", err)
-		}
-		jbIter, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with jsoniter: %v", err)
-		}
-		if string(jbStd) != string(jbIter) {
-			t.Errorf("marshal expected:\n    %s\ngot:\n    %s\nobj:\n    %s",
-				indent(jbStd, "    "), indent(jbIter, "    "), dump(before))
-		}
-
-		var afterStd T
-		err = json.Unmarshal(jbIter, &afterStd)
-		if err != nil {
-			t.Errorf("failed to unmarshal with stdlib: %v", err)
-		}
-		var afterIter T
-		err = jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(jbIter, &afterIter)
-		if err != nil {
-			t.Errorf("failed to unmarshal with jsoniter: %v", err)
-		}
-		if fingerprint(afterStd) != fingerprint(afterIter) {
-			t.Errorf("unmarshal expected:\n    %s\ngot:\n    %s\nvia:\n    %s",
-				dump(afterStd), dump(afterIter), indent(jbIter, "    "))
-		}
-	}
-}
-
-const indentStr = ">  "
-
-func fingerprint(obj interface{}) string {
-	c := spew.ConfigState{
-		SortKeys: true,
-		SpewKeys: true,
-	}
-	return c.Sprintf("%v", obj)
-}
-
-func dump(obj interface{}) string {
-	cfg := spew.ConfigState{
-		Indent: indentStr,
-	}
-	return cfg.Sdump(obj)
-}
-
-func indent(src []byte, prefix string) string {
-	var buf bytes.Buffer
-	json.Indent(&buf, src, prefix, indentStr)
-	return buf.String()
-}
-
-func benchmarkMarshal(t *testing.B, name string, fn func(interface{}) ([]byte, error)) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var obj T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&obj)
-	for i := 0; i < t.N; i++ {
-		jb, err := fn(obj)
-		if err != nil {
-			t.Fatalf("%s failed to marshal:\n input: %s\n  error: %v", name, dump(obj), err)
-		}
-		_ = jb
-	}
-}
-
-func benchmarkUnmarshal(t *testing.B, name string, fn func(data []byte, v interface{}) error) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var before T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&before)
-	jb, err := json.Marshal(before)
-	if err != nil {
-		t.Fatalf("failed to marshal: %v", err)
-	}
-
-	for i := 0; i < t.N; i++ {
-		var after T
-		err = fn(jb, &after)
-		if err != nil {
-			t.Fatalf("%s failed to unmarshal:\n  input: %q\n  error: %v", name, string(jb), err)
-		}
-	}
-}
-
-func BenchmarkStandardMarshal(t *testing.B) {
-	benchmarkMarshal(t, "stdlib", json.Marshal)
-}
-
-func BenchmarkStandardUnmarshal(t *testing.B) {
-	benchmarkUnmarshal(t, "stdlib", json.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalFastest(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalFastest(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalDefault(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-default", jsoniter.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalDefault(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-default", jsoniter.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalCompatible(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalCompatible(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal)
-}

+ 0 - 3
output_tests/maps/builtins/uint8/bool/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[uint8]bool

+ 0 - 139
output_tests/maps/builtins/uint8/byte/json_test.go

@@ -1,139 +0,0 @@
-package test
-
-import (
-	"bytes"
-	"encoding/json"
-	"testing"
-
-	"github.com/davecgh/go-spew/spew"
-	fuzz "github.com/google/gofuzz"
-	jsoniter "github.com/json-iterator/go"
-)
-
-func Test_Roundtrip(t *testing.T) {
-	fz := fuzz.New().MaxDepth(10).NilChance(0.3)
-	for i := 0; i < 1000; i++ {
-		var before T
-		fz.Fuzz(&before)
-
-		jbStd, err := json.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with stdlib: %v", err)
-		}
-		jbIter, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with jsoniter: %v", err)
-		}
-		if string(jbStd) != string(jbIter) {
-			t.Errorf("marshal expected:\n    %s\ngot:\n    %s\nobj:\n    %s",
-				indent(jbStd, "    "), indent(jbIter, "    "), dump(before))
-		}
-
-		var afterStd T
-		err = json.Unmarshal(jbIter, &afterStd)
-		if err != nil {
-			t.Errorf("failed to unmarshal with stdlib: %v", err)
-		}
-		var afterIter T
-		err = jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(jbIter, &afterIter)
-		if err != nil {
-			t.Errorf("failed to unmarshal with jsoniter: %v", err)
-		}
-		if fingerprint(afterStd) != fingerprint(afterIter) {
-			t.Errorf("unmarshal expected:\n    %s\ngot:\n    %s\nvia:\n    %s",
-				dump(afterStd), dump(afterIter), indent(jbIter, "    "))
-		}
-	}
-}
-
-const indentStr = ">  "
-
-func fingerprint(obj interface{}) string {
-	c := spew.ConfigState{
-		SortKeys: true,
-		SpewKeys: true,
-	}
-	return c.Sprintf("%v", obj)
-}
-
-func dump(obj interface{}) string {
-	cfg := spew.ConfigState{
-		Indent: indentStr,
-	}
-	return cfg.Sdump(obj)
-}
-
-func indent(src []byte, prefix string) string {
-	var buf bytes.Buffer
-	json.Indent(&buf, src, prefix, indentStr)
-	return buf.String()
-}
-
-func benchmarkMarshal(t *testing.B, name string, fn func(interface{}) ([]byte, error)) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var obj T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&obj)
-	for i := 0; i < t.N; i++ {
-		jb, err := fn(obj)
-		if err != nil {
-			t.Fatalf("%s failed to marshal:\n input: %s\n  error: %v", name, dump(obj), err)
-		}
-		_ = jb
-	}
-}
-
-func benchmarkUnmarshal(t *testing.B, name string, fn func(data []byte, v interface{}) error) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var before T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&before)
-	jb, err := json.Marshal(before)
-	if err != nil {
-		t.Fatalf("failed to marshal: %v", err)
-	}
-
-	for i := 0; i < t.N; i++ {
-		var after T
-		err = fn(jb, &after)
-		if err != nil {
-			t.Fatalf("%s failed to unmarshal:\n  input: %q\n  error: %v", name, string(jb), err)
-		}
-	}
-}
-
-func BenchmarkStandardMarshal(t *testing.B) {
-	benchmarkMarshal(t, "stdlib", json.Marshal)
-}
-
-func BenchmarkStandardUnmarshal(t *testing.B) {
-	benchmarkUnmarshal(t, "stdlib", json.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalFastest(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalFastest(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalDefault(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-default", jsoniter.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalDefault(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-default", jsoniter.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalCompatible(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalCompatible(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal)
-}

+ 0 - 3
output_tests/maps/builtins/uint8/byte/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[uint8]byte

+ 0 - 139
output_tests/maps/builtins/uint8/float32/json_test.go

@@ -1,139 +0,0 @@
-package test
-
-import (
-	"bytes"
-	"encoding/json"
-	"testing"
-
-	"github.com/davecgh/go-spew/spew"
-	fuzz "github.com/google/gofuzz"
-	jsoniter "github.com/json-iterator/go"
-)
-
-func Test_Roundtrip(t *testing.T) {
-	fz := fuzz.New().MaxDepth(10).NilChance(0.3)
-	for i := 0; i < 1000; i++ {
-		var before T
-		fz.Fuzz(&before)
-
-		jbStd, err := json.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with stdlib: %v", err)
-		}
-		jbIter, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with jsoniter: %v", err)
-		}
-		if string(jbStd) != string(jbIter) {
-			t.Errorf("marshal expected:\n    %s\ngot:\n    %s\nobj:\n    %s",
-				indent(jbStd, "    "), indent(jbIter, "    "), dump(before))
-		}
-
-		var afterStd T
-		err = json.Unmarshal(jbIter, &afterStd)
-		if err != nil {
-			t.Errorf("failed to unmarshal with stdlib: %v", err)
-		}
-		var afterIter T
-		err = jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(jbIter, &afterIter)
-		if err != nil {
-			t.Errorf("failed to unmarshal with jsoniter: %v", err)
-		}
-		if fingerprint(afterStd) != fingerprint(afterIter) {
-			t.Errorf("unmarshal expected:\n    %s\ngot:\n    %s\nvia:\n    %s",
-				dump(afterStd), dump(afterIter), indent(jbIter, "    "))
-		}
-	}
-}
-
-const indentStr = ">  "
-
-func fingerprint(obj interface{}) string {
-	c := spew.ConfigState{
-		SortKeys: true,
-		SpewKeys: true,
-	}
-	return c.Sprintf("%v", obj)
-}
-
-func dump(obj interface{}) string {
-	cfg := spew.ConfigState{
-		Indent: indentStr,
-	}
-	return cfg.Sdump(obj)
-}
-
-func indent(src []byte, prefix string) string {
-	var buf bytes.Buffer
-	json.Indent(&buf, src, prefix, indentStr)
-	return buf.String()
-}
-
-func benchmarkMarshal(t *testing.B, name string, fn func(interface{}) ([]byte, error)) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var obj T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&obj)
-	for i := 0; i < t.N; i++ {
-		jb, err := fn(obj)
-		if err != nil {
-			t.Fatalf("%s failed to marshal:\n input: %s\n  error: %v", name, dump(obj), err)
-		}
-		_ = jb
-	}
-}
-
-func benchmarkUnmarshal(t *testing.B, name string, fn func(data []byte, v interface{}) error) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var before T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&before)
-	jb, err := json.Marshal(before)
-	if err != nil {
-		t.Fatalf("failed to marshal: %v", err)
-	}
-
-	for i := 0; i < t.N; i++ {
-		var after T
-		err = fn(jb, &after)
-		if err != nil {
-			t.Fatalf("%s failed to unmarshal:\n  input: %q\n  error: %v", name, string(jb), err)
-		}
-	}
-}
-
-func BenchmarkStandardMarshal(t *testing.B) {
-	benchmarkMarshal(t, "stdlib", json.Marshal)
-}
-
-func BenchmarkStandardUnmarshal(t *testing.B) {
-	benchmarkUnmarshal(t, "stdlib", json.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalFastest(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalFastest(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalDefault(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-default", jsoniter.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalDefault(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-default", jsoniter.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalCompatible(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalCompatible(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal)
-}

+ 0 - 3
output_tests/maps/builtins/uint8/float32/types.go

@@ -1,3 +0,0 @@
-package test
-
-type T map[uint8]float32

+ 0 - 139
output_tests/maps/builtins/uint8/float64/json_test.go

@@ -1,139 +0,0 @@
-package test
-
-import (
-	"bytes"
-	"encoding/json"
-	"testing"
-
-	"github.com/davecgh/go-spew/spew"
-	fuzz "github.com/google/gofuzz"
-	jsoniter "github.com/json-iterator/go"
-)
-
-func Test_Roundtrip(t *testing.T) {
-	fz := fuzz.New().MaxDepth(10).NilChance(0.3)
-	for i := 0; i < 1000; i++ {
-		var before T
-		fz.Fuzz(&before)
-
-		jbStd, err := json.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with stdlib: %v", err)
-		}
-		jbIter, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(before)
-		if err != nil {
-			t.Errorf("failed to marshal with jsoniter: %v", err)
-		}
-		if string(jbStd) != string(jbIter) {
-			t.Errorf("marshal expected:\n    %s\ngot:\n    %s\nobj:\n    %s",
-				indent(jbStd, "    "), indent(jbIter, "    "), dump(before))
-		}
-
-		var afterStd T
-		err = json.Unmarshal(jbIter, &afterStd)
-		if err != nil {
-			t.Errorf("failed to unmarshal with stdlib: %v", err)
-		}
-		var afterIter T
-		err = jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(jbIter, &afterIter)
-		if err != nil {
-			t.Errorf("failed to unmarshal with jsoniter: %v", err)
-		}
-		if fingerprint(afterStd) != fingerprint(afterIter) {
-			t.Errorf("unmarshal expected:\n    %s\ngot:\n    %s\nvia:\n    %s",
-				dump(afterStd), dump(afterIter), indent(jbIter, "    "))
-		}
-	}
-}
-
-const indentStr = ">  "
-
-func fingerprint(obj interface{}) string {
-	c := spew.ConfigState{
-		SortKeys: true,
-		SpewKeys: true,
-	}
-	return c.Sprintf("%v", obj)
-}
-
-func dump(obj interface{}) string {
-	cfg := spew.ConfigState{
-		Indent: indentStr,
-	}
-	return cfg.Sdump(obj)
-}
-
-func indent(src []byte, prefix string) string {
-	var buf bytes.Buffer
-	json.Indent(&buf, src, prefix, indentStr)
-	return buf.String()
-}
-
-func benchmarkMarshal(t *testing.B, name string, fn func(interface{}) ([]byte, error)) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var obj T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&obj)
-	for i := 0; i < t.N; i++ {
-		jb, err := fn(obj)
-		if err != nil {
-			t.Fatalf("%s failed to marshal:\n input: %s\n  error: %v", name, dump(obj), err)
-		}
-		_ = jb
-	}
-}
-
-func benchmarkUnmarshal(t *testing.B, name string, fn func(data []byte, v interface{}) error) {
-	t.ReportAllocs()
-	t.ResetTimer()
-
-	var before T
-	fz := fuzz.NewWithSeed(0).MaxDepth(10).NilChance(0.3)
-	fz.Fuzz(&before)
-	jb, err := json.Marshal(before)
-	if err != nil {
-		t.Fatalf("failed to marshal: %v", err)
-	}
-
-	for i := 0; i < t.N; i++ {
-		var after T
-		err = fn(jb, &after)
-		if err != nil {
-			t.Fatalf("%s failed to unmarshal:\n  input: %q\n  error: %v", name, string(jb), err)
-		}
-	}
-}
-
-func BenchmarkStandardMarshal(t *testing.B) {
-	benchmarkMarshal(t, "stdlib", json.Marshal)
-}
-
-func BenchmarkStandardUnmarshal(t *testing.B) {
-	benchmarkUnmarshal(t, "stdlib", json.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalFastest(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalFastest(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-fastest", jsoniter.ConfigFastest.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalDefault(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-default", jsoniter.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalDefault(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-default", jsoniter.Unmarshal)
-}
-
-func BenchmarkJSONIterMarshalCompatible(t *testing.B) {
-	benchmarkMarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Marshal)
-}
-
-func BenchmarkJSONIterUnmarshalCompatible(t *testing.B) {
-	benchmarkUnmarshal(t, "jsoniter-compat", jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal)
-}

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů