From 54bbd1e59317a6e9658eb8098657078cc8e81979 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 14 Aug 2022 20:52:06 -0600 Subject: wip: Reduce test differences [ci-skip] - Handle UTF-16 surrogate pairs - Handle cycles in values - Handle cycles in types - Better errors - Handle case-folding of struct field names - Allow []byteTypeWithMethods - Fix struct field-order - Fix handling of interfaces storing pointers - Enforce a maximum decode depth - Validate struct tags --- compat/json/borrowed_encode_test.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'compat/json/borrowed_encode_test.go') diff --git a/compat/json/borrowed_encode_test.go b/compat/json/borrowed_encode_test.go index bb7c9dc..11c2db4 100644 --- a/compat/json/borrowed_encode_test.go +++ b/compat/json/borrowed_encode_test.go @@ -226,11 +226,11 @@ var unsupportedValues = []any{ math.NaN(), math.Inf(-1), math.Inf(1), - //pointerCycle, // MODIFIED - //pointerCycleIndirect, // MODIFIED - //mapCycle, // MODIFIED - //sliceCycle, // MODIFIED - //recursiveSliceCycle, // MODIFIED + pointerCycle, + pointerCycleIndirect, + mapCycle, + sliceCycle, + recursiveSliceCycle, } func TestUnsupportedValues(t *testing.T) { @@ -344,7 +344,6 @@ func (CText) MarshalText() ([]byte, error) { } func TestMarshalerEscaping(t *testing.T) { - t.Skip() // MODIFIED var c C want := `"\u003c\u0026\u003e"` b, err := Marshal(c) @@ -877,7 +876,6 @@ func (f textfloat) MarshalText() ([]byte, error) { return tenc(`TF:%0.2f`, f) } // Issue 13783 func TestEncodeBytekind(t *testing.T) { - t.Skip() // TODO testdata := []struct { data any want string @@ -1139,7 +1137,6 @@ func TestMarshalRawMessageValue(t *testing.T) { if err != nil { t.Errorf("test %d, unexpected failure: %v", i, err) } else { - t.Skip() // MODIFIED t.Errorf("test %d, unexpected success", i) } } @@ -1178,7 +1175,6 @@ func TestMarshalUncommonFieldNames(t *testing.T) { } } -/* // MODIFIED func TestMarshalerError(t *testing.T) { s := "test variable" st := reflect.TypeOf(s) @@ -1205,4 +1201,3 @@ func TestMarshalerError(t *testing.T) { } } } -*/ // MODIFIED -- cgit v1.2.3-2-g168b