diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-01-29 14:17:40 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-29 14:17:40 -0800 |
commit | 961c04cae992eadb42d286d2f85f8a675bdc68c8 (patch) | |
tree | 3408f2d06f847e966c53485e2d54c692cdd037c1 /vendor/github.com/stretchr/objx/simple_example_test.go | |
parent | 8d66523ba7d9a77129844be476732ebfd5272d64 (diff) | |
download | chat-961c04cae992eadb42d286d2f85f8a675bdc68c8.tar.gz chat-961c04cae992eadb42d286d2f85f8a675bdc68c8.tar.bz2 chat-961c04cae992eadb42d286d2f85f8a675bdc68c8.zip |
Upgrading server dependancies (#8154)
Diffstat (limited to 'vendor/github.com/stretchr/objx/simple_example_test.go')
-rw-r--r-- | vendor/github.com/stretchr/objx/simple_example_test.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/vendor/github.com/stretchr/objx/simple_example_test.go b/vendor/github.com/stretchr/objx/simple_example_test.go index 5408c7fd3..403753d65 100644 --- a/vendor/github.com/stretchr/objx/simple_example_test.go +++ b/vendor/github.com/stretchr/objx/simple_example_test.go @@ -1,21 +1,23 @@ -package objx +package objx_test import ( - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/objx" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestSimpleExample(t *testing.T) { - // build a map from a JSON object - o := MustFromJSON(`{"name":"Mat","foods":["indian","chinese"], "location":{"county":"hobbiton","city":"the shire"}}`) + o := objx.MustFromJSON(`{"name":"Mat","foods":["indian","chinese"], "location":{"county":"hobbiton","city":"the shire"}}`) // Map can be used as a straight map[string]interface{} assert.Equal(t, o["name"], "Mat") // Get an Value object v := o.Get("name") - assert.Equal(t, v, &Value{data: "Mat"}) + require.NotNil(t, v) // Test the contained value assert.False(t, v.IsInt()) @@ -37,5 +39,4 @@ func TestSimpleExample(t *testing.T) { // Get a value by using dot notation assert.Equal(t, "hobbiton", o.Get("location.county").Str()) - } |