Adapt Hash Go binding tests for NULL values.

Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/21479606
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/21479606
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/21479606

Branch: refs/heads/master
Commit: 214796066b96415287e0aa0363d3178cd8982c8a
Parents: 0ca01dd
Author: Marvin Humphrey <[email protected]>
Authored: Mon Aug 10 15:56:53 2015 -0700
Committer: Marvin Humphrey <[email protected]>
Committed: Mon Aug 10 15:59:17 2015 -0700

----------------------------------------------------------------------
 runtime/go/clownfish/hash_test.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/21479606/runtime/go/clownfish/hash_test.go
----------------------------------------------------------------------
diff --git a/runtime/go/clownfish/hash_test.go 
b/runtime/go/clownfish/hash_test.go
index 992024f..c2970e0 100644
--- a/runtime/go/clownfish/hash_test.go
+++ b/runtime/go/clownfish/hash_test.go
@@ -26,7 +26,6 @@ func TestHashStoreFetch(t *testing.T) {
        if got, ok := hash.Fetch("foo").(string); !ok || got != "bar" {
                t.Errorf("Expected \"bar\", got %v", got)
        }
-       t.Skip("Can't store nil values yet")
        hash.Store("nada", nil)
        if got := hash.Fetch("nada"); got != nil {
                t.Errorf("Expected nil, got %v", got)
@@ -57,12 +56,16 @@ func TestHashClear(t *testing.T) {
 func TestHashHasKey(t *testing.T) {
        hash := NewHash(0)
        hash.Store("foo", 1)
+       hash.Store("nada", nil)
        if !hash.HasKey("foo") {
                t.Errorf("HasKey returns true on success")
        }
        if hash.HasKey("bar") {
                t.Errorf("HasKey returns false when key not present")
        }
+       if !hash.HasKey("nada") {
+               t.Errorf("HasKey returns true for key mapped to nil")
+       }
 }
 
 func TestHashKeys(t *testing.T) {

Reply via email to