From 6e2cb00008cbf09e556b00f87603797fcaa47e09 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 16 Apr 2018 05:37:14 -0700 Subject: Depenancy upgrades and movign to dep. (#8630) --- .../github.com/mailru/easyjson/tests/opt_test.go | 70 ---------------------- 1 file changed, 70 deletions(-) delete mode 100644 vendor/github.com/mailru/easyjson/tests/opt_test.go (limited to 'vendor/github.com/mailru/easyjson/tests/opt_test.go') diff --git a/vendor/github.com/mailru/easyjson/tests/opt_test.go b/vendor/github.com/mailru/easyjson/tests/opt_test.go deleted file mode 100644 index bdd32aa4a..000000000 --- a/vendor/github.com/mailru/easyjson/tests/opt_test.go +++ /dev/null @@ -1,70 +0,0 @@ -package tests - -import ( - "math" - "reflect" - "testing" - - "encoding/json" - - "github.com/mailru/easyjson/opt" -) - -// This struct type must NOT have a generated marshaler -type OptsVanilla struct { - Int opt.Int - Uint opt.Uint - - Int8 opt.Int8 - Int16 opt.Int16 - Int32 opt.Int32 - Int64 opt.Int64 - - Uint8 opt.Uint8 - Uint16 opt.Uint16 - Uint32 opt.Uint32 - Uint64 opt.Uint64 - - Float32 opt.Float32 - Float64 opt.Float64 - - Bool opt.Bool - String opt.String -} - -var optsVanillaValue = OptsVanilla{ - Int: opt.OInt(-123), - Uint: opt.OUint(123), - - Int8: opt.OInt8(math.MaxInt8), - Int16: opt.OInt16(math.MaxInt16), - Int32: opt.OInt32(math.MaxInt32), - Int64: opt.OInt64(math.MaxInt64), - - Uint8: opt.OUint8(math.MaxUint8), - Uint16: opt.OUint16(math.MaxUint16), - Uint32: opt.OUint32(math.MaxUint32), - Uint64: opt.OUint64(math.MaxUint64), - - Float32: opt.OFloat32(math.MaxFloat32), - Float64: opt.OFloat64(math.MaxFloat64), - - Bool: opt.OBool(true), - String: opt.OString("foo"), -} - -func TestOptsVanilla(t *testing.T) { - data, err := json.Marshal(optsVanillaValue) - if err != nil { - t.Errorf("Failed to marshal vanilla opts: %v", err) - } - - var ov OptsVanilla - if err := json.Unmarshal(data, &ov); err != nil { - t.Errorf("Failed to unmarshal vanilla opts: %v", err) - } - - if !reflect.DeepEqual(optsVanillaValue, ov) { - t.Errorf("Vanilla opts unmarshal returned invalid value %+v, want %+v", ov, optsVanillaValue) - } -} -- cgit v1.2.3-1-g7c22