Test more Go method bindings for Err.

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

Branch: refs/heads/master
Commit: 82023ccc6dc53778acc1c5e3c8114ffb864f9b41
Parents: 18ab461
Author: Marvin Humphrey <[email protected]>
Authored: Wed Aug 5 19:09:28 2015 -0700
Committer: Marvin Humphrey <[email protected]>
Committed: Thu Aug 6 19:51:32 2015 -0700

----------------------------------------------------------------------
 runtime/go/clownfish/err_test.go | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/82023ccc/runtime/go/clownfish/err_test.go
----------------------------------------------------------------------
diff --git a/runtime/go/clownfish/err_test.go b/runtime/go/clownfish/err_test.go
index 1457f7c..a7abff5 100644
--- a/runtime/go/clownfish/err_test.go
+++ b/runtime/go/clownfish/err_test.go
@@ -39,3 +39,28 @@ func TestTrapErr_no_trap_error(t *testing.T) {
        TrapErr(func() { panic(errors.New("foo")) })
        t.Error("Trapped non-clownfish.Error error type") // shouldn't reach 
here
 }
+
+func TestErrGetMess(t *testing.T) {
+       err := NewErr("foo")
+       expected := "foo"
+       if got := err.GetMess(); got != expected {
+               t.Errorf("Expected %v, got %v", expected, got)
+       }
+}
+
+func TestErrCatMess(t *testing.T) {
+       err := NewErr("foo")
+       err.CatMess("bar")
+       expected := "foobar"
+       if got := err.GetMess(); got != expected {
+               t.Errorf("Expected %v, got %v", expected, got)
+       }
+}
+
+func TestErrToString(t *testing.T) {
+       err := NewErr("foo")
+       expected := "foo"
+       if got := err.ToString(); got != expected {
+               t.Errorf("Expected %v, got %v", expected, got)
+       }
+}

Reply via email to