Removed gotos that were rendered invalid recently.
diff --git a/Makefile b/Makefile
index 7d775e0..333e56c 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,10 @@
checkers.go\
printer.go\
+#TARGDIR=$(GOPATH)/pkg/$(GOOS)_$(GOARCH)
+#GCIMPORTS=$(patsubst %,-I %/pkg/$(GOOS)_$(GOARCH),$(subst :, ,$(GOPATH)))
+#LDIMPORTS=$(patsubst %,-L %/pkg/$(GOOS)_$(GOARCH),$(subst :, ,$(GOPATH)))
+
include $(GOROOT)/src/Make.pkg
GOFMT=gofmt
diff --git a/TODO b/TODO
index df4b10a..d00a5e6 100644
--- a/TODO
+++ b/TODO
@@ -1,3 +1,5 @@
+- Assert(slice, Contains, item)
+
- GoTest prefix support, for running parallel tests
- Benchmark support
- Improved logging of multiline strings:
diff --git a/checkers_test.go b/checkers_test.go
index 267ade0..f997399 100644
--- a/checkers_test.go
+++ b/checkers_test.go
@@ -126,7 +126,7 @@
// Some error conditions.
testCheck(c, gocheck.Matches, false, "Obtained value is not a string and has no .String()", 1, "a.c")
- testCheck(c, gocheck.Matches, false, "Can't compile regex: unmatched '['", "abc", "a[c")
+ testCheck(c, gocheck.Matches, false, "Can't compile regex: regexp: unmatched '['", "abc", "a[c")
}
func (s *CheckersS) TestPanics(c *gocheck.C) {
diff --git a/helpers.go b/helpers.go
index 2d89178..d81b4a7 100644
--- a/helpers.go
+++ b/helpers.go
@@ -164,7 +164,9 @@
c.logCaller(2)
c.logString(fmt.Sprintf("%s(obtained, nil!?, ...):", funcName))
c.logString("Oops.. you've provided a nil checker!")
- goto fail
+ c.logNewLine()
+ c.Fail()
+ return false
}
// If the last argument is a bug info, extract it out.
@@ -184,7 +186,9 @@
c.logCaller(2)
c.logString(fmt.Sprintf("%s(%s):", funcName, strings.Join(names, ", ")))
c.logString(fmt.Sprintf("Wrong number of parameters for %s: want %d, got %d", info.Name, len(names), len(params)+1))
- goto fail
+ c.logNewLine()
+ c.Fail()
+ return false
}
// Copy since it may be mutated by Check.
@@ -203,12 +207,9 @@
if error != "" {
c.logString(error)
}
- goto fail
+ c.logNewLine()
+ c.Fail()
+ return false
}
return true
-
-fail:
- c.logNewLine()
- c.Fail()
- return false
}
diff --git a/run_test.go b/run_test.go
index f45a639..462e3df 100644
--- a/run_test.go
+++ b/run_test.go
@@ -265,7 +265,7 @@
runConf := RunConf{Output: &output, Filter: "]["}
result := Run(&helper, &runConf)
c.Check(result.String(), Equals,
- "ERROR: Bad filter expression: unmatched ']'")
+ "ERROR: Bad filter expression: regexp: unmatched ']'")
c.Check(helper.n, Equals, 0)
}