Enable tests for String methods which take Obj. Now that Obj is mapped to Go empty-interface, we can test against Go strings.
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/85743e3d Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/85743e3d Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/85743e3d Branch: refs/heads/master Commit: 85743e3dc6379c8069ea4af00aeb2d6acc0bd133 Parents: 2f1681b Author: Marvin Humphrey <[email protected]> Authored: Tue Aug 4 19:08:18 2015 -0700 Committer: Marvin Humphrey <[email protected]> Committed: Thu Aug 6 19:51:32 2015 -0700 ---------------------------------------------------------------------- runtime/go/clownfish/string_test.go | 64 +++++++++++++++----------------- 1 file changed, 29 insertions(+), 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/85743e3d/runtime/go/clownfish/string_test.go ---------------------------------------------------------------------- diff --git a/runtime/go/clownfish/string_test.go b/runtime/go/clownfish/string_test.go index 87427b2..7cb7fad 100644 --- a/runtime/go/clownfish/string_test.go +++ b/runtime/go/clownfish/string_test.go @@ -84,44 +84,38 @@ func TestStringFind(t *testing.T) { } func TestStringEquals(t *testing.T) { - t.Skip("Skip Equals because Obj arg won't accept string") - /* - s := NewString("foo") - if !s.Equals("foo") { - t.Error("Equals should succeed") - } - if s.Equals("bar") { - t.Error("Equals should fail") - } - */ + s := NewString("foo") + if !s.Equals("foo") { + t.Error("Equals should succeed") + } + if s.Equals("bar") { + t.Error("Equals should fail") + } } func TestStringCompareTo(t *testing.T) { - t.Skip("Skip CompareTo() because Obj arg won't accept string") - /* - s := NewString("foo") - if !(s.CompareTo("boo") > 0) { - t.Error("'foo' > 'boo'") - } - if !(s.CompareTo("foo") == 0) { - t.Error("'foo' == 'foo'") - } - if !(s.CompareTo("zoo") < 0) { - t.Error("'foo' < 'zoo'") - } - if !(s.CompareTo("fo") > 0) { - t.Error("'foo' > 'fo'") - } - if !(s.CompareTo("food") < 0) { - t.Error("'foo' < 'food'") - } - if !(s.CompareTo("foo\u0000") < 0) { - t.Error("'foo' < 'foo\\0'") - } - if !(s.CompareTo("") > 0) { - t.Error("'foo' > ''") - } - */ + s := NewString("foo") + if !(s.CompareTo("boo") > 0) { + t.Error("'foo' > 'boo'") + } + if !(s.CompareTo("foo") == 0) { + t.Error("'foo' == 'foo'") + } + if !(s.CompareTo("zoo") < 0) { + t.Error("'foo' < 'zoo'") + } + if !(s.CompareTo("fo") > 0) { + t.Error("'foo' > 'fo'") + } + if !(s.CompareTo("food") < 0) { + t.Error("'foo' < 'food'") + } + if !(s.CompareTo("foo\u0000") < 0) { + t.Error("'foo' < 'foo\\0'") + } + if !(s.CompareTo("") > 0) { + t.Error("'foo' > ''") + } } func TestStringLenAndGetSize(t *testing.T) {
