diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-12-16 15:49:04 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-12-16 15:49:04 -0500 |
commit | f54936467101bb08bbdf7f3d9c341134c06b83c3 (patch) | |
tree | 5976a456548fce8beb79014c7c2780afeea89a8a /Godeps/_workspace/src/github.com/stretchr/objx/mutations_test.go | |
parent | f08deca79f24ff1efe086483a091cf807a5a2e14 (diff) | |
download | chat-f54936467101bb08bbdf7f3d9c341134c06b83c3.tar.gz chat-f54936467101bb08bbdf7f3d9c341134c06b83c3.tar.bz2 chat-f54936467101bb08bbdf7f3d9c341134c06b83c3.zip |
Updating go dependancies
Diffstat (limited to 'Godeps/_workspace/src/github.com/stretchr/objx/mutations_test.go')
-rw-r--r-- | Godeps/_workspace/src/github.com/stretchr/objx/mutations_test.go | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/Godeps/_workspace/src/github.com/stretchr/objx/mutations_test.go b/Godeps/_workspace/src/github.com/stretchr/objx/mutations_test.go deleted file mode 100644 index e20ee23bc..000000000 --- a/Godeps/_workspace/src/github.com/stretchr/objx/mutations_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package objx - -import ( - "github.com/stretchr/testify/assert" - "testing" -) - -func TestExclude(t *testing.T) { - - d := make(Map) - d["name"] = "Mat" - d["age"] = 29 - d["secret"] = "ABC" - - excluded := d.Exclude([]string{"secret"}) - - assert.Equal(t, d["name"], excluded["name"]) - assert.Equal(t, d["age"], excluded["age"]) - assert.False(t, excluded.Has("secret"), "secret should be excluded") - -} - -func TestCopy(t *testing.T) { - - d1 := make(map[string]interface{}) - d1["name"] = "Tyler" - d1["location"] = "UT" - - d1Obj := New(d1) - d2Obj := d1Obj.Copy() - - d2Obj["name"] = "Mat" - - assert.Equal(t, d1Obj.Get("name").Str(), "Tyler") - assert.Equal(t, d2Obj.Get("name").Str(), "Mat") - -} - -func TestMerge(t *testing.T) { - - d := make(map[string]interface{}) - d["name"] = "Mat" - - d1 := make(map[string]interface{}) - d1["name"] = "Tyler" - d1["location"] = "UT" - - dObj := New(d) - d1Obj := New(d1) - - merged := dObj.Merge(d1Obj) - - assert.Equal(t, merged.Get("name").Str(), d1Obj.Get("name").Str()) - assert.Equal(t, merged.Get("location").Str(), d1Obj.Get("location").Str()) - assert.Empty(t, dObj.Get("location").Str()) - -} - -func TestMergeHere(t *testing.T) { - - d := make(map[string]interface{}) - d["name"] = "Mat" - - d1 := make(map[string]interface{}) - d1["name"] = "Tyler" - d1["location"] = "UT" - - dObj := New(d) - d1Obj := New(d1) - - merged := dObj.MergeHere(d1Obj) - - assert.Equal(t, dObj, merged, "With MergeHere, it should return the first modified map") - assert.Equal(t, merged.Get("name").Str(), d1Obj.Get("name").Str()) - assert.Equal(t, merged.Get("location").Str(), d1Obj.Get("location").Str()) - assert.Equal(t, merged.Get("location").Str(), dObj.Get("location").Str()) -} |