Forráskód Böngészése

Updated macaron dependency

Torkel Ödegaard 11 éve
szülő
commit
52992928d5
100 módosított fájl, 2814 hozzáadás és 16581 törlés
  1. 4 7
      Godeps/Godeps.json
  2. 1 1
      Godeps/_workspace/src/github.com/Unknwon/macaron/README.md
  3. 16 5
      Godeps/_workspace/src/github.com/Unknwon/macaron/context.go
  4. 1 0
      Godeps/_workspace/src/github.com/Unknwon/macaron/context_test.go
  5. 1 0
      Godeps/_workspace/src/github.com/Unknwon/macaron/inject/inject.goconvey
  6. 5 5
      Godeps/_workspace/src/github.com/Unknwon/macaron/logger.go
  7. 3 3
      Godeps/_workspace/src/github.com/Unknwon/macaron/macaron.go
  8. 3 2
      Godeps/_workspace/src/github.com/Unknwon/macaron/macaron_test.go
  9. 3 1
      Godeps/_workspace/src/github.com/Unknwon/macaron/router.go
  10. 0 18
      Godeps/_workspace/src/github.com/jtolds/gls/LICENSE
  11. 0 64
      Godeps/_workspace/src/github.com/jtolds/gls/README.md
  12. 0 150
      Godeps/_workspace/src/github.com/jtolds/gls/context.go
  13. 0 139
      Godeps/_workspace/src/github.com/jtolds/gls/context_test.go
  14. 0 13
      Godeps/_workspace/src/github.com/jtolds/gls/gen_sym.go
  15. 0 34
      Godeps/_workspace/src/github.com/jtolds/gls/id_pool.go
  16. 0 93
      Godeps/_workspace/src/github.com/jtolds/gls/stack_tags.go
  17. 191 0
      Godeps/_workspace/src/github.com/macaron-contrib/binding/LICENSE
  18. 21 0
      Godeps/_workspace/src/github.com/macaron-contrib/binding/README.md
  19. 57 0
      Godeps/_workspace/src/github.com/macaron-contrib/binding/bind_test.go
  20. 620 0
      Godeps/_workspace/src/github.com/macaron-contrib/binding/binding.go
  21. 115 0
      Godeps/_workspace/src/github.com/macaron-contrib/binding/common_test.go
  22. 162 0
      Godeps/_workspace/src/github.com/macaron-contrib/binding/errorhandler_test.go
  23. 158 0
      Godeps/_workspace/src/github.com/macaron-contrib/binding/errors.go
  24. 115 0
      Godeps/_workspace/src/github.com/macaron-contrib/binding/errors_test.go
  25. 191 0
      Godeps/_workspace/src/github.com/macaron-contrib/binding/file_test.go
  26. 282 0
      Godeps/_workspace/src/github.com/macaron-contrib/binding/form_test.go
  27. 222 0
      Godeps/_workspace/src/github.com/macaron-contrib/binding/json_test.go
  28. 118 0
      Godeps/_workspace/src/github.com/macaron-contrib/binding/misc_test.go
  29. 155 0
      Godeps/_workspace/src/github.com/macaron-contrib/binding/multipart_test.go
  30. 370 0
      Godeps/_workspace/src/github.com/macaron-contrib/binding/validate_test.go
  31. 0 65
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions.go
  32. 0 3
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/assertions.goconvey
  33. 0 140
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/collections.go
  34. 0 103
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/collections_test.go
  35. 0 43
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/doc.go
  36. 0 279
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/equality.go
  37. 0 267
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/equality_test.go
  38. 0 22
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/filter.go
  39. 0 6
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/init.go
  40. 0 87
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/messages.go
  41. 0 5
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/.gitignore
  42. 0 202
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/LICENSE
  43. 0 56
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/README.markdown
  44. 0 70
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/all_of.go
  45. 0 110
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/all_of_test.go
  46. 0 32
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/any.go
  47. 0 93
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/any_of.go
  48. 0 121
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/any_of_test.go
  49. 0 53
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/any_test.go
  50. 0 61
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/contains.go
  51. 0 234
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/contains_test.go
  52. 0 88
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/deep_equals.go
  53. 0 344
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/deep_equals_test.go
  54. 0 91
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/elements_are.go
  55. 0 208
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/elements_are_test.go
  56. 0 529
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/equals.go
  57. 0 3785
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/equals_test.go
  58. 0 51
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/error.go
  59. 0 92
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/error_test.go
  60. 0 39
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/greater_or_equal.go
  61. 0 1059
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/greater_or_equal_test.go
  62. 0 39
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/greater_than.go
  63. 0 1079
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/greater_than_test.go
  64. 0 52
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/has_substr.go
  65. 0 92
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/has_substr_test.go
  66. 0 134
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/identical_to.go
  67. 0 849
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/identical_to_test.go
  68. 0 41
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/less_or_equal.go
  69. 0 1079
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/less_or_equal_test.go
  70. 0 152
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/less_than.go
  71. 0 1059
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/less_than_test.go
  72. 0 82
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/matcher.go
  73. 0 69
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/matches_regexp.go
  74. 0 92
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/matches_regexp_test.go
  75. 0 53
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/not.go
  76. 0 107
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/not_test.go
  77. 0 2
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/oglematchers.goconvey
  78. 0 74
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/panics.go
  79. 0 141
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/panics_test.go
  80. 0 65
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/pointee.go
  81. 0 153
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/pointee_test.go
  82. 0 36
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/transform_description.go
  83. 0 5
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/.gitignore
  84. 0 202
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/LICENSE
  85. 0 101
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/README.markdown
  86. 0 36
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/action.go
  87. 0 480
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/controller.go
  88. 0 226
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/createmock/createmock.go
  89. 0 1
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/createmock/test_cases/golden.no_interfaces
  90. 0 1
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/createmock/test_cases/golden.no_package
  91. 0 1
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/createmock/test_cases/golden.unknown_interface
  92. 0 1
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/createmock/test_cases/golden.unknown_package
  93. 0 29
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/error_reporter.go
  94. 0 59
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/expectation.go
  95. 0 329
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/generate.go
  96. 0 41
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/complicated_pkg/complicated_pkg.go
  97. 0 312
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/golden.complicated_pkg.go
  98. 0 239
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/golden.image.go
  99. 0 128
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/golden.io_reader_writer.go
  100. 0 67
      Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/golden.renamed_pkg.go

+ 4 - 7
Godeps/Godeps.json

@@ -1,9 +1,6 @@
 {
 	"ImportPath": "github.com/torkelo/grafana-pro",
 	"GoVersion": "go1.3",
-	"Packages": [
-		"./pkg/..."
-	],
 	"Deps": [
 		{
 			"ImportPath": "github.com/Unknwon/com",
@@ -15,7 +12,7 @@
 		},
 		{
 			"ImportPath": "github.com/Unknwon/macaron",
-			"Rev": "0f55900b417c019233ec27f86950bfb9feda8379"
+			"Rev": "da7cbddc50b9d33e076fb1eabff13b55c3b85fc5"
 		},
 		{
 			"ImportPath": "github.com/codegangsta/cli",
@@ -37,8 +34,8 @@
 			"Rev": "5c23849a66f4593e68909bb6c1fa30651b5b0541"
 		},
 		{
-			"ImportPath": "github.com/jtolds/gls",
-			"Rev": "f1ac7f4f24f50328e6bc838ca4437d1612a0243c"
+			"ImportPath": "github.com/macaron-contrib/binding",
+			"Rev": "0fbe4b9707e6eb556ef843e5471592f55ce0a5e7"
 		},
 		{
 			"ImportPath": "github.com/macaron-contrib/session",
@@ -48,7 +45,7 @@
 			"ImportPath": "github.com/mattn/go-sqlite3",
 			"Rev": "d10e2c8f62100097910367dee90a9bd89d426a44"
 		},
-		{
+    {
 			"ImportPath": "github.com/smartystreets/goconvey/convey",
 			"Comment": "1.5.0-356-gfbc0a1c",
 			"Rev": "fbc0a1c888f9f96263f9a559d1769905245f1123"

+ 1 - 1
Godeps/_workspace/src/github.com/Unknwon/macaron/README.md

@@ -5,7 +5,7 @@ Macaron [![Build Status](https://drone.io/github.com/Unknwon/macaron/status.png)
 
 Package macaron is a high productive and modular design web framework in Go.
 
-##### Current version: 0.4.9
+##### Current version: 0.5.0
 
 ## Getting Started
 

+ 16 - 5
Godeps/_workspace/src/github.com/Unknwon/macaron/context.go

@@ -146,13 +146,12 @@ func (ctx *Context) renderHTML(status int, setName, tplName string, data ...inte
 	if ctx.Render == nil {
 		panic("renderer middleware hasn't been registered")
 	}
-	if len(data) == 0 {
+	if len(data) <= 0 {
 		ctx.Render.HTMLSet(status, setName, tplName, ctx.Data)
-	} else {
+	} else if len(data) == 1 {
 		ctx.Render.HTMLSet(status, setName, tplName, data[0])
-		if len(data) > 1 {
-			ctx.Render.HTMLSet(status, setName, tplName, data[0], data[1].(HTMLOptions))
-		}
+	} else {
+		ctx.Render.HTMLSet(status, setName, tplName, data[0], data[1].(HTMLOptions))
 	}
 }
 
@@ -212,21 +211,33 @@ func (ctx *Context) QueryInt64(name string) int64 {
 }
 
 // Params returns value of given param name.
+// e.g. ctx.Params(":uid")
 func (ctx *Context) Params(name string) string {
 	return ctx.params[name]
 }
 
+// SetParams sets value of param with given name.
+func (ctx *Context) SetParams(name, val string) {
+	if !strings.HasPrefix(name, ":") {
+		name = ":" + name
+	}
+	ctx.params[name] = val
+}
+
 // ParamsEscape returns escapred params result.
+// e.g. ctx.ParamsEscape(":uname")
 func (ctx *Context) ParamsEscape(name string) string {
 	return template.HTMLEscapeString(ctx.Params(name))
 }
 
 // ParamsInt returns params result in int type.
+// e.g. ctx.ParamsInt(":uid")
 func (ctx *Context) ParamsInt(name string) int {
 	return com.StrTo(ctx.Params(name)).MustInt()
 }
 
 // ParamsInt64 returns params result in int64 type.
+// e.g. ctx.ParamsInt64(":uid")
 func (ctx *Context) ParamsInt64(name string) int64 {
 	return com.StrTo(ctx.Params(name)).MustInt64()
 }

+ 1 - 0
Godeps/_workspace/src/github.com/Unknwon/macaron/context_test.go

@@ -130,6 +130,7 @@ func Test_Context(t *testing.T) {
 		Convey("URL parameter", func() {
 			m.Get("/:name/:int/:int64", func(ctx *Context) string {
 				var buf bytes.Buffer
+				ctx.SetParams(":name", ctx.Params(":name"))
 				buf.WriteString(ctx.Params(":name") + " ")
 				buf.WriteString(ctx.ParamsEscape(":name") + " ")
 				buf.WriteString(com.ToStr(ctx.ParamsInt(":int")) + " ")

+ 1 - 0
Godeps/_workspace/src/github.com/Unknwon/macaron/inject/inject.goconvey

@@ -0,0 +1 @@
+ignore

+ 5 - 5
Godeps/_workspace/src/github.com/Unknwon/macaron/logger.go

@@ -23,10 +23,10 @@ import (
 	"time"
 )
 
-var isWindows bool
+var ColorLog = true
 
 func init() {
-	isWindows = runtime.GOOS == "windows"
+	ColorLog = runtime.GOOS != "windows"
 }
 
 // Logger returns a middleware handler that logs the request as it goes in and the response as it goes out.
@@ -34,13 +34,13 @@ func Logger() Handler {
 	return func(ctx *Context, log *log.Logger) {
 		start := time.Now()
 
-		log.Printf("Started %s %s for %s", ctx.Req.Method,ctx.Req.RequestURI, ctx.RemoteAddr())
+		log.Printf("Started %s %s for %s", ctx.Req.Method, ctx.Req.RequestURI, ctx.RemoteAddr())
 
 		rw := ctx.Resp.(ResponseWriter)
 		ctx.Next()
 
-		content := fmt.Sprintf("Completed %s %v %s in %v",  ctx.Req.RequestURI, rw.Status(), http.StatusText(rw.Status()), time.Since(start))
-		if !isWindows {
+		content := fmt.Sprintf("Completed %s %v %s in %v", ctx.Req.RequestURI, rw.Status(), http.StatusText(rw.Status()), time.Since(start))
+		if ColorLog {
 			switch rw.Status() {
 			case 200, 201, 202:
 				content = fmt.Sprintf("\033[1;32m%s\033[0m", content)

+ 3 - 3
Godeps/_workspace/src/github.com/Unknwon/macaron/macaron.go

@@ -29,7 +29,7 @@ import (
 	"github.com/Unknwon/macaron/inject"
 )
 
-const _VERSION = "0.4.9.1229"
+const _VERSION = "0.5.0.0116"
 
 func Version() string {
 	return _VERSION
@@ -258,9 +258,9 @@ func init() {
 }
 
 // SetConfig sets data sources for configuration.
-func SetConfig(source interface{}, others ...interface{}) (err error) {
+func SetConfig(source interface{}, others ...interface{}) (_ *ini.File, err error) {
 	cfg, err = ini.Load(source, others...)
-	return err
+	return Config(), err
 }
 
 // Config returns configuration convention object.

+ 3 - 2
Godeps/_workspace/src/github.com/Unknwon/macaron/macaron_test.go

@@ -211,7 +211,8 @@ func Test_SetENV(t *testing.T) {
 func Test_Config(t *testing.T) {
 	Convey("Set and get configuration object", t, func() {
 		So(Config(), ShouldNotBeNil)
-		So(SetConfig([]byte("")), ShouldBeNil)
-		So(Config(), ShouldNotBeNil)
+		cfg, err := SetConfig([]byte(""))
+		So(err, ShouldBeNil)
+		So(cfg, ShouldNotBeNil)
 	})
 }

+ 3 - 1
Godeps/_workspace/src/github.com/Unknwon/macaron/router.go

@@ -152,7 +152,9 @@ func (r *Router) Handle(method string, pattern string, handlers []Handler) {
 	r.handle(method, pattern, func(resp http.ResponseWriter, req *http.Request, params Params) {
 		c := r.m.createContext(resp, req)
 		c.params = params
-		c.handlers = append(r.m.handlers, handlers...)
+		c.handlers = make([]Handler, 0, len(r.m.handlers)+len(handlers))
+		c.handlers = append(c.handlers, r.m.handlers...)
+		c.handlers = append(c.handlers, handlers...)
 		c.run()
 	})
 }

+ 0 - 18
Godeps/_workspace/src/github.com/jtolds/gls/LICENSE

@@ -1,18 +0,0 @@
-Copyright (c) 2013, Space Monkey, Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0 - 64
Godeps/_workspace/src/github.com/jtolds/gls/README.md

@@ -1,64 +0,0 @@
-gls
-===
-
-Goroutine local storage
-
-### Huhwaht? Why? ###
-
-Every so often, a thread shows up on the
-[golang-nuts](https://groups.google.com/d/forum/golang-nuts) asking for some
-form of goroutine-local-storage, or some kind of goroutine id, or some kind of
-context. There are a few valid use cases for goroutine-local-storage, one of
-the most prominent being log line context. One poster was interested in being
-able to log an HTTP request context id in every log line in the same goroutine
-as the incoming HTTP request, without having to change every library and
-function call he was interested in logging.
-
-This would be pretty useful. Provided that you could get some kind of
-goroutine-local-storage, you could call
-[log.SetOutput](http://golang.org/pkg/log/#SetOutput) with your own logging
-writer that checks goroutine-local-storage for some context information and
-adds that context to your log lines.
-
-But alas, Andrew Gerrand's typically diplomatic answer to the question of
-goroutine-local variables was:
-
-> We wouldn't even be having this discussion if thread local storage wasn't
-> useful. But every feature comes at a cost, and in my opinion the cost of
-> threadlocals far outweighs their benefits. They're just not a good fit for
-> Go.
-
-So, yeah, that makes sense. That's a pretty good reason for why the language
-won't support a specific and (relatively) unuseful feature that requires some
-runtime changes, just for the sake of a little bit of log improvement.
-
-But does Go require runtime changes?
-
-### How it works ###
-
-Go has pretty fantastic introspective and reflective features, but one thing Go
-doesn't give you is any kind of access to the stack pointer, or frame pointer,
-or goroutine id, or anything contextual about your current stack. It gives you
-access to your list of callers, but only along with program counters, which are
-fixed at compile time.
-
-But it does give you the stack.
-
-So, we define 16 special functions and embed base-16 tags into the stack using
-the call order of those 16 functions. Then, we can read our tags back out of
-the stack looking at the callers list.
-
-We then use these tags as an index into a traditional map for implementing
-this library.
-
-### What are people saying? ###
-
-"Wow, that's horrifying."
-
-"This is the most terrible thing I have seen in a very long time."
-
-"Where is it getting a context from? Is this serializing all the requests? What the heck is the client being bound to? What are these tags? Why does he need callers? Oh god no. No no no."
-
-### Docs ###
-
-Please see the docs at http://godoc.org/github.com/jtolds/gls

+ 0 - 150
Godeps/_workspace/src/github.com/jtolds/gls/context.go

@@ -1,150 +0,0 @@
-// Package gls implements goroutine-local storage.
-package gls
-
-import (
-	"runtime"
-	"sync"
-)
-
-const (
-	maxCallers = 64
-)
-
-var (
-	stackTagPool   = &idPool{}
-	mgrRegistry    = make(map[*ContextManager]bool)
-	mgrRegistryMtx sync.RWMutex
-)
-
-// Values is simply a map of key types to value types. Used by SetValues to
-// set multiple values at once.
-type Values map[interface{}]interface{}
-
-func currentStack(skip int) []uintptr {
-	stack := make([]uintptr, maxCallers)
-	return stack[:runtime.Callers(2+skip, stack)]
-}
-
-// ContextManager is the main entrypoint for interacting with
-// Goroutine-local-storage. You can have multiple independent ContextManagers
-// at any given time. ContextManagers are usually declared globally for a given
-// class of context variables. You should use NewContextManager for
-// construction.
-type ContextManager struct {
-	mtx    sync.RWMutex
-	values map[uint]Values
-}
-
-// NewContextManager returns a brand new ContextManager. It also registers the
-// new ContextManager in the ContextManager registry which is used by the Go
-// method. ContextManagers are typically defined globally at package scope.
-func NewContextManager() *ContextManager {
-	mgr := &ContextManager{values: make(map[uint]Values)}
-	mgrRegistryMtx.Lock()
-	defer mgrRegistryMtx.Unlock()
-	mgrRegistry[mgr] = true
-	return mgr
-}
-
-// Unregister removes a ContextManager from the global registry, used by the
-// Go method. Only intended for use when you're completely done with a
-// ContextManager. Use of Unregister at all is rare.
-func (m *ContextManager) Unregister() {
-	mgrRegistryMtx.Lock()
-	defer mgrRegistryMtx.Unlock()
-	delete(mgrRegistry, m)
-}
-
-// SetValues takes a collection of values and a function to call for those
-// values to be set in. Anything further down the stack will have the set
-// values available through GetValue. SetValues will add new values or replace
-// existing values of the same key and will not mutate or change values for
-// previous stack frames.
-// SetValues is slow (makes a copy of all current and new values for the new
-// gls-context) in order to reduce the amount of lookups GetValue requires.
-func (m *ContextManager) SetValues(new_values Values, context_call func()) {
-	if len(new_values) == 0 {
-		context_call()
-		return
-	}
-
-	tags := readStackTags(currentStack(1))
-
-	m.mtx.Lock()
-	values := new_values
-	for _, tag := range tags {
-		if existing_values, ok := m.values[tag]; ok {
-			// oh, we found existing values, let's make a copy
-			values = make(Values, len(existing_values)+len(new_values))
-			for key, val := range existing_values {
-				values[key] = val
-			}
-			for key, val := range new_values {
-				values[key] = val
-			}
-			break
-		}
-	}
-	new_tag := stackTagPool.Acquire()
-	m.values[new_tag] = values
-	m.mtx.Unlock()
-	defer func() {
-		m.mtx.Lock()
-		delete(m.values, new_tag)
-		m.mtx.Unlock()
-		stackTagPool.Release(new_tag)
-	}()
-
-	addStackTag(new_tag, context_call)
-}
-
-// GetValue will return a previously set value, provided that the value was set
-// by SetValues somewhere higher up the stack. If the value is not found, ok
-// will be false.
-func (m *ContextManager) GetValue(key interface{}) (value interface{}, ok bool) {
-
-	tags := readStackTags(currentStack(1))
-	m.mtx.RLock()
-	defer m.mtx.RUnlock()
-	for _, tag := range tags {
-		if values, ok := m.values[tag]; ok {
-			value, ok := values[key]
-			return value, ok
-		}
-	}
-	return "", false
-}
-
-func (m *ContextManager) getValues() Values {
-	tags := readStackTags(currentStack(2))
-	m.mtx.RLock()
-	defer m.mtx.RUnlock()
-	for _, tag := range tags {
-		if values, ok := m.values[tag]; ok {
-			return values
-		}
-	}
-	return nil
-}
-
-// Go preserves ContextManager values and Goroutine-local-storage across new
-// goroutine invocations. The Go method makes a copy of all existing values on
-// all registered context managers and makes sure they are still set after
-// kicking off the provided function in a new goroutine. If you don't use this
-// Go method instead of the standard 'go' keyword, you will lose values in
-// ContextManagers, as goroutines have brand new stacks.
-func Go(cb func()) {
-	mgrRegistryMtx.RLock()
-	defer mgrRegistryMtx.RUnlock()
-
-	for mgr, _ := range mgrRegistry {
-		values := mgr.getValues()
-		if len(values) > 0 {
-			mgr_copy := mgr
-			cb_copy := cb
-			cb = func() { mgr_copy.SetValues(values, cb_copy) }
-		}
-	}
-
-	go cb()
-}

+ 0 - 139
Godeps/_workspace/src/github.com/jtolds/gls/context_test.go

@@ -1,139 +0,0 @@
-package gls
-
-import (
-	"fmt"
-	"sync"
-	"testing"
-)
-
-func TestContexts(t *testing.T) {
-	mgr1 := NewContextManager()
-	mgr2 := NewContextManager()
-
-	CheckVal := func(mgr *ContextManager, key, exp_val string) {
-		val, ok := mgr.GetValue(key)
-		if len(exp_val) == 0 {
-			if ok {
-				t.Fatalf("expected no value for key %s, got %s", key, val)
-			}
-			return
-		}
-		if !ok {
-			t.Fatalf("expected value %s for key %s, got no value",
-				exp_val, key)
-		}
-		if exp_val != val {
-			t.Fatalf("expected value %s for key %s, got %s", exp_val, key,
-				val)
-		}
-
-	}
-
-	Check := func(exp_m1v1, exp_m1v2, exp_m2v1, exp_m2v2 string) {
-		CheckVal(mgr1, "key1", exp_m1v1)
-		CheckVal(mgr1, "key2", exp_m1v2)
-		CheckVal(mgr2, "key1", exp_m2v1)
-		CheckVal(mgr2, "key2", exp_m2v2)
-	}
-
-	Check("", "", "", "")
-	mgr2.SetValues(Values{"key1": "val1c"}, func() {
-		Check("", "", "val1c", "")
-		mgr1.SetValues(Values{"key1": "val1a"}, func() {
-			Check("val1a", "", "val1c", "")
-			mgr1.SetValues(Values{"key2": "val1b"}, func() {
-				Check("val1a", "val1b", "val1c", "")
-				var wg sync.WaitGroup
-				wg.Add(2)
-				go func() {
-					defer wg.Done()
-					Check("", "", "", "")
-				}()
-				Go(func() {
-					defer wg.Done()
-					Check("val1a", "val1b", "val1c", "")
-				})
-				wg.Wait()
-			})
-		})
-	})
-}
-
-func ExampleContextManager_SetValues() {
-	var (
-		mgr            = NewContextManager()
-		request_id_key = GenSym()
-	)
-
-	MyLog := func() {
-		if request_id, ok := mgr.GetValue(request_id_key); ok {
-			fmt.Println("My request id is:", request_id)
-		} else {
-			fmt.Println("No request id found")
-		}
-	}
-
-	mgr.SetValues(Values{request_id_key: "12345"}, func() {
-		MyLog()
-	})
-	MyLog()
-
-	// Output: My request id is: 12345
-	// No request id found
-}
-
-func ExampleGo() {
-	var (
-		mgr            = NewContextManager()
-		request_id_key = GenSym()
-	)
-
-	MyLog := func() {
-		if request_id, ok := mgr.GetValue(request_id_key); ok {
-			fmt.Println("My request id is:", request_id)
-		} else {
-			fmt.Println("No request id found")
-		}
-	}
-
-	mgr.SetValues(Values{request_id_key: "12345"}, func() {
-		var wg sync.WaitGroup
-		wg.Add(1)
-		go func() {
-			defer wg.Done()
-			MyLog()
-		}()
-		wg.Wait()
-		wg.Add(1)
-		Go(func() {
-			defer wg.Done()
-			MyLog()
-		})
-		wg.Wait()
-	})
-
-	// Output: No request id found
-	// My request id is: 12345
-}
-
-func BenchmarkGetValue(b *testing.B) {
-	mgr := NewContextManager()
-	mgr.SetValues(Values{"test_key": "test_val"}, func() {
-		b.ResetTimer()
-		for i := 0; i < b.N; i++ {
-			val, ok := mgr.GetValue("test_key")
-			if !ok || val != "test_val" {
-				b.FailNow()
-			}
-		}
-	})
-}
-
-func BenchmarkSetValues(b *testing.B) {
-	mgr := NewContextManager()
-	for i := 0; i < b.N/2; i++ {
-		mgr.SetValues(Values{"test_key": "test_val"}, func() {
-			mgr.SetValues(Values{"test_key2": "test_val2"}, func() {})
-		})
-	}
-}

+ 0 - 13
Godeps/_workspace/src/github.com/jtolds/gls/gen_sym.go

@@ -1,13 +0,0 @@
-package gls
-
-var (
-	symPool = &idPool{}
-)
-
-// ContextKey is a throwaway value you can use as a key to a ContextManager
-type ContextKey struct{ id uint }
-
-// GenSym will return a brand new, never-before-used ContextKey
-func GenSym() ContextKey {
-	return ContextKey{id: symPool.Acquire()}
-}

+ 0 - 34
Godeps/_workspace/src/github.com/jtolds/gls/id_pool.go

@@ -1,34 +0,0 @@
-package gls
-
-// though this could probably be better at keeping ids smaller, the goal of
-// this class is to keep a registry of the smallest unique integer ids
-// per-process possible
-
-import (
-	"sync"
-)
-
-type idPool struct {
-	mtx      sync.Mutex
-	released []uint
-	max_id   uint
-}
-
-func (p *idPool) Acquire() (id uint) {
-	p.mtx.Lock()
-	defer p.mtx.Unlock()
-	if len(p.released) > 0 {
-		id = p.released[len(p.released)-1]
-		p.released = p.released[:len(p.released)-1]
-		return id
-	}
-	id = p.max_id
-	p.max_id++
-	return id
-}
-
-func (p *idPool) Release(id uint) {
-	p.mtx.Lock()
-	defer p.mtx.Unlock()
-	p.released = append(p.released, id)
-}

+ 0 - 93
Godeps/_workspace/src/github.com/jtolds/gls/stack_tags.go

@@ -1,93 +0,0 @@
-package gls
-
-// so, basically, we're going to encode integer tags in base-16 on the stack
-
-import (
-	"reflect"
-	"runtime"
-)
-
-const (
-	bitWidth = 4
-)
-
-func addStackTag(tag uint, context_call func()) {
-	if context_call == nil {
-		return
-	}
-	markS(tag, context_call)
-}
-
-func markS(tag uint, cb func()) { _m(tag, cb) }
-func mark0(tag uint, cb func()) { _m(tag, cb) }
-func mark1(tag uint, cb func()) { _m(tag, cb) }
-func mark2(tag uint, cb func()) { _m(tag, cb) }
-func mark3(tag uint, cb func()) { _m(tag, cb) }
-func mark4(tag uint, cb func()) { _m(tag, cb) }
-func mark5(tag uint, cb func()) { _m(tag, cb) }
-func mark6(tag uint, cb func()) { _m(tag, cb) }
-func mark7(tag uint, cb func()) { _m(tag, cb) }
-func mark8(tag uint, cb func()) { _m(tag, cb) }
-func mark9(tag uint, cb func()) { _m(tag, cb) }
-func markA(tag uint, cb func()) { _m(tag, cb) }
-func markB(tag uint, cb func()) { _m(tag, cb) }
-func markC(tag uint, cb func()) { _m(tag, cb) }
-func markD(tag uint, cb func()) { _m(tag, cb) }
-func markE(tag uint, cb func()) { _m(tag, cb) }
-func markF(tag uint, cb func()) { _m(tag, cb) }
-
-var pc_lookup = make(map[uintptr]int8, 17)
-var mark_lookup [16]func(uint, func())
-
-func init() {
-	setEntries := func(f func(uint, func()), v int8) {
-		pc_lookup[reflect.ValueOf(f).Pointer()] = v
-		if v >= 0 {
-			mark_lookup[v] = f
-		}
-	}
-	setEntries(markS, -0x1)
-	setEntries(mark0, 0x0)
-	setEntries(mark1, 0x1)
-	setEntries(mark2, 0x2)
-	setEntries(mark3, 0x3)
-	setEntries(mark4, 0x4)
-	setEntries(mark5, 0x5)
-	setEntries(mark6, 0x6)
-	setEntries(mark7, 0x7)
-	setEntries(mark8, 0x8)
-	setEntries(mark9, 0x9)
-	setEntries(markA, 0xa)
-	setEntries(markB, 0xb)
-	setEntries(markC, 0xc)
-	setEntries(markD, 0xd)
-	setEntries(markE, 0xe)
-	setEntries(markF, 0xf)
-}
-
-func _m(tag_remainder uint, cb func()) {
-	if tag_remainder == 0 {
-		cb()
-	} else {
-		mark_lookup[tag_remainder&0xf](tag_remainder>>bitWidth, cb)
-	}
-}
-
-func readStackTags(stack []uintptr) (tags []uint) {
-	var current_tag uint
-	for _, pc := range stack {
-		pc = runtime.FuncForPC(pc).Entry()
-		val, ok := pc_lookup[pc]
-		if !ok {
-			continue
-		}
-		if val < 0 {
-			tags = append(tags, current_tag)
-			current_tag = 0
-			continue
-		}
-		current_tag <<= bitWidth
-		current_tag += uint(val)
-	}
-	return
-}

+ 191 - 0
Godeps/_workspace/src/github.com/macaron-contrib/binding/LICENSE

@@ -0,0 +1,191 @@
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and
+distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright
+owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities
+that control, are controlled by, or are under common control with that entity.
+For the purposes of this definition, "control" means (i) the power, direct or
+indirect, to cause the direction or management of such entity, whether by
+contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
+outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including
+but not limited to software source code, documentation source, and configuration
+files.
+
+"Object" form shall mean any form resulting from mechanical transformation or
+translation of a Source form, including but not limited to compiled object code,
+generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made
+available under the License, as indicated by a copyright notice that is included
+in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that
+is based on (or derived from) the Work and for which the editorial revisions,
+annotations, elaborations, or other modifications represent, as a whole, an
+original work of authorship. For the purposes of this License, Derivative Works
+shall not include works that remain separable from, or merely link (or bind by
+name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version
+of the Work and any modifications or additions to that Work or Derivative Works
+thereof, that is intentionally submitted to Licensor for inclusion in the Work
+by the copyright owner or by an individual or Legal Entity authorized to submit
+on behalf of the copyright owner. For the purposes of this definition,
+"submitted" means any form of electronic, verbal, or written communication sent
+to the Licensor or its representatives, including but not limited to
+communication on electronic mailing lists, source code control systems, and
+issue tracking systems that are managed by, or on behalf of, the Licensor for
+the purpose of discussing and improving the Work, but excluding communication
+that is conspicuously marked or otherwise designated in writing by the copyright
+owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
+of whom a Contribution has been received by Licensor and subsequently
+incorporated within the Work.
+
+2. Grant of Copyright License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the Work and such
+Derivative Works in Source or Object form.
+
+3. Grant of Patent License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable (except as stated in this section) patent license to make, have
+made, use, offer to sell, sell, import, and otherwise transfer the Work, where
+such license applies only to those patent claims licensable by such Contributor
+that are necessarily infringed by their Contribution(s) alone or by combination
+of their Contribution(s) with the Work to which such Contribution(s) was
+submitted. If You institute patent litigation against any entity (including a
+cross-claim or counterclaim in a lawsuit) alleging that the Work or a
+Contribution incorporated within the Work constitutes direct or contributory
+patent infringement, then any patent licenses granted to You under this License
+for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution.
+
+You may reproduce and distribute copies of the Work or Derivative Works thereof
+in any medium, with or without modifications, and in Source or Object form,
+provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of
+this License; and
+You must cause any modified files to carry prominent notices stating that You
+changed the files; and
+You must retain, in the Source form of any Derivative Works that You distribute,
+all copyright, patent, trademark, and attribution notices from the Source form
+of the Work, excluding those notices that do not pertain to any part of the
+Derivative Works; and
+If the Work includes a "NOTICE" text file as part of its distribution, then any
+Derivative Works that You distribute must include a readable copy of the
+attribution notices contained within such NOTICE file, excluding those notices
+that do not pertain to any part of the Derivative Works, in at least one of the
+following places: within a NOTICE text file distributed as part of the
+Derivative Works; within the Source form or documentation, if provided along
+with the Derivative Works; or, within a display generated by the Derivative
+Works, if and wherever such third-party notices normally appear. The contents of
+the NOTICE file are for informational purposes only and do not modify the
+License. You may add Your own attribution notices within Derivative Works that
+You distribute, alongside or as an addendum to the NOTICE text from the Work,
+provided that such additional attribution notices cannot be construed as
+modifying the License.
+You may add Your own copyright statement to Your modifications and may provide
+additional or different license terms and conditions for use, reproduction, or
+distribution of Your modifications, or for any such Derivative Works as a whole,
+provided Your use, reproduction, and distribution of the Work otherwise complies
+with the conditions stated in this License.
+
+5. Submission of Contributions.
+
+Unless You explicitly state otherwise, any Contribution intentionally submitted
+for inclusion in the Work by You to the Licensor shall be under the terms and
+conditions of this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify the terms of
+any separate license agreement you may have executed with Licensor regarding
+such Contributions.
+
+6. Trademarks.
+
+This License does not grant permission to use the trade names, trademarks,
+service marks, or product names of the Licensor, except as required for
+reasonable and customary use in describing the origin of the Work and
+reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+
+Unless required by applicable law or agreed to in writing, Licensor provides the
+Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
+including, without limitation, any warranties or conditions of TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
+solely responsible for determining the appropriateness of using or
+redistributing the Work and assume any risks associated with Your exercise of
+permissions under this License.
+
+8. Limitation of Liability.
+
+In no event and under no legal theory, whether in tort (including negligence),
+contract, or otherwise, unless required by applicable law (such as deliberate
+and grossly negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special, incidental,
+or consequential damages of any character arising as a result of this License or
+out of the use or inability to use the Work (including but not limited to
+damages for loss of goodwill, work stoppage, computer failure or malfunction, or
+any and all other commercial damages or losses), even if such Contributor has
+been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+
+While redistributing the Work or Derivative Works thereof, You may choose to
+offer, and charge a fee for, acceptance of support, warranty, indemnity, or
+other liability obligations and/or rights consistent with this License. However,
+in accepting such obligations, You may act only on Your own behalf and on Your
+sole responsibility, not on behalf of any other Contributor, and only if You
+agree to indemnify, defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason of your
+accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work
+
+To apply the Apache License to your work, attach the following boilerplate
+notice, with the fields enclosed by brackets "[]" replaced with your own
+identifying information. (Don't include the brackets!) The text should be
+enclosed in the appropriate comment syntax for the file format. We also
+recommend that a file or class name and description of purpose be included on
+the same "printed page" as the copyright notice for easier identification within
+third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

+ 21 - 0
Godeps/_workspace/src/github.com/macaron-contrib/binding/README.md

@@ -0,0 +1,21 @@
+binding [![Build Status](https://drone.io/github.com/macaron-contrib/binding/status.png)](https://drone.io/github.com/macaron-contrib/binding/latest) [![](http://gocover.io/_badge/github.com/macaron-contrib/binding)](http://gocover.io/github.com/macaron-contrib/binding)
+=======
+
+Middlware binding provides request data binding and validation for [Macaron](https://github.com/Unknwon/macaron).
+
+### Installation
+
+	go get github.com/macaron-contrib/binding
+	
+## Getting Help
+
+- [API Reference](https://gowalker.org/github.com/macaron-contrib/binding)
+- [Documentation](http://macaron.gogs.io/docs/middlewares/binding)
+
+## Credits
+
+This package is forked from [martini-contrib/binding](https://github.com/martini-contrib/binding) with modifications.
+
+## License
+
+This project is under Apache v2 License. See the [LICENSE](LICENSE) file for the full license text.

+ 57 - 0
Godeps/_workspace/src/github.com/macaron-contrib/binding/bind_test.go

@@ -0,0 +1,57 @@
+// Copyright 2014 martini-contrib/binding Authors
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+package binding
+
+import (
+	"testing"
+
+	. "github.com/smartystreets/goconvey/convey"
+)
+
+func Test_Bind(t *testing.T) {
+	Convey("Bind test", t, func() {
+		Convey("Bind form", func() {
+			for _, testCase := range formTestCases {
+				performFormTest(t, Bind, testCase)
+			}
+		})
+
+		Convey("Bind JSON", func() {
+			for _, testCase := range jsonTestCases {
+				performJsonTest(t, Bind, testCase)
+			}
+		})
+
+		Convey("Bind multipart form", func() {
+			for _, testCase := range multipartFormTestCases {
+				performMultipartFormTest(t, Bind, testCase)
+			}
+		})
+
+		Convey("Bind with file", func() {
+			for _, testCase := range fileTestCases {
+				performFileTest(t, Bind, testCase)
+				performFileTest(t, BindIgnErr, testCase)
+			}
+		})
+	})
+}
+
+func Test_Version(t *testing.T) {
+	Convey("Get package version", t, func() {
+		So(Version(), ShouldEqual, _VERSION)
+	})
+}

+ 620 - 0
Godeps/_workspace/src/github.com/macaron-contrib/binding/binding.go

@@ -0,0 +1,620 @@
+// Copyright 2014 martini-contrib/binding Authors
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+// Package binding is a middleware that provides request data binding and validation for Macaron.
+package binding
+
+import (
+	"encoding/json"
+	"fmt"
+	"io"
+	"mime/multipart"
+	"net/http"
+	"reflect"
+	"regexp"
+	"strconv"
+	"strings"
+	"unicode/utf8"
+
+	"github.com/Unknwon/com"
+	"github.com/Unknwon/macaron"
+)
+
+// NOTE: last sync 1928ed2 on Aug 26, 2014.
+
+const _VERSION = "0.0.4"
+
+func Version() string {
+	return _VERSION
+}
+
+func bind(ctx *macaron.Context, obj interface{}, ifacePtr ...interface{}) {
+	contentType := ctx.Req.Header.Get("Content-Type")
+	if ctx.Req.Method == "POST" || ctx.Req.Method == "PUT" || len(contentType) > 0 {
+		switch {
+		case strings.Contains(contentType, "form-urlencoded"):
+			ctx.Invoke(Form(obj, ifacePtr...))
+		case strings.Contains(contentType, "multipart/form-data"):
+			ctx.Invoke(MultipartForm(obj, ifacePtr...))
+		case strings.Contains(contentType, "json"):
+			ctx.Invoke(Json(obj, ifacePtr...))
+		default:
+			var errors Errors
+			if contentType == "" {
+				errors.Add([]string{}, ERR_CONTENT_TYPE, "Empty Content-Type")
+			} else {
+				errors.Add([]string{}, ERR_CONTENT_TYPE, "Unsupported Content-Type")
+			}
+			ctx.Map(errors)
+		}
+	} else {
+		ctx.Invoke(Form(obj, ifacePtr...))
+	}
+}
+
+const (
+	_JSON_CONTENT_TYPE          = "application/json; charset=utf-8"
+	STATUS_UNPROCESSABLE_ENTITY = 422
+)
+
+// errorHandler simply counts the number of errors in the
+// context and, if more than 0, writes a response with an
+// error code and a JSON payload describing the errors.
+// The response will have a JSON content-type.
+// Middleware remaining on the stack will not even see the request
+// if, by this point, there are any errors.
+// This is a "default" handler, of sorts, and you are
+// welcome to use your own instead. The Bind middleware
+// invokes this automatically for convenience.
+func errorHandler(errs Errors, rw http.ResponseWriter) {
+	if len(errs) > 0 {
+		rw.Header().Set("Content-Type", _JSON_CONTENT_TYPE)
+		if errs.Has(ERR_DESERIALIZATION) {
+			rw.WriteHeader(http.StatusBadRequest)
+		} else if errs.Has(ERR_CONTENT_TYPE) {
+			rw.WriteHeader(http.StatusUnsupportedMediaType)
+		} else {
+			rw.WriteHeader(STATUS_UNPROCESSABLE_ENTITY)
+		}
+		errOutput, _ := json.Marshal(errs)
+		rw.Write(errOutput)
+		return
+	}
+}
+
+// Bind wraps up the functionality of the Form and Json middleware
+// according to the Content-Type and verb of the request.
+// A Content-Type is required for POST and PUT requests.
+// Bind invokes the ErrorHandler middleware to bail out if errors
+// occurred. If you want to perform your own error handling, use
+// Form or Json middleware directly. An interface pointer can
+// be added as a second argument in order to map the struct to
+// a specific interface.
+func Bind(obj interface{}, ifacePtr ...interface{}) macaron.Handler {
+	return func(ctx *macaron.Context) {
+		bind(ctx, obj, ifacePtr...)
+		if handler, ok := obj.(ErrorHandler); ok {
+			ctx.Invoke(handler.Error)
+		} else {
+			ctx.Invoke(errorHandler)
+		}
+	}
+}
+
+// BindIgnErr will do the exactly same thing as Bind but without any
+// error handling, which user has freedom to deal with them.
+// This allows user take advantages of validation.
+func BindIgnErr(obj interface{}, ifacePtr ...interface{}) macaron.Handler {
+	return func(ctx *macaron.Context) {
+		bind(ctx, obj, ifacePtr...)
+	}
+}
+
+// Form is middleware to deserialize form-urlencoded data from the request.
+// It gets data from the form-urlencoded body, if present, or from the
+// query string. It uses the http.Request.ParseForm() method
+// to perform deserialization, then reflection is used to map each field
+// into the struct with the proper type. Structs with primitive slice types
+// (bool, float, int, string) can support deserialization of repeated form
+// keys, for example: key=val1&key=val2&key=val3
+// An interface pointer can be added as a second argument in order
+// to map the struct to a specific interface.
+func Form(formStruct interface{}, ifacePtr ...interface{}) macaron.Handler {
+	return func(ctx *macaron.Context) {
+		var errors Errors
+
+		ensureNotPointer(formStruct)
+		formStruct := reflect.New(reflect.TypeOf(formStruct))
+		parseErr := ctx.Req.ParseForm()
+
+		// Format validation of the request body or the URL would add considerable overhead,
+		// and ParseForm does not complain when URL encoding is off.
+		// Because an empty request body or url can also mean absence of all needed values,
+		// it is not in all cases a bad request, so let's return 422.
+		if parseErr != nil {
+			errors.Add([]string{}, ERR_DESERIALIZATION, parseErr.Error())
+		}
+		mapForm(formStruct, ctx.Req.Form, nil, errors)
+		validateAndMap(formStruct, ctx, errors, ifacePtr...)
+	}
+}
+
+// Maximum amount of memory to use when parsing a multipart form.
+// Set this to whatever value you prefer; default is 10 MB.
+var MaxMemory = int64(1024 * 1024 * 10)
+
+// MultipartForm works much like Form, except it can parse multipart forms
+// and handle file uploads. Like the other deserialization middleware handlers,
+// you can pass in an interface to make the interface available for injection
+// into other handlers later.
+func MultipartForm(formStruct interface{}, ifacePtr ...interface{}) macaron.Handler {
+	return func(ctx *macaron.Context) {
+		var errors Errors
+		ensureNotPointer(formStruct)
+		formStruct := reflect.New(reflect.TypeOf(formStruct))
+		// This if check is necessary due to https://github.com/martini-contrib/csrf/issues/6
+		if ctx.Req.MultipartForm == nil {
+			// Workaround for multipart forms returning nil instead of an error
+			// when content is not multipart; see https://code.google.com/p/go/issues/detail?id=6334
+			if multipartReader, err := ctx.Req.MultipartReader(); err != nil {
+				errors.Add([]string{}, ERR_DESERIALIZATION, err.Error())
+			} else {
+				form, parseErr := multipartReader.ReadForm(MaxMemory)
+				if parseErr != nil {
+					errors.Add([]string{}, ERR_DESERIALIZATION, parseErr.Error())
+				}
+				ctx.Req.MultipartForm = form
+			}
+		}
+		mapForm(formStruct, ctx.Req.MultipartForm.Value, ctx.Req.MultipartForm.File, errors)
+		validateAndMap(formStruct, ctx, errors, ifacePtr...)
+	}
+}
+
+// Json is middleware to deserialize a JSON payload from the request
+// into the struct that is passed in. The resulting struct is then
+// validated, but no error handling is actually performed here.
+// An interface pointer can be added as a second argument in order
+// to map the struct to a specific interface.
+func Json(jsonStruct interface{}, ifacePtr ...interface{}) macaron.Handler {
+	return func(ctx *macaron.Context) {
+		var errors Errors
+		ensureNotPointer(jsonStruct)
+		jsonStruct := reflect.New(reflect.TypeOf(jsonStruct))
+		if ctx.Req.Request.Body != nil {
+			defer ctx.Req.Request.Body.Close()
+			err := json.NewDecoder(ctx.Req.Request.Body).Decode(jsonStruct.Interface())
+			if err != nil && err != io.EOF {
+				errors.Add([]string{}, ERR_DESERIALIZATION, err.Error())
+			}
+		}
+		validateAndMap(jsonStruct, ctx, errors, ifacePtr...)
+	}
+}
+
+// Validate is middleware to enforce required fields. If the struct
+// passed in implements Validator, then the user-defined Validate method
+// is executed, and its errors are mapped to the context. This middleware
+// performs no error handling: it merely detects errors and maps them.
+func Validate(obj interface{}) macaron.Handler {
+	return func(ctx *macaron.Context) {
+		var errors Errors
+		v := reflect.ValueOf(obj)
+		k := v.Kind()
+		if k == reflect.Interface || k == reflect.Ptr {
+			v = v.Elem()
+			k = v.Kind()
+		}
+		if k == reflect.Slice || k == reflect.Array {
+			for i := 0; i < v.Len(); i++ {
+				e := v.Index(i).Interface()
+				errors = validateStruct(errors, e)
+				if validator, ok := e.(Validator); ok {
+					errors = validator.Validate(ctx, errors)
+				}
+			}
+		} else {
+			errors = validateStruct(errors, obj)
+			if validator, ok := obj.(Validator); ok {
+				errors = validator.Validate(ctx, errors)
+			}
+		}
+		ctx.Map(errors)
+	}
+}
+
+var (
+	alphaDashPattern    = regexp.MustCompile("[^\\d\\w-_]")
+	alphaDashDotPattern = regexp.MustCompile("[^\\d\\w-_\\.]")
+	emailPattern        = regexp.MustCompile("[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w](?:[\\w-]*[\\w])?\\.)+[a-zA-Z0-9](?:[\\w-]*[\\w])?")
+	urlPattern          = regexp.MustCompile(`(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?`)
+)
+
+type (
+	// Rule represents a validation rule.
+	Rule struct {
+		// IsMatch checks if rule matches.
+		IsMatch func(string) bool
+		// IsValid applies validation rule to condition.
+		IsValid func(Errors, string, interface{}) bool
+	}
+	// RuleMapper represents a validation rule mapper,
+	// it allwos users to add custom validation rules.
+	RuleMapper []*Rule
+)
+
+var ruleMapper RuleMapper
+
+// AddRule adds new validation rule.
+func AddRule(r *Rule) {
+	ruleMapper = append(ruleMapper, r)
+}
+
+func in(fieldValue interface{}, arr string) bool {
+	val := fmt.Sprintf("%v", fieldValue)
+	vals := strings.Split(arr, ",")
+	isIn := false
+	for _, v := range vals {
+		if v == val {
+			isIn = true
+			break
+		}
+	}
+	return isIn
+}
+
+func parseFormName(raw, actual string) string {
+	if len(actual) > 0 {
+		return actual
+	}
+	return nameMapper(raw)
+}
+
+// Performs required field checking on a struct
+func validateStruct(errors Errors, obj interface{}) Errors {
+	typ := reflect.TypeOf(obj)
+	val := reflect.ValueOf(obj)
+
+	if typ.Kind() == reflect.Ptr {
+		typ = typ.Elem()
+		val = val.Elem()
+	}
+
+	for i := 0; i < typ.NumField(); i++ {
+		field := typ.Field(i)
+
+		// Allow ignored fields in the struct
+		if field.Tag.Get("form") == "-" || !val.Field(i).CanInterface() {
+			continue
+		}
+
+		fieldVal := val.Field(i)
+		fieldValue := fieldVal.Interface()
+		zero := reflect.Zero(field.Type).Interface()
+
+		// Validate nested and embedded structs (if pointer, only do so if not nil)
+		if field.Type.Kind() == reflect.Struct ||
+			(field.Type.Kind() == reflect.Ptr && !reflect.DeepEqual(zero, fieldValue) &&
+				field.Type.Elem().Kind() == reflect.Struct) {
+			errors = validateStruct(errors, fieldValue)
+		}
+
+	VALIDATE_RULES:
+		for _, rule := range strings.Split(field.Tag.Get("binding"), ";") {
+			if len(rule) == 0 {
+				continue
+			}
+
+			switch {
+			case rule == "Required":
+				if reflect.DeepEqual(zero, fieldValue) {
+					errors.Add([]string{field.Name}, ERR_REQUIRED, "Required")
+					break VALIDATE_RULES
+				}
+			case rule == "AlphaDash":
+				if alphaDashPattern.MatchString(fmt.Sprintf("%v", fieldValue)) {
+					errors.Add([]string{field.Name}, ERR_ALPHA_DASH, "AlphaDash")
+					break VALIDATE_RULES
+				}
+			case rule == "AlphaDashDot":
+				if alphaDashDotPattern.MatchString(fmt.Sprintf("%v", fieldValue)) {
+					errors.Add([]string{field.Name}, ERR_ALPHA_DASH_DOT, "AlphaDashDot")
+					break VALIDATE_RULES
+				}
+			case strings.HasPrefix(rule, "MinSize("):
+				min, _ := strconv.Atoi(rule[8 : len(rule)-1])
+				if str, ok := fieldValue.(string); ok && utf8.RuneCountInString(str) < min {
+					errors.Add([]string{field.Name}, ERR_MIN_SIZE, "MinSize")
+					break VALIDATE_RULES
+				}
+				v := reflect.ValueOf(fieldValue)
+				if v.Kind() == reflect.Slice && v.Len() < min {
+					errors.Add([]string{field.Name}, ERR_MIN_SIZE, "MinSize")
+					break VALIDATE_RULES
+				}
+			case strings.HasPrefix(rule, "MaxSize("):
+				max, _ := strconv.Atoi(rule[8 : len(rule)-1])
+				if str, ok := fieldValue.(string); ok && utf8.RuneCountInString(str) > max {
+					errors.Add([]string{field.Name}, ERR_MAX_SIZE, "MaxSize")
+					break VALIDATE_RULES
+				}
+				v := reflect.ValueOf(fieldValue)
+				if v.Kind() == reflect.Slice && v.Len() > max {
+					errors.Add([]string{field.Name}, ERR_MAX_SIZE, "MaxSize")
+					break VALIDATE_RULES
+				}
+			case strings.HasPrefix(rule, "Range("):
+				nums := strings.Split(rule[6:len(rule)-1], ",")
+				if len(nums) != 2 {
+					break VALIDATE_RULES
+				}
+				val := com.StrTo(fmt.Sprintf("%v", fieldValue)).MustInt()
+				if val < com.StrTo(nums[0]).MustInt() || val > com.StrTo(nums[1]).MustInt() {
+					errors.Add([]string{field.Name}, ERR_RANGE, "Range")
+					break VALIDATE_RULES
+				}
+			case rule == "Email":
+				if !emailPattern.MatchString(fmt.Sprintf("%v", fieldValue)) {
+					errors.Add([]string{field.Name}, ERR_EMAIL, "Email")
+					break VALIDATE_RULES
+				}
+			case rule == "Url":
+				str := fmt.Sprintf("%v", fieldValue)
+				if len(str) == 0 {
+					continue
+				} else if !urlPattern.MatchString(str) {
+					errors.Add([]string{field.Name}, ERR_URL, "Url")
+					break VALIDATE_RULES
+				}
+			case strings.HasPrefix(rule, "In("):
+				if !in(fieldValue, rule[3:len(rule)-1]) {
+					errors.Add([]string{field.Name}, ERR_IN, "In")
+					break VALIDATE_RULES
+				}
+			case strings.HasPrefix(rule, "NotIn("):
+				if in(fieldValue, rule[6:len(rule)-1]) {
+					errors.Add([]string{field.Name}, ERR_NOT_INT, "NotIn")
+					break VALIDATE_RULES
+				}
+			case strings.HasPrefix(rule, "Include("):
+				if !strings.Contains(fmt.Sprintf("%v", fieldValue), rule[8:len(rule)-1]) {
+					errors.Add([]string{field.Name}, ERR_INCLUDE, "Include")
+					break VALIDATE_RULES
+				}
+			case strings.HasPrefix(rule, "Exclude("):
+				if strings.Contains(fmt.Sprintf("%v", fieldValue), rule[8:len(rule)-1]) {
+					errors.Add([]string{field.Name}, ERR_EXCLUDE, "Exclude")
+					break VALIDATE_RULES
+				}
+			case strings.HasPrefix(rule, "Default("):
+				if reflect.DeepEqual(zero, fieldValue) {
+					if fieldVal.CanAddr() {
+						setWithProperType(field.Type.Kind(), rule[8:len(rule)-1], fieldVal, field.Tag.Get("form"), errors)
+					} else {
+						errors.Add([]string{field.Name}, ERR_EXCLUDE, "Default")
+						break VALIDATE_RULES
+					}
+				}
+			default:
+				// Apply custom validation rules.
+				for i := range ruleMapper {
+					if ruleMapper[i].IsMatch(rule) && !ruleMapper[i].IsValid(errors, field.Name, fieldValue) {
+						break VALIDATE_RULES
+					}
+				}
+			}
+		}
+	}
+	return errors
+}
+
+// NameMapper represents a form/json tag name mapper.
+type NameMapper func(string) string
+
+var (
+	nameMapper = func(field string) string {
+		newstr := make([]rune, 0, 10)
+		for i, chr := range field {
+			if isUpper := 'A' <= chr && chr <= 'Z'; isUpper {
+				if i > 0 {
+					newstr = append(newstr, '_')
+				}
+				chr -= ('A' - 'a')
+			}
+			newstr = append(newstr, chr)
+		}
+		return string(newstr)
+	}
+)
+
+// SetNameMapper sets name mapper.
+func SetNameMapper(nm NameMapper) {
+	nameMapper = nm
+}
+
+// Takes values from the form data and puts them into a struct
+func mapForm(formStruct reflect.Value, form map[string][]string,
+	formfile map[string][]*multipart.FileHeader, errors Errors) {
+
+	if formStruct.Kind() == reflect.Ptr {
+		formStruct = formStruct.Elem()
+	}
+	typ := formStruct.Type()
+
+	for i := 0; i < typ.NumField(); i++ {
+		typeField := typ.Field(i)
+		structField := formStruct.Field(i)
+
+		if typeField.Type.Kind() == reflect.Ptr && typeField.Anonymous {
+			structField.Set(reflect.New(typeField.Type.Elem()))
+			mapForm(structField.Elem(), form, formfile, errors)
+			if reflect.DeepEqual(structField.Elem().Interface(), reflect.Zero(structField.Elem().Type()).Interface()) {
+				structField.Set(reflect.Zero(structField.Type()))
+			}
+		} else if typeField.Type.Kind() == reflect.Struct {
+			mapForm(structField, form, formfile, errors)
+		}
+
+		inputFieldName := parseFormName(typeField.Name, typeField.Tag.Get("form"))
+		if len(inputFieldName) > 0 {
+			if !structField.CanSet() {
+				continue
+			}
+
+			inputValue, exists := form[inputFieldName]
+			if exists {
+				numElems := len(inputValue)
+				if structField.Kind() == reflect.Slice && numElems > 0 {
+					sliceOf := structField.Type().Elem().Kind()
+					slice := reflect.MakeSlice(structField.Type(), numElems, numElems)
+					for i := 0; i < numElems; i++ {
+						setWithProperType(sliceOf, inputValue[i], slice.Index(i), inputFieldName, errors)
+					}
+					formStruct.Field(i).Set(slice)
+				} else {
+					setWithProperType(typeField.Type.Kind(), inputValue[0], structField, inputFieldName, errors)
+				}
+				continue
+			}
+
+			inputFile, exists := formfile[inputFieldName]
+			if !exists {
+				continue
+			}
+			fhType := reflect.TypeOf((*multipart.FileHeader)(nil))
+			numElems := len(inputFile)
+			if structField.Kind() == reflect.Slice && numElems > 0 && structField.Type().Elem() == fhType {
+				slice := reflect.MakeSlice(structField.Type(), numElems, numElems)
+				for i := 0; i < numElems; i++ {
+					slice.Index(i).Set(reflect.ValueOf(inputFile[i]))
+				}
+				structField.Set(slice)
+			} else if structField.Type() == fhType {
+				structField.Set(reflect.ValueOf(inputFile[0]))
+			}
+		}
+	}
+}
+
+// This sets the value in a struct of an indeterminate type to the
+// matching value from the request (via Form middleware) in the
+// same type, so that not all deserialized values have to be strings.
+// Supported types are string, int, float, and bool.
+func setWithProperType(valueKind reflect.Kind, val string, structField reflect.Value, nameInTag string, errors Errors) {
+	switch valueKind {
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+		if val == "" {
+			val = "0"
+		}
+		intVal, err := strconv.ParseInt(val, 10, 64)
+		if err != nil {
+			errors.Add([]string{nameInTag}, ERR_INTERGER_TYPE, "Value could not be parsed as integer")
+		} else {
+			structField.SetInt(intVal)
+		}
+	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+		if val == "" {
+			val = "0"
+		}
+		uintVal, err := strconv.ParseUint(val, 10, 64)
+		if err != nil {
+			errors.Add([]string{nameInTag}, ERR_INTERGER_TYPE, "Value could not be parsed as unsigned integer")
+		} else {
+			structField.SetUint(uintVal)
+		}
+	case reflect.Bool:
+		if val == "on" {
+			structField.SetBool(true)
+			return
+		}
+
+		if val == "" {
+			val = "false"
+		}
+		boolVal, err := strconv.ParseBool(val)
+		if err != nil {
+			errors.Add([]string{nameInTag}, ERR_BOOLEAN_TYPE, "Value could not be parsed as boolean")
+		} else if boolVal {
+			structField.SetBool(true)
+		}
+	case reflect.Float32:
+		if val == "" {
+			val = "0.0"
+		}
+		floatVal, err := strconv.ParseFloat(val, 32)
+		if err != nil {
+			errors.Add([]string{nameInTag}, ERR_FLOAT_TYPE, "Value could not be parsed as 32-bit float")
+		} else {
+			structField.SetFloat(floatVal)
+		}
+	case reflect.Float64:
+		if val == "" {
+			val = "0.0"
+		}
+		floatVal, err := strconv.ParseFloat(val, 64)
+		if err != nil {
+			errors.Add([]string{nameInTag}, ERR_FLOAT_TYPE, "Value could not be parsed as 64-bit float")
+		} else {
+			structField.SetFloat(floatVal)
+		}
+	case reflect.String:
+		structField.SetString(val)
+	}
+}
+
+// Don't pass in pointers to bind to. Can lead to bugs.
+func ensureNotPointer(obj interface{}) {
+	if reflect.TypeOf(obj).Kind() == reflect.Ptr {
+		panic("Pointers are not accepted as binding models")
+	}
+}
+
+// Performs validation and combines errors from validation
+// with errors from deserialization, then maps both the
+// resulting struct and the errors to the context.
+func validateAndMap(obj reflect.Value, ctx *macaron.Context, errors Errors, ifacePtr ...interface{}) {
+	ctx.Invoke(Validate(obj.Interface()))
+	errors = append(errors, getErrors(ctx)...)
+	ctx.Map(errors)
+	ctx.Map(obj.Elem().Interface())
+	if len(ifacePtr) > 0 {
+		ctx.MapTo(obj.Elem().Interface(), ifacePtr[0])
+	}
+}
+
+// getErrors simply gets the errors from the context (it's kind of a chore)
+func getErrors(ctx *macaron.Context) Errors {
+	return ctx.GetVal(reflect.TypeOf(Errors{})).Interface().(Errors)
+}
+
+type (
+	// ErrorHandler is the interface that has custom error handling process.
+	ErrorHandler interface {
+		// Error handles validation errors with custom process.
+		Error(*macaron.Context, Errors)
+	}
+
+	// Validator is the interface that handles some rudimentary
+	// request validation logic so your application doesn't have to.
+	Validator interface {
+		// Validate validates that the request is OK. It is recommended
+		// that validation be limited to checking values for syntax and
+		// semantics, enough to know that you can make sense of the request
+		// in your application. For example, you might verify that a credit
+		// card number matches a valid pattern, but you probably wouldn't
+		// perform an actual credit card authorization here.
+		Validate(*macaron.Context, Errors) Errors
+	}
+)

+ 115 - 0
Godeps/_workspace/src/github.com/macaron-contrib/binding/common_test.go

@@ -0,0 +1,115 @@
+// Copyright 2014 martini-contrib/binding Authors
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+package binding
+
+import (
+	"mime/multipart"
+
+	"github.com/Unknwon/macaron"
+)
+
+// These types are mostly contrived examples, but they're used
+// across many test cases. The idea is to cover all the scenarios
+// that this binding package might encounter in actual use.
+type (
+	// For basic test cases with a required field
+	Post struct {
+		Title   string `form:"title" json:"title" binding:"Required"`
+		Content string `form:"content" json:"content"`
+	}
+
+	// To be used as a nested struct (with a required field)
+	Person struct {
+		Name  string `form:"name" json:"name" binding:"Required"`
+		Email string `form:"email" json:"email"`
+	}
+
+	// For advanced test cases: multiple values, embedded
+	// and nested structs, an ignored field, and single
+	// and multiple file uploads
+	BlogPost struct {
+		Post
+		Id          int     `binding:"Required"` // JSON not specified here for test coverage
+		Ignored     string  `form:"-" json:"-"`
+		Ratings     []int   `form:"rating" json:"ratings"`
+		Author      Person  `json:"author"`
+		Coauthor    *Person `json:"coauthor"`
+		HeaderImage *multipart.FileHeader
+		Pictures    []*multipart.FileHeader `form:"picture"`
+		unexported  string                  `form:"unexported"`
+	}
+
+	EmbedPerson struct {
+		*Person
+	}
+
+	SadForm struct {
+		AlphaDash    string   `form:"AlphaDash" binding:"AlphaDash"`
+		AlphaDashDot string   `form:"AlphaDashDot" binding:"AlphaDashDot"`
+		MinSize      string   `form:"MinSize" binding:"MinSize(5)"`
+		MinSizeSlice []string `form:"MinSizeSlice" binding:"MinSize(5)"`
+		MaxSize      string   `form:"MaxSize" binding:"MaxSize(1)"`
+		MaxSizeSlice []string `form:"MaxSizeSlice" binding:"MaxSize(1)"`
+		Range        int      `form:"Range" binding:"Range(1,2)"`
+		RangeInvalid int      `form:"RangeInvalid" binding:"Range(1)"`
+		Email        string   `binding:"Email"`
+		Url          string   `form:"Url" binding:"Url"`
+		UrlEmpty     string   `form:"UrlEmpty" binding:"Url"`
+		In           string   `form:"In" binding:"Default(0);In(1,2,3)"`
+		InInvalid    string   `form:"InInvalid" binding:"In(1,2,3)"`
+		NotIn        string   `form:"NotIn" binding:"NotIn(1,2,3)"`
+		Include      string   `form:"Include" binding:"Include(a)"`
+		Exclude      string   `form:"Exclude" binding:"Exclude(a)"`
+	}
+
+	CustomErrorHandle struct {
+		Rule `binding:"CustomRule"`
+	}
+
+	// The common function signature of the handlers going under test.
+	handlerFunc func(interface{}, ...interface{}) macaron.Handler
+
+	// Used for testing mapping an interface to the context
+	// If used (withInterface = true in the testCases), a modeler
+	// should be mapped to the context as well as BlogPost, meaning
+	// you can receive a modeler in your application instead of a
+	// concrete BlogPost.
+	modeler interface {
+		Model() string
+	}
+)
+
+func (p Post) Validate(ctx *macaron.Context, errs Errors) Errors {
+	if len(p.Title) < 10 {
+		errs = append(errs, Error{
+			FieldNames:     []string{"title"},
+			Classification: "LengthError",
+			Message:        "Life is too short",
+		})
+	}
+	return errs
+}
+
+func (p Post) Model() string {
+	return p.Title
+}
+
+func (_ CustomErrorHandle) Error(_ *macaron.Context, _ Errors) {}
+
+const (
+	testRoute       = "/test"
+	formContentType = "application/x-www-form-urlencoded"
+)

+ 162 - 0
Godeps/_workspace/src/github.com/macaron-contrib/binding/errorhandler_test.go

@@ -0,0 +1,162 @@
+// Copyright 2014 martini-contrib/binding Authors
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+package binding
+
+import (
+	"io/ioutil"
+	"net/http"
+	"net/http/httptest"
+	"testing"
+
+	. "github.com/smartystreets/goconvey/convey"
+)
+
+var errorTestCases = []errorTestCase{
+	{
+		description: "No errors",
+		errors:      Errors{},
+		expected: errorTestResult{
+			statusCode: http.StatusOK,
+		},
+	},
+	{
+		description: "Deserialization error",
+		errors: Errors{
+			{
+				Classification: ERR_DESERIALIZATION,
+				Message:        "Some parser error here",
+			},
+		},
+		expected: errorTestResult{
+			statusCode:  http.StatusBadRequest,
+			contentType: _JSON_CONTENT_TYPE,
+			body:        `[{"classification":"DeserializationError","message":"Some parser error here"}]`,
+		},
+	},
+	{
+		description: "Content-Type error",
+		errors: Errors{
+			{
+				Classification: ERR_CONTENT_TYPE,
+				Message:        "Empty Content-Type",
+			},
+		},
+		expected: errorTestResult{
+			statusCode:  http.StatusUnsupportedMediaType,
+			contentType: _JSON_CONTENT_TYPE,
+			body:        `[{"classification":"ContentTypeError","message":"Empty Content-Type"}]`,
+		},
+	},
+	{
+		description: "Requirement error",
+		errors: Errors{
+			{
+				FieldNames:     []string{"some_field"},
+				Classification: ERR_REQUIRED,
+				Message:        "Required",
+			},
+		},
+		expected: errorTestResult{
+			statusCode:  STATUS_UNPROCESSABLE_ENTITY,
+			contentType: _JSON_CONTENT_TYPE,
+			body:        `[{"fieldNames":["some_field"],"classification":"RequiredError","message":"Required"}]`,
+		},
+	},
+	{
+		description: "Bad header error",
+		errors: Errors{
+			{
+				Classification: "HeaderError",
+				Message:        "The X-Something header must be specified",
+			},
+		},
+		expected: errorTestResult{
+			statusCode:  STATUS_UNPROCESSABLE_ENTITY,
+			contentType: _JSON_CONTENT_TYPE,
+			body:        `[{"classification":"HeaderError","message":"The X-Something header must be specified"}]`,
+		},
+	},
+	{
+		description: "Custom field error",
+		errors: Errors{
+			{
+				FieldNames:     []string{"month", "year"},
+				Classification: "DateError",
+				Message:        "The month and year must be in the future",
+			},
+		},
+		expected: errorTestResult{
+			statusCode:  STATUS_UNPROCESSABLE_ENTITY,
+			contentType: _JSON_CONTENT_TYPE,
+			body:        `[{"fieldNames":["month","year"],"classification":"DateError","message":"The month and year must be in the future"}]`,
+		},
+	},
+	{
+		description: "Multiple errors",
+		errors: Errors{
+			{
+				FieldNames:     []string{"foo"},
+				Classification: ERR_REQUIRED,
+				Message:        "Required",
+			},
+			{
+				FieldNames:     []string{"foo"},
+				Classification: "LengthError",
+				Message:        "The length of the 'foo' field is too short",
+			},
+		},
+		expected: errorTestResult{
+			statusCode:  STATUS_UNPROCESSABLE_ENTITY,
+			contentType: _JSON_CONTENT_TYPE,
+			body:        `[{"fieldNames":["foo"],"classification":"RequiredError","message":"Required"},{"fieldNames":["foo"],"classification":"LengthError","message":"The length of the 'foo' field is too short"}]`,
+		},
+	},
+}
+
+func Test_ErrorHandler(t *testing.T) {
+	Convey("Error handler", t, func() {
+		for _, testCase := range errorTestCases {
+			performErrorTest(t, testCase)
+		}
+	})
+}
+
+func performErrorTest(t *testing.T, testCase errorTestCase) {
+	resp := httptest.NewRecorder()
+
+	errorHandler(testCase.errors, resp)
+
+	So(resp.Code, ShouldEqual, testCase.expected.statusCode)
+	So(resp.Header().Get("Content-Type"), ShouldEqual, testCase.expected.contentType)
+
+	actualBody, err := ioutil.ReadAll(resp.Body)
+	So(err, ShouldBeNil)
+	So(string(actualBody), ShouldEqual, testCase.expected.body)
+}
+
+type (
+	errorTestCase struct {
+		description string
+		errors      Errors
+		expected    errorTestResult
+	}
+
+	errorTestResult struct {
+		statusCode  int
+		contentType string
+		body        string
+	}
+)

+ 158 - 0
Godeps/_workspace/src/github.com/macaron-contrib/binding/errors.go

@@ -0,0 +1,158 @@
+// Copyright 2014 martini-contrib/binding Authors
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+package binding
+
+const (
+	// Type mismatch errors.
+	ERR_CONTENT_TYPE    = "ContentTypeError"
+	ERR_DESERIALIZATION = "DeserializationError"
+	ERR_INTERGER_TYPE   = "IntegerTypeError"
+	ERR_BOOLEAN_TYPE    = "BooleanTypeError"
+	ERR_FLOAT_TYPE      = "FloatTypeError"
+
+	// Validation errors.
+	ERR_REQUIRED       = "RequiredError"
+	ERR_ALPHA_DASH     = "AlphaDashError"
+	ERR_ALPHA_DASH_DOT = "AlphaDashDotError"
+	ERR_MIN_SIZE       = "MinSizeError"
+	ERR_MAX_SIZE       = "MaxSizeError"
+	ERR_RANGE          = "RangeError"
+	ERR_EMAIL          = "EmailError"
+	ERR_URL            = "UrlError"
+	ERR_IN             = "InError"
+	ERR_NOT_INT        = "NotInError"
+	ERR_INCLUDE        = "IncludeError"
+	ERR_EXCLUDE        = "ExcludeError"
+	ERR_DEFAULT        = "DefaultError"
+)
+
+type (
+	// Errors may be generated during deserialization, binding,
+	// or validation. This type is mapped to the context so you
+	// can inject it into your own handlers and use it in your
+	// application if you want all your errors to look the same.
+	Errors []Error
+
+	Error struct {
+		// An error supports zero or more field names, because an
+		// error can morph three ways: (1) it can indicate something
+		// wrong with the request as a whole, (2) it can point to a
+		// specific problem with a particular input field, or (3) it
+		// can span multiple related input fields.
+		FieldNames []string `json:"fieldNames,omitempty"`
+
+		// The classification is like an error code, convenient to
+		// use when processing or categorizing an error programmatically.
+		// It may also be called the "kind" of error.
+		Classification string `json:"classification,omitempty"`
+
+		// Message should be human-readable and detailed enough to
+		// pinpoint and resolve the problem, but it should be brief. For
+		// example, a payload of 100 objects in a JSON array might have
+		// an error in the 41st object. The message should help the
+		// end user find and fix the error with their request.
+		Message string `json:"message,omitempty"`
+	}
+)
+
+// Add adds an error associated with the fields indicated
+// by fieldNames, with the given classification and message.
+func (e *Errors) Add(fieldNames []string, classification, message string) {
+	*e = append(*e, Error{
+		FieldNames:     fieldNames,
+		Classification: classification,
+		Message:        message,
+	})
+}
+
+// Len returns the number of errors.
+func (e *Errors) Len() int {
+	return len(*e)
+}
+
+// Has determines whether an Errors slice has an Error with
+// a given classification in it; it does not search on messages
+// or field names.
+func (e *Errors) Has(class string) bool {
+	for _, err := range *e {
+		if err.Kind() == class {
+			return true
+		}
+	}
+	return false
+}
+
+/*
+// WithClass gets a copy of errors that are classified by the
+// the given classification.
+func (e *Errors) WithClass(classification string) Errors {
+	var errs Errors
+	for _, err := range *e {
+		if err.Kind() == classification {
+			errs = append(errs, err)
+		}
+	}
+	return errs
+}
+
+// ForField gets a copy of errors that are associated with the
+// field by the given name.
+func (e *Errors) ForField(name string) Errors {
+	var errs Errors
+	for _, err := range *e {
+		for _, fieldName := range err.Fields() {
+			if fieldName == name {
+				errs = append(errs, err)
+				break
+			}
+		}
+	}
+	return errs
+}
+
+// Get gets errors of a particular class for the specified
+// field name.
+func (e *Errors) Get(class, fieldName string) Errors {
+	var errs Errors
+	for _, err := range *e {
+		if err.Kind() == class {
+			for _, nameOfField := range err.Fields() {
+				if nameOfField == fieldName {
+					errs = append(errs, err)
+					break
+				}
+			}
+		}
+	}
+	return errs
+}
+*/
+
+// Fields returns the list of field names this error is
+// associated with.
+func (e Error) Fields() []string {
+	return e.FieldNames
+}
+
+// Kind returns this error's classification.
+func (e Error) Kind() string {
+	return e.Classification
+}
+
+// Error returns this error's message.
+func (e Error) Error() string {
+	return e.Message
+}

+ 115 - 0
Godeps/_workspace/src/github.com/macaron-contrib/binding/errors_test.go

@@ -0,0 +1,115 @@
+// Copyright 2014 martini-contrib/binding Authors
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+package binding
+
+import (
+	"fmt"
+	"testing"
+
+	. "github.com/smartystreets/goconvey/convey"
+)
+
+func Test_ErrorsAdd(t *testing.T) {
+	Convey("Add new error", t, func() {
+		var actual Errors
+		expected := Errors{
+			Error{
+				FieldNames:     []string{"Field1", "Field2"},
+				Classification: "ErrorClass",
+				Message:        "Some message",
+			},
+		}
+
+		actual.Add(expected[0].FieldNames, expected[0].Classification, expected[0].Message)
+
+		So(len(actual), ShouldEqual, 1)
+		So(fmt.Sprintf("%#v", actual), ShouldEqual, fmt.Sprintf("%#v", expected))
+	})
+}
+
+func Test_ErrorsLen(t *testing.T) {
+	Convey("Get number of errors", t, func() {
+		So(errorsTestSet.Len(), ShouldEqual, len(errorsTestSet))
+	})
+}
+
+func Test_ErrorsHas(t *testing.T) {
+	Convey("Check error class", t, func() {
+		So(errorsTestSet.Has("ClassA"), ShouldBeTrue)
+		So(errorsTestSet.Has("ClassQ"), ShouldBeFalse)
+	})
+}
+
+func Test_ErrorGetters(t *testing.T) {
+	Convey("Get error detail", t, func() {
+		err := Error{
+			FieldNames:     []string{"field1", "field2"},
+			Classification: "ErrorClass",
+			Message:        "The message",
+		}
+
+		fieldsActual := err.Fields()
+
+		So(len(fieldsActual), ShouldEqual, 2)
+		So(fieldsActual[0], ShouldEqual, "field1")
+		So(fieldsActual[1], ShouldEqual, "field2")
+
+		So(err.Kind(), ShouldEqual, "ErrorClass")
+		So(err.Error(), ShouldEqual, "The message")
+	})
+}
+
+/*
+func TestErrorsWithClass(t *testing.T) {
+	expected := Errors{
+		errorsTestSet[0],
+		errorsTestSet[3],
+	}
+	actualStr := fmt.Sprintf("%#v", errorsTestSet.WithClass("ClassA"))
+	expectedStr := fmt.Sprintf("%#v", expected)
+	if actualStr != expectedStr {
+		t.Errorf("Expected:\n%s\nbut got:\n%s", expectedStr, actualStr)
+	}
+}
+*/
+
+var errorsTestSet = Errors{
+	Error{
+		FieldNames:     []string{},
+		Classification: "ClassA",
+		Message:        "Foobar",
+	},
+	Error{
+		FieldNames:     []string{},
+		Classification: "ClassB",
+		Message:        "Foo",
+	},
+	Error{
+		FieldNames:     []string{"field1", "field2"},
+		Classification: "ClassB",
+		Message:        "Foobar",
+	},
+	Error{
+		FieldNames:     []string{"field2"},
+		Classification: "ClassA",
+		Message:        "Foobar",
+	},
+	Error{
+		FieldNames:     []string{"field2"},
+		Classification: "ClassB",
+		Message:        "Foobar",
+	},
+}

+ 191 - 0
Godeps/_workspace/src/github.com/macaron-contrib/binding/file_test.go

@@ -0,0 +1,191 @@
+// Copyright 2014 martini-contrib/binding Authors
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+package binding
+
+import (
+	"bytes"
+	"mime/multipart"
+	"net/http"
+	"net/http/httptest"
+	"testing"
+
+	"github.com/Unknwon/macaron"
+	. "github.com/smartystreets/goconvey/convey"
+)
+
+var fileTestCases = []fileTestCase{
+	{
+		description: "Single file",
+		singleFile: &fileInfo{
+			fileName: "message.txt",
+			data:     "All your binding are belong to us",
+		},
+	},
+	{
+		description: "Multiple files",
+		multipleFiles: []*fileInfo{
+			&fileInfo{
+				fileName: "cool-gopher-fact.txt",
+				data:     "Did you know? https://plus.google.com/+MatthewHolt/posts/GmVfd6TPJ51",
+			},
+			&fileInfo{
+				fileName: "gophercon2014.txt",
+				data:     "@bradfitz has a Go time machine: https://twitter.com/mholt6/status/459463953395875840",
+			},
+		},
+	},
+	{
+		description: "Single file and multiple files",
+		singleFile: &fileInfo{
+			fileName: "social media.txt",
+			data:     "Hey, you should follow @mholt6 (Twitter) or +MatthewHolt (Google+)",
+		},
+		multipleFiles: []*fileInfo{
+			&fileInfo{
+				fileName: "thank you!",
+				data:     "Also, thanks to all the contributors of this package!",
+			},
+			&fileInfo{
+				fileName: "btw...",
+				data:     "This tool translates JSON into Go structs: http://mholt.github.io/json-to-go/",
+			},
+		},
+	},
+}
+
+func Test_FileUploads(t *testing.T) {
+	Convey("Test file upload", t, func() {
+		for _, testCase := range fileTestCases {
+			performFileTest(t, MultipartForm, testCase)
+		}
+	})
+}
+
+func performFileTest(t *testing.T, binder handlerFunc, testCase fileTestCase) {
+	httpRecorder := httptest.NewRecorder()
+	m := macaron.Classic()
+
+	fileTestHandler := func(actual BlogPost, errs Errors) {
+		assertFileAsExpected(t, testCase, actual.HeaderImage, testCase.singleFile)
+		So(len(testCase.multipleFiles), ShouldEqual, len(actual.Pictures))
+
+		for i, expectedFile := range testCase.multipleFiles {
+			if i >= len(actual.Pictures) {
+				break
+			}
+			assertFileAsExpected(t, testCase, actual.Pictures[i], expectedFile)
+		}
+	}
+
+	m.Post(testRoute, binder(BlogPost{}), func(actual BlogPost, errs Errors) {
+		fileTestHandler(actual, errs)
+	})
+
+	m.ServeHTTP(httpRecorder, buildRequestWithFile(testCase))
+
+	switch httpRecorder.Code {
+	case http.StatusNotFound:
+		panic("Routing is messed up in test fixture (got 404): check methods and paths")
+	case http.StatusInternalServerError:
+		panic("Something bad happened on '" + testCase.description + "'")
+	}
+}
+
+func assertFileAsExpected(t *testing.T, testCase fileTestCase, actual *multipart.FileHeader, expected *fileInfo) {
+	if expected == nil && actual == nil {
+		return
+	}
+
+	if expected != nil && actual == nil {
+		So(actual, ShouldNotBeNil)
+		return
+	} else if expected == nil && actual != nil {
+		So(actual, ShouldBeNil)
+		return
+	}
+
+	So(actual.Filename, ShouldEqual, expected.fileName)
+	So(unpackFileHeaderData(actual), ShouldEqual, expected.data)
+}
+
+func buildRequestWithFile(testCase fileTestCase) *http.Request {
+	b := &bytes.Buffer{}
+	w := multipart.NewWriter(b)
+
+	if testCase.singleFile != nil {
+		formFileSingle, err := w.CreateFormFile("header_image", testCase.singleFile.fileName)
+		if err != nil {
+			panic("Could not create FormFile (single file): " + err.Error())
+		}
+		formFileSingle.Write([]byte(testCase.singleFile.data))
+	}
+
+	for _, file := range testCase.multipleFiles {
+		formFileMultiple, err := w.CreateFormFile("picture", file.fileName)
+		if err != nil {
+			panic("Could not create FormFile (multiple files): " + err.Error())
+		}
+		formFileMultiple.Write([]byte(file.data))
+	}
+
+	err := w.Close()
+	if err != nil {
+		panic("Could not close multipart writer: " + err.Error())
+	}
+
+	req, err := http.NewRequest("POST", testRoute, b)
+	if err != nil {
+		panic("Could not create file upload request: " + err.Error())
+	}
+
+	req.Header.Set("Content-Type", w.FormDataContentType())
+
+	return req
+}
+
+func unpackFileHeaderData(fh *multipart.FileHeader) string {
+	if fh == nil {
+		return ""
+	}
+
+	f, err := fh.Open()
+	if err != nil {
+		panic("Could not open file header:" + err.Error())
+	}
+	defer f.Close()
+
+	var fb bytes.Buffer
+	_, err = fb.ReadFrom(f)
+	if err != nil {
+		panic("Could not read from file header:" + err.Error())
+	}
+
+	return fb.String()
+}
+
+type (
+	fileTestCase struct {
+		description   string
+		input         BlogPost
+		singleFile    *fileInfo
+		multipleFiles []*fileInfo
+	}
+
+	fileInfo struct {
+		fileName string
+		data     string
+	}
+)

+ 282 - 0
Godeps/_workspace/src/github.com/macaron-contrib/binding/form_test.go

@@ -0,0 +1,282 @@
+// Copyright 2014 martini-contrib/binding Authors
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+package binding
+
+import (
+	"fmt"
+	"net/http"
+	"net/http/httptest"
+	"reflect"
+	"strings"
+	"testing"
+
+	"github.com/Unknwon/macaron"
+	. "github.com/smartystreets/goconvey/convey"
+)
+
+var formTestCases = []formTestCase{
+	{
+		description:   "Happy path",
+		shouldSucceed: true,
+		payload:       `title=Glorious+Post+Title&content=Lorem+ipsum+dolor+sit+amet`,
+		contentType:   formContentType,
+		expected:      Post{Title: "Glorious Post Title", Content: "Lorem ipsum dolor sit amet"},
+	},
+	{
+		description:   "Happy path with interface",
+		shouldSucceed: true,
+		withInterface: true,
+		payload:       `title=Glorious+Post+Title&content=Lorem+ipsum+dolor+sit+amet`,
+		contentType:   formContentType,
+		expected:      Post{Title: "Glorious Post Title", Content: "Lorem ipsum dolor sit amet"},
+	},
+	{
+		description:   "Empty payload",
+		shouldSucceed: false,
+		payload:       ``,
+		contentType:   formContentType,
+		expected:      Post{},
+	},
+	{
+		description:   "Empty content type",
+		shouldSucceed: false,
+		payload:       `title=Glorious+Post+Title&content=Lorem+ipsum+dolor+sit+amet`,
+		contentType:   ``,
+		expected:      Post{},
+	},
+	{
+		description:   "Malformed form body",
+		shouldSucceed: false,
+		payload:       `title=%2`,
+		contentType:   formContentType,
+		expected:      Post{},
+	},
+	{
+		description:   "With nested and embedded structs",
+		shouldSucceed: true,
+		payload:       `title=Glorious+Post+Title&id=1&name=Matt+Holt`,
+		contentType:   formContentType,
+		expected:      BlogPost{Post: Post{Title: "Glorious Post Title"}, Id: 1, Author: Person{Name: "Matt Holt"}},
+	},
+	{
+		description:   "Required embedded struct field not specified",
+		shouldSucceed: false,
+		payload:       `id=1&name=Matt+Holt`,
+		contentType:   formContentType,
+		expected:      BlogPost{Id: 1, Author: Person{Name: "Matt Holt"}},
+	},
+	{
+		description:   "Required nested struct field not specified",
+		shouldSucceed: false,
+		payload:       `title=Glorious+Post+Title&id=1`,
+		contentType:   formContentType,
+		expected:      BlogPost{Post: Post{Title: "Glorious Post Title"}, Id: 1},
+	},
+	{
+		description:   "Multiple values into slice",
+		shouldSucceed: true,
+		payload:       `title=Glorious+Post+Title&id=1&name=Matt+Holt&rating=4&rating=3&rating=5`,
+		contentType:   formContentType,
+		expected:      BlogPost{Post: Post{Title: "Glorious Post Title"}, Id: 1, Author: Person{Name: "Matt Holt"}, Ratings: []int{4, 3, 5}},
+	},
+	{
+		description:   "Unexported field",
+		shouldSucceed: true,
+		payload:       `title=Glorious+Post+Title&id=1&name=Matt+Holt&unexported=foo`,
+		contentType:   formContentType,
+		expected:      BlogPost{Post: Post{Title: "Glorious Post Title"}, Id: 1, Author: Person{Name: "Matt Holt"}},
+	},
+	{
+		description:   "Query string POST",
+		shouldSucceed: true,
+		payload:       `title=Glorious+Post+Title&content=Lorem+ipsum+dolor+sit+amet`,
+		contentType:   formContentType,
+		expected:      Post{Title: "Glorious Post Title", Content: "Lorem ipsum dolor sit amet"},
+	},
+	{
+		description:   "Query string with Content-Type (POST request)",
+		shouldSucceed: true,
+		queryString:   "?title=Glorious+Post+Title&content=Lorem+ipsum+dolor+sit+amet",
+		payload:       ``,
+		contentType:   formContentType,
+		expected:      Post{Title: "Glorious Post Title", Content: "Lorem ipsum dolor sit amet"},
+	},
+	{
+		description:   "Query string without Content-Type (GET request)",
+		shouldSucceed: true,
+		method:        "GET",
+		queryString:   "?title=Glorious+Post+Title&content=Lorem+ipsum+dolor+sit+amet",
+		payload:       ``,
+		expected:      Post{Title: "Glorious Post Title", Content: "Lorem ipsum dolor sit amet"},
+	},
+	{
+		description:   "Embed struct pointer",
+		shouldSucceed: true,
+		deepEqual:     true,
+		method:        "GET",
+		queryString:   "?name=Glorious+Post+Title&email=Lorem+ipsum+dolor+sit+amet",
+		payload:       ``,
+		expected:      EmbedPerson{&Person{Name: "Glorious Post Title", Email: "Lorem ipsum dolor sit amet"}},
+	},
+	{
+		description:   "Embed struct pointer remain nil if not binded",
+		shouldSucceed: true,
+		deepEqual:     true,
+		method:        "GET",
+		queryString:   "?",
+		payload:       ``,
+		expected:      EmbedPerson{nil},
+	},
+	{
+		description:   "Custom error handler",
+		shouldSucceed: true,
+		deepEqual:     true,
+		method:        "GET",
+		queryString:   "?",
+		payload:       ``,
+		expected:      CustomErrorHandle{},
+	},
+}
+
+func init() {
+	AddRule(&Rule{
+		func(rule string) bool {
+			return rule == "CustomRule"
+		},
+		func(_ Errors, _ string, _ interface{}) bool {
+			return false
+		},
+	})
+	SetNameMapper(nameMapper)
+}
+
+func Test_Form(t *testing.T) {
+	Convey("Test form", t, func() {
+		for _, testCase := range formTestCases {
+			performFormTest(t, Form, testCase)
+		}
+	})
+}
+
+func performFormTest(t *testing.T, binder handlerFunc, testCase formTestCase) {
+	resp := httptest.NewRecorder()
+	m := macaron.Classic()
+
+	formTestHandler := func(actual interface{}, errs Errors) {
+		if testCase.shouldSucceed && len(errs) > 0 {
+			So(len(errs), ShouldEqual, 0)
+		} else if !testCase.shouldSucceed && len(errs) == 0 {
+			So(len(errs), ShouldNotEqual, 0)
+		}
+		expString := fmt.Sprintf("%+v", testCase.expected)
+		actString := fmt.Sprintf("%+v", actual)
+		if actString != expString && !(testCase.deepEqual && reflect.DeepEqual(testCase.expected, actual)) {
+			So(actString, ShouldEqual, expString)
+		}
+	}
+
+	switch testCase.expected.(type) {
+	case Post:
+		if testCase.withInterface {
+			m.Post(testRoute, binder(Post{}, (*modeler)(nil)), func(actual Post, iface modeler, errs Errors) {
+				So(actual.Title, ShouldEqual, iface.Model())
+				formTestHandler(actual, errs)
+			})
+		} else {
+			m.Post(testRoute, binder(Post{}), func(actual Post, errs Errors) {
+				formTestHandler(actual, errs)
+			})
+			m.Get(testRoute, binder(Post{}), func(actual Post, errs Errors) {
+				formTestHandler(actual, errs)
+			})
+		}
+
+	case BlogPost:
+		if testCase.withInterface {
+			m.Post(testRoute, binder(BlogPost{}, (*modeler)(nil)), func(actual BlogPost, iface modeler, errs Errors) {
+				So(actual.Title, ShouldEqual, iface.Model())
+				formTestHandler(actual, errs)
+			})
+		} else {
+			m.Post(testRoute, binder(BlogPost{}), func(actual BlogPost, errs Errors) {
+				formTestHandler(actual, errs)
+			})
+		}
+
+	case EmbedPerson:
+		m.Post(testRoute, binder(EmbedPerson{}), func(actual EmbedPerson, errs Errors) {
+			formTestHandler(actual, errs)
+		})
+		m.Get(testRoute, binder(EmbedPerson{}), func(actual EmbedPerson, errs Errors) {
+			formTestHandler(actual, errs)
+		})
+	case CustomErrorHandle:
+		m.Get(testRoute, binder(CustomErrorHandle{}), func(actual CustomErrorHandle, errs Errors) {
+			formTestHandler(actual, errs)
+		})
+	}
+
+	if len(testCase.method) == 0 {
+		testCase.method = "POST"
+	}
+
+	req, err := http.NewRequest(testCase.method, testRoute+testCase.queryString, strings.NewReader(testCase.payload))
+	if err != nil {
+		panic(err)
+	}
+	req.Header.Set("Content-Type", testCase.contentType)
+
+	m.ServeHTTP(resp, req)
+
+	switch resp.Code {
+	case http.StatusNotFound:
+		panic("Routing is messed up in test fixture (got 404): check methods and paths")
+	case http.StatusInternalServerError:
+		panic("Something bad happened on '" + testCase.description + "'")
+	}
+}
+
+type (
+	formTestCase struct {
+		description   string
+		shouldSucceed bool
+		deepEqual     bool
+		withInterface bool
+		queryString   string
+		payload       string
+		contentType   string
+		expected      interface{}
+		method        string
+	}
+)
+
+type defaultForm struct {
+	Default string `binding:"Default(hello world)"`
+}
+
+func Test_Default(t *testing.T) {
+	Convey("Test default value", t, func() {
+		m := macaron.Classic()
+		m.Get("/", Bind(defaultForm{}), func(f defaultForm) {
+			So(f.Default, ShouldEqual, "hello world")
+		})
+		resp := httptest.NewRecorder()
+		req, err := http.NewRequest("GET", "/", nil)
+		So(err, ShouldBeNil)
+
+		m.ServeHTTP(resp, req)
+	})
+}

+ 222 - 0
Godeps/_workspace/src/github.com/macaron-contrib/binding/json_test.go

@@ -0,0 +1,222 @@
+// Copyright 2014 martini-contrib/binding Authors
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+package binding
+
+import (
+	"fmt"
+	"io"
+	"net/http"
+	"net/http/httptest"
+	"strings"
+	"testing"
+
+	"github.com/Unknwon/macaron"
+	. "github.com/smartystreets/goconvey/convey"
+)
+
+var jsonTestCases = []jsonTestCase{
+	{
+		description:         "Happy path",
+		shouldSucceedOnJson: true,
+		payload:             `{"title": "Glorious Post Title", "content": "Lorem ipsum dolor sit amet"}`,
+		contentType:         _JSON_CONTENT_TYPE,
+		expected:            Post{Title: "Glorious Post Title", Content: "Lorem ipsum dolor sit amet"},
+	},
+	{
+		description:         "Happy path with interface",
+		shouldSucceedOnJson: true,
+		withInterface:       true,
+		payload:             `{"title": "Glorious Post Title", "content": "Lorem ipsum dolor sit amet"}`,
+		contentType:         _JSON_CONTENT_TYPE,
+		expected:            Post{Title: "Glorious Post Title", Content: "Lorem ipsum dolor sit amet"},
+	},
+	{
+		description:         "Nil payload",
+		shouldSucceedOnJson: false,
+		payload:             `-nil-`,
+		contentType:         _JSON_CONTENT_TYPE,
+		expected:            Post{},
+	},
+	{
+		description:         "Empty payload",
+		shouldSucceedOnJson: false,
+		payload:             ``,
+		contentType:         _JSON_CONTENT_TYPE,
+		expected:            Post{},
+	},
+	{
+		description:         "Empty content type",
+		shouldSucceedOnJson: true,
+		shouldFailOnBind:    true,
+		payload:             `{"title": "Glorious Post Title", "content": "Lorem ipsum dolor sit amet"}`,
+		contentType:         ``,
+		expected:            Post{Title: "Glorious Post Title", Content: "Lorem ipsum dolor sit amet"},
+	},
+	{
+		description:         "Unsupported content type",
+		shouldSucceedOnJson: true,
+		shouldFailOnBind:    true,
+		payload:             `{"title": "Glorious Post Title", "content": "Lorem ipsum dolor sit amet"}`,
+		contentType:         `BoGuS`,
+		expected:            Post{Title: "Glorious Post Title", Content: "Lorem ipsum dolor sit amet"},
+	},
+	{
+		description:         "Malformed JSON",
+		shouldSucceedOnJson: false,
+		payload:             `{"title":"foo"`,
+		contentType:         _JSON_CONTENT_TYPE,
+		expected:            Post{},
+	},
+	{
+		description:         "Deserialization with nested and embedded struct",
+		shouldSucceedOnJson: true,
+		payload:             `{"title":"Glorious Post Title", "id":1, "author":{"name":"Matt Holt"}}`,
+		contentType:         _JSON_CONTENT_TYPE,
+		expected:            BlogPost{Post: Post{Title: "Glorious Post Title"}, Id: 1, Author: Person{Name: "Matt Holt"}},
+	},
+	{
+		description:         "Deserialization with nested and embedded struct with interface",
+		shouldSucceedOnJson: true,
+		withInterface:       true,
+		payload:             `{"title":"Glorious Post Title", "id":1, "author":{"name":"Matt Holt"}}`,
+		contentType:         _JSON_CONTENT_TYPE,
+		expected:            BlogPost{Post: Post{Title: "Glorious Post Title"}, Id: 1, Author: Person{Name: "Matt Holt"}},
+	},
+	{
+		description:         "Required nested struct field not specified",
+		shouldSucceedOnJson: false,
+		payload:             `{"title":"Glorious Post Title", "id":1, "author":{}}`,
+		contentType:         _JSON_CONTENT_TYPE,
+		expected:            BlogPost{Post: Post{Title: "Glorious Post Title"}, Id: 1},
+	},
+	{
+		description:         "Required embedded struct field not specified",
+		shouldSucceedOnJson: false,
+		payload:             `{"id":1, "author":{"name":"Matt Holt"}}`,
+		contentType:         _JSON_CONTENT_TYPE,
+		expected:            BlogPost{Id: 1, Author: Person{Name: "Matt Holt"}},
+	},
+	{
+		description:         "Slice of Posts",
+		shouldSucceedOnJson: true,
+		payload:             `[{"title": "First Post"}, {"title": "Second Post"}]`,
+		contentType:         _JSON_CONTENT_TYPE,
+		expected:            []Post{Post{Title: "First Post"}, Post{Title: "Second Post"}},
+	},
+}
+
+func Test_Json(t *testing.T) {
+	Convey("Test JSON", t, func() {
+		for _, testCase := range jsonTestCases {
+			performJsonTest(t, Json, testCase)
+		}
+	})
+}
+
+func performJsonTest(t *testing.T, binder handlerFunc, testCase jsonTestCase) {
+	var payload io.Reader
+	httpRecorder := httptest.NewRecorder()
+	m := macaron.Classic()
+
+	jsonTestHandler := func(actual interface{}, errs Errors) {
+		if testCase.shouldSucceedOnJson && len(errs) > 0 {
+			So(len(errs), ShouldEqual, 0)
+		} else if !testCase.shouldSucceedOnJson && len(errs) == 0 {
+			So(len(errs), ShouldNotEqual, 0)
+		}
+		So(fmt.Sprintf("%+v", actual), ShouldEqual, fmt.Sprintf("%+v", testCase.expected))
+	}
+
+	switch testCase.expected.(type) {
+	case []Post:
+		if testCase.withInterface {
+			m.Post(testRoute, binder([]Post{}, (*modeler)(nil)), func(actual []Post, iface modeler, errs Errors) {
+
+				for _, a := range actual {
+					So(a.Title, ShouldEqual, iface.Model())
+					jsonTestHandler(a, errs)
+				}
+			})
+		} else {
+			m.Post(testRoute, binder([]Post{}), func(actual []Post, errs Errors) {
+				jsonTestHandler(actual, errs)
+			})
+		}
+
+	case Post:
+		if testCase.withInterface {
+			m.Post(testRoute, binder(Post{}, (*modeler)(nil)), func(actual Post, iface modeler, errs Errors) {
+				So(actual.Title, ShouldEqual, iface.Model())
+				jsonTestHandler(actual, errs)
+			})
+		} else {
+			m.Post(testRoute, binder(Post{}), func(actual Post, errs Errors) {
+				jsonTestHandler(actual, errs)
+			})
+		}
+
+	case BlogPost:
+		if testCase.withInterface {
+			m.Post(testRoute, binder(BlogPost{}, (*modeler)(nil)), func(actual BlogPost, iface modeler, errs Errors) {
+				So(actual.Title, ShouldEqual, iface.Model())
+				jsonTestHandler(actual, errs)
+			})
+		} else {
+			m.Post(testRoute, binder(BlogPost{}), func(actual BlogPost, errs Errors) {
+				jsonTestHandler(actual, errs)
+			})
+		}
+	}
+
+	if testCase.payload == "-nil-" {
+		payload = nil
+	} else {
+		payload = strings.NewReader(testCase.payload)
+	}
+
+	req, err := http.NewRequest("POST", testRoute, payload)
+	if err != nil {
+		panic(err)
+	}
+	req.Header.Set("Content-Type", testCase.contentType)
+
+	m.ServeHTTP(httpRecorder, req)
+
+	switch httpRecorder.Code {
+	case http.StatusNotFound:
+		panic("Routing is messed up in test fixture (got 404): check method and path")
+	case http.StatusInternalServerError:
+		panic("Something bad happened on '" + testCase.description + "'")
+	default:
+		if testCase.shouldSucceedOnJson &&
+			httpRecorder.Code != http.StatusOK &&
+			!testCase.shouldFailOnBind {
+			So(httpRecorder.Code, ShouldEqual, http.StatusOK)
+		}
+	}
+}
+
+type (
+	jsonTestCase struct {
+		description         string
+		withInterface       bool
+		shouldSucceedOnJson bool
+		shouldFailOnBind    bool
+		payload             string
+		contentType         string
+		expected            interface{}
+	}
+)

+ 118 - 0
Godeps/_workspace/src/github.com/macaron-contrib/binding/misc_test.go

@@ -0,0 +1,118 @@
+// Copyright 2014 martini-contrib/binding Authors
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+package binding
+
+import (
+	"fmt"
+	"net/http"
+	"net/http/httptest"
+	"strings"
+	"testing"
+
+	"github.com/Unknwon/macaron"
+	. "github.com/smartystreets/goconvey/convey"
+)
+
+// When binding from Form data, testing the type of data to bind
+// and converting a string into that type is tedious, so these tests
+// cover all those cases.
+func Test_SetWithProperType(t *testing.T) {
+	Convey("Set with proper type", t, func() {
+		testInputs := map[string]string{
+			"successful": `integer=-1&integer8=-8&integer16=-16&integer32=-32&integer64=-64&uinteger=1&uinteger8=8&uinteger16=16&uinteger32=32&uinteger64=64&boolean_1=true&fl32_1=32.3232&fl64_1=-64.6464646464&str=string`,
+			"errorful":   `integer=&integer8=asdf&integer16=--&integer32=&integer64=dsf&uinteger=&uinteger8=asdf&uinteger16=+&uinteger32= 32 &uinteger64=+%20+&boolean_1=&boolean_2=asdf&fl32_1=asdf&fl32_2=&fl64_1=&fl64_2=asdfstr`,
+		}
+
+		expectedOutputs := map[string]Everything{
+			"successful": Everything{
+				Integer:    -1,
+				Integer8:   -8,
+				Integer16:  -16,
+				Integer32:  -32,
+				Integer64:  -64,
+				Uinteger:   1,
+				Uinteger8:  8,
+				Uinteger16: 16,
+				Uinteger32: 32,
+				Uinteger64: 64,
+				Boolean_1:  true,
+				Fl32_1:     32.3232,
+				Fl64_1:     -64.6464646464,
+				Str:        "string",
+			},
+			"errorful": Everything{},
+		}
+
+		for key, testCase := range testInputs {
+			httpRecorder := httptest.NewRecorder()
+			m := macaron.Classic()
+
+			m.Post(testRoute, Form(Everything{}), func(actual Everything, errs Errors) {
+				So(fmt.Sprintf("%+v", actual), ShouldEqual, fmt.Sprintf("%+v", expectedOutputs[key]))
+			})
+			req, err := http.NewRequest("POST", testRoute, strings.NewReader(testCase))
+			if err != nil {
+				panic(err)
+			}
+			req.Header.Set("Content-Type", formContentType)
+			m.ServeHTTP(httpRecorder, req)
+		}
+	})
+}
+
+// Each binder middleware should assert that the struct passed in is not
+// a pointer (to avoid race conditions)
+func Test_EnsureNotPointer(t *testing.T) {
+	Convey("Ensure field is not a pointer", t, func() {
+		shouldPanic := func() {
+			defer func() {
+				So(recover(), ShouldNotBeNil)
+			}()
+			ensureNotPointer(&Post{})
+		}
+
+		shouldNotPanic := func() {
+			defer func() {
+				So(recover(), ShouldBeNil)
+			}()
+			ensureNotPointer(Post{})
+		}
+
+		shouldPanic()
+		shouldNotPanic()
+	})
+}
+
+// Used in testing setWithProperType; kind of clunky...
+type Everything struct {
+	Integer    int     `form:"integer"`
+	Integer8   int8    `form:"integer8"`
+	Integer16  int16   `form:"integer16"`
+	Integer32  int32   `form:"integer32"`
+	Integer64  int64   `form:"integer64"`
+	Uinteger   uint    `form:"uinteger"`
+	Uinteger8  uint8   `form:"uinteger8"`
+	Uinteger16 uint16  `form:"uinteger16"`
+	Uinteger32 uint32  `form:"uinteger32"`
+	Uinteger64 uint64  `form:"uinteger64"`
+	Boolean_1  bool    `form:"boolean_1"`
+	Boolean_2  bool    `form:"boolean_2"`
+	Fl32_1     float32 `form:"fl32_1"`
+	Fl32_2     float32 `form:"fl32_2"`
+	Fl64_1     float64 `form:"fl64_1"`
+	Fl64_2     float64 `form:"fl64_2"`
+	Str        string  `form:"str"`
+}

+ 155 - 0
Godeps/_workspace/src/github.com/macaron-contrib/binding/multipart_test.go

@@ -0,0 +1,155 @@
+// Copyright 2014 martini-contrib/binding Authors
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+package binding
+
+import (
+	"bytes"
+	"fmt"
+	"mime/multipart"
+	"net/http"
+	"net/http/httptest"
+	"strconv"
+	"testing"
+
+	"github.com/Unknwon/macaron"
+	. "github.com/smartystreets/goconvey/convey"
+)
+
+var multipartFormTestCases = []multipartFormTestCase{
+	{
+		description:      "Happy multipart form path",
+		shouldSucceed:    true,
+		inputAndExpected: BlogPost{Post: Post{Title: "Glorious Post Title"}, Id: 1, Author: Person{Name: "Matt Holt"}},
+	},
+	{
+		description:         "FormValue called before req.MultipartReader(); see https://github.com/martini-contrib/csrf/issues/6",
+		shouldSucceed:       true,
+		callFormValueBefore: true,
+		inputAndExpected:    BlogPost{Post: Post{Title: "Glorious Post Title"}, Id: 1, Author: Person{Name: "Matt Holt"}},
+	},
+	{
+		description:      "Empty payload",
+		shouldSucceed:    false,
+		inputAndExpected: BlogPost{},
+	},
+	{
+		description:      "Missing required field (Id)",
+		shouldSucceed:    false,
+		inputAndExpected: BlogPost{Post: Post{Title: "Glorious Post Title"}, Author: Person{Name: "Matt Holt"}},
+	},
+	{
+		description:      "Required embedded struct field not specified",
+		shouldSucceed:    false,
+		inputAndExpected: BlogPost{Id: 1, Author: Person{Name: "Matt Holt"}},
+	},
+	{
+		description:      "Required nested struct field not specified",
+		shouldSucceed:    false,
+		inputAndExpected: BlogPost{Post: Post{Title: "Glorious Post Title"}, Id: 1},
+	},
+	{
+		description:      "Multiple values",
+		shouldSucceed:    true,
+		inputAndExpected: BlogPost{Post: Post{Title: "Glorious Post Title"}, Id: 1, Author: Person{Name: "Matt Holt"}, Ratings: []int{3, 5, 4}},
+	},
+	{
+		description:     "Bad multipart encoding",
+		shouldSucceed:   false,
+		malformEncoding: true,
+	},
+}
+
+func Test_MultipartForm(t *testing.T) {
+	Convey("Test multipart form", t, func() {
+		for _, testCase := range multipartFormTestCases {
+			performMultipartFormTest(t, MultipartForm, testCase)
+		}
+	})
+}
+
+func performMultipartFormTest(t *testing.T, binder handlerFunc, testCase multipartFormTestCase) {
+	httpRecorder := httptest.NewRecorder()
+	m := macaron.Classic()
+
+	m.Post(testRoute, binder(BlogPost{}), func(actual BlogPost, errs Errors) {
+		if testCase.shouldSucceed && len(errs) > 0 {
+			So(len(errs), ShouldEqual, 0)
+		} else if !testCase.shouldSucceed && len(errs) == 0 {
+			So(len(errs), ShouldNotEqual, 0)
+		}
+		So(fmt.Sprintf("%+v", actual), ShouldEqual, fmt.Sprintf("%+v", testCase.inputAndExpected))
+	})
+
+	multipartPayload, mpWriter := makeMultipartPayload(testCase)
+
+	req, err := http.NewRequest("POST", testRoute, multipartPayload)
+	if err != nil {
+		panic(err)
+	}
+
+	req.Header.Add("Content-Type", mpWriter.FormDataContentType())
+
+	err = mpWriter.Close()
+	if err != nil {
+		panic(err)
+	}
+
+	if testCase.callFormValueBefore {
+		req.FormValue("foo")
+	}
+
+	m.ServeHTTP(httpRecorder, req)
+
+	switch httpRecorder.Code {
+	case http.StatusNotFound:
+		panic("Routing is messed up in test fixture (got 404): check methods and paths")
+	case http.StatusInternalServerError:
+		panic("Something bad happened on '" + testCase.description + "'")
+	}
+}
+
+// Writes the input from a test case into a buffer using the multipart writer.
+func makeMultipartPayload(testCase multipartFormTestCase) (*bytes.Buffer, *multipart.Writer) {
+	body := &bytes.Buffer{}
+	writer := multipart.NewWriter(body)
+	if testCase.malformEncoding {
+		// TODO: Break the multipart form parser which is apparently impervious!!
+		// (Get it to return an error. Trying to get 100% test coverage.)
+		body.Write([]byte(`--` + writer.Boundary() + `\nContent-Disposition: form-data; name="foo"\n\n--` + writer.Boundary() + `--`))
+		return body, writer
+	} else {
+		writer.WriteField("title", testCase.inputAndExpected.Title)
+		writer.WriteField("content", testCase.inputAndExpected.Content)
+		writer.WriteField("id", strconv.Itoa(testCase.inputAndExpected.Id))
+		writer.WriteField("ignored", testCase.inputAndExpected.Ignored)
+		for _, value := range testCase.inputAndExpected.Ratings {
+			writer.WriteField("rating", strconv.Itoa(value))
+		}
+		writer.WriteField("name", testCase.inputAndExpected.Author.Name)
+		writer.WriteField("email", testCase.inputAndExpected.Author.Email)
+		return body, writer
+	}
+}
+
+type (
+	multipartFormTestCase struct {
+		description         string
+		shouldSucceed       bool
+		inputAndExpected    BlogPost
+		malformEncoding     bool
+		callFormValueBefore bool
+	}
+)

+ 370 - 0
Godeps/_workspace/src/github.com/macaron-contrib/binding/validate_test.go

@@ -0,0 +1,370 @@
+// Copyright 2014 martini-contrib/binding Authors
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+package binding
+
+import (
+	"fmt"
+	"net/http"
+	"net/http/httptest"
+	"testing"
+
+	"github.com/Unknwon/macaron"
+	. "github.com/smartystreets/goconvey/convey"
+)
+
+var validationTestCases = []validationTestCase{
+	{
+		description: "No errors",
+		data: BlogPost{
+			Id: 1,
+			Post: Post{
+				Title:   "Behold The Title!",
+				Content: "And some content",
+			},
+			Author: Person{
+				Name: "Matt Holt",
+			},
+		},
+		expectedErrors: Errors{},
+	},
+	{
+		description: "ID required",
+		data: BlogPost{
+			Post: Post{
+				Title:   "Behold The Title!",
+				Content: "And some content",
+			},
+			Author: Person{
+				Name: "Matt Holt",
+			},
+		},
+		expectedErrors: Errors{
+			Error{
+				FieldNames:     []string{"id"},
+				Classification: ERR_REQUIRED,
+				Message:        "Required",
+			},
+		},
+	},
+	{
+		description: "Embedded struct field required",
+		data: BlogPost{
+			Id: 1,
+			Post: Post{
+				Content: "Content given, but title is required",
+			},
+			Author: Person{
+				Name: "Matt Holt",
+			},
+		},
+		expectedErrors: Errors{
+			Error{
+				FieldNames:     []string{"title"},
+				Classification: ERR_REQUIRED,
+				Message:        "Required",
+			},
+			Error{
+				FieldNames:     []string{"title"},
+				Classification: "LengthError",
+				Message:        "Life is too short",
+			},
+		},
+	},
+	{
+		description: "Nested struct field required",
+		data: BlogPost{
+			Id: 1,
+			Post: Post{
+				Title:   "Behold The Title!",
+				Content: "And some content",
+			},
+		},
+		expectedErrors: Errors{
+			Error{
+				FieldNames:     []string{"name"},
+				Classification: ERR_REQUIRED,
+				Message:        "Required",
+			},
+		},
+	},
+	{
+		description: "Required field missing in nested struct pointer",
+		data: BlogPost{
+			Id: 1,
+			Post: Post{
+				Title:   "Behold The Title!",
+				Content: "And some content",
+			},
+			Author: Person{
+				Name: "Matt Holt",
+			},
+			Coauthor: &Person{},
+		},
+		expectedErrors: Errors{
+			Error{
+				FieldNames:     []string{"name"},
+				Classification: ERR_REQUIRED,
+				Message:        "Required",
+			},
+		},
+	},
+	{
+		description: "All required fields specified in nested struct pointer",
+		data: BlogPost{
+			Id: 1,
+			Post: Post{
+				Title:   "Behold The Title!",
+				Content: "And some content",
+			},
+			Author: Person{
+				Name: "Matt Holt",
+			},
+			Coauthor: &Person{
+				Name: "Jeremy Saenz",
+			},
+		},
+		expectedErrors: Errors{},
+	},
+	{
+		description: "Custom validation should put an error",
+		data: BlogPost{
+			Id: 1,
+			Post: Post{
+				Title:   "Too short",
+				Content: "And some content",
+			},
+			Author: Person{
+				Name: "Matt Holt",
+			},
+		},
+		expectedErrors: Errors{
+			Error{
+				FieldNames:     []string{"title"},
+				Classification: "LengthError",
+				Message:        "Life is too short",
+			},
+		},
+	},
+	{
+		description: "List Validation",
+		data: []BlogPost{
+			BlogPost{
+				Id: 1,
+				Post: Post{
+					Title:   "First Post",
+					Content: "And some content",
+				},
+				Author: Person{
+					Name: "Leeor Aharon",
+				},
+			},
+			BlogPost{
+				Id: 2,
+				Post: Post{
+					Title:   "Second Post",
+					Content: "And some content",
+				},
+				Author: Person{
+					Name: "Leeor Aharon",
+				},
+			},
+		},
+		expectedErrors: Errors{},
+	},
+	{
+		description: "List Validation w/ Errors",
+		data: []BlogPost{
+			BlogPost{
+				Id: 1,
+				Post: Post{
+					Title:   "First Post",
+					Content: "And some content",
+				},
+				Author: Person{
+					Name: "Leeor Aharon",
+				},
+			},
+			BlogPost{
+				Id: 2,
+				Post: Post{
+					Title:   "Too Short",
+					Content: "And some content",
+				},
+				Author: Person{
+					Name: "Leeor Aharon",
+				},
+			},
+		},
+		expectedErrors: Errors{
+			Error{
+				FieldNames:     []string{"title"},
+				Classification: "LengthError",
+				Message:        "Life is too short",
+			},
+		},
+	},
+	{
+		description: "List of invalid custom validations",
+		data: []SadForm{
+			SadForm{
+				AlphaDash:    ",",
+				AlphaDashDot: ",",
+				MinSize:      ",",
+				MinSizeSlice: []string{",", ","},
+				MaxSize:      ",,",
+				MaxSizeSlice: []string{",", ","},
+				Range:        3,
+				Email:        ",",
+				Url:          ",",
+				UrlEmpty:     "",
+				InInvalid:    "4",
+				NotIn:        "1",
+				Include:      "def",
+				Exclude:      "abc",
+			},
+		},
+		expectedErrors: Errors{
+			Error{
+				FieldNames:     []string{"AlphaDash"},
+				Classification: "AlphaDashError",
+				Message:        "AlphaDash",
+			},
+			Error{
+				FieldNames:     []string{"AlphaDashDot"},
+				Classification: "AlphaDashDot",
+				Message:        "AlphaDashDot",
+			},
+			Error{
+				FieldNames:     []string{"MinSize"},
+				Classification: "MinSize",
+				Message:        "MinSize",
+			},
+			Error{
+				FieldNames:     []string{"MinSize"},
+				Classification: "MinSize",
+				Message:        "MinSize",
+			},
+			Error{
+				FieldNames:     []string{"MaxSize"},
+				Classification: "MaxSize",
+				Message:        "MaxSize",
+			},
+			Error{
+				FieldNames:     []string{"MaxSize"},
+				Classification: "MaxSize",
+				Message:        "MaxSize",
+			},
+			Error{
+				FieldNames:     []string{"Range"},
+				Classification: "Range",
+				Message:        "Range",
+			},
+			Error{
+				FieldNames:     []string{"Email"},
+				Classification: "Email",
+				Message:        "Email",
+			},
+			Error{
+				FieldNames:     []string{"Url"},
+				Classification: "Url",
+				Message:        "Url",
+			},
+			Error{
+				FieldNames:     []string{"Default"},
+				Classification: "Default",
+				Message:        "Default",
+			},
+			Error{
+				FieldNames:     []string{"InInvalid"},
+				Classification: "In",
+				Message:        "In",
+			},
+			Error{
+				FieldNames:     []string{"NotIn"},
+				Classification: "NotIn",
+				Message:        "NotIn",
+			},
+			Error{
+				FieldNames:     []string{"Include"},
+				Classification: "Include",
+				Message:        "Include",
+			},
+			Error{
+				FieldNames:     []string{"Exclude"},
+				Classification: "Exclude",
+				Message:        "Exclude",
+			},
+		},
+	},
+	{
+		description: "List of valid custom validations",
+		data: []SadForm{
+			SadForm{
+				AlphaDash:    "123-456",
+				AlphaDashDot: "123.456",
+				MinSize:      "12345",
+				MinSizeSlice: []string{"1", "2", "3", "4", "5"},
+				MaxSize:      "1",
+				MaxSizeSlice: []string{"1"},
+				Range:        2,
+				In:           "1",
+				InInvalid:    "1",
+				Email:        "123@456.com",
+				Url:          "http://123.456",
+				Include:      "abc",
+			},
+		},
+	},
+}
+
+func Test_Validation(t *testing.T) {
+	Convey("Test validation", t, func() {
+		for _, testCase := range validationTestCases {
+			performValidationTest(t, testCase)
+		}
+	})
+}
+
+func performValidationTest(t *testing.T, testCase validationTestCase) {
+	httpRecorder := httptest.NewRecorder()
+	m := macaron.Classic()
+
+	m.Post(testRoute, Validate(testCase.data), func(actual Errors) {
+		So(fmt.Sprintf("%+v", actual), ShouldEqual, fmt.Sprintf("%+v", testCase.expectedErrors))
+	})
+
+	req, err := http.NewRequest("POST", testRoute, nil)
+	if err != nil {
+		panic(err)
+	}
+
+	m.ServeHTTP(httpRecorder, req)
+
+	switch httpRecorder.Code {
+	case http.StatusNotFound:
+		panic("Routing is messed up in test fixture (got 404): check methods and paths")
+	case http.StatusInternalServerError:
+		panic("Something bad happened on '" + testCase.description + "'")
+	}
+}
+
+type (
+	validationTestCase struct {
+		description    string
+		data           interface{}
+		expectedErrors Errors
+	}
+)

+ 0 - 65
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions.go

@@ -1,65 +0,0 @@
-package convey
-
-import "github.com/smartystreets/goconvey/convey/assertions"
-
-var (
-	ShouldEqual          = assertions.ShouldEqual
-	ShouldNotEqual       = assertions.ShouldNotEqual
-	ShouldAlmostEqual    = assertions.ShouldAlmostEqual
-	ShouldNotAlmostEqual = assertions.ShouldNotAlmostEqual
-	ShouldResemble       = assertions.ShouldResemble
-	ShouldNotResemble    = assertions.ShouldNotResemble
-	ShouldPointTo        = assertions.ShouldPointTo
-	ShouldNotPointTo     = assertions.ShouldNotPointTo
-	ShouldBeNil          = assertions.ShouldBeNil
-	ShouldNotBeNil       = assertions.ShouldNotBeNil
-	ShouldBeTrue         = assertions.ShouldBeTrue
-	ShouldBeFalse        = assertions.ShouldBeFalse
-	ShouldBeZeroValue    = assertions.ShouldBeZeroValue
-
-	ShouldBeGreaterThan          = assertions.ShouldBeGreaterThan
-	ShouldBeGreaterThanOrEqualTo = assertions.ShouldBeGreaterThanOrEqualTo
-	ShouldBeLessThan             = assertions.ShouldBeLessThan
-	ShouldBeLessThanOrEqualTo    = assertions.ShouldBeLessThanOrEqualTo
-	ShouldBeBetween              = assertions.ShouldBeBetween
-	ShouldNotBeBetween           = assertions.ShouldNotBeBetween
-	ShouldBeBetweenOrEqual       = assertions.ShouldBeBetweenOrEqual
-	ShouldNotBeBetweenOrEqual    = assertions.ShouldNotBeBetweenOrEqual
-
-	ShouldContain    = assertions.ShouldContain
-	ShouldNotContain = assertions.ShouldNotContain
-	ShouldBeIn       = assertions.ShouldBeIn
-	ShouldNotBeIn    = assertions.ShouldNotBeIn
-	ShouldBeEmpty    = assertions.ShouldBeEmpty
-	ShouldNotBeEmpty = assertions.ShouldNotBeEmpty
-
-	ShouldStartWith           = assertions.ShouldStartWith
-	ShouldNotStartWith        = assertions.ShouldNotStartWith
-	ShouldEndWith             = assertions.ShouldEndWith
-	ShouldNotEndWith          = assertions.ShouldNotEndWith
-	ShouldBeBlank             = assertions.ShouldBeBlank
-	ShouldNotBeBlank          = assertions.ShouldNotBeBlank
-	ShouldContainSubstring    = assertions.ShouldContainSubstring
-	ShouldNotContainSubstring = assertions.ShouldNotContainSubstring
-
-	ShouldPanic        = assertions.ShouldPanic
-	ShouldNotPanic     = assertions.ShouldNotPanic
-	ShouldPanicWith    = assertions.ShouldPanicWith
-	ShouldNotPanicWith = assertions.ShouldNotPanicWith
-
-	ShouldHaveSameTypeAs    = assertions.ShouldHaveSameTypeAs
-	ShouldNotHaveSameTypeAs = assertions.ShouldNotHaveSameTypeAs
-	ShouldImplement         = assertions.ShouldImplement
-	ShouldNotImplement      = assertions.ShouldNotImplement
-
-	ShouldHappenBefore         = assertions.ShouldHappenBefore
-	ShouldHappenOnOrBefore     = assertions.ShouldHappenOnOrBefore
-	ShouldHappenAfter          = assertions.ShouldHappenAfter
-	ShouldHappenOnOrAfter      = assertions.ShouldHappenOnOrAfter
-	ShouldHappenBetween        = assertions.ShouldHappenBetween
-	ShouldHappenOnOrBetween    = assertions.ShouldHappenOnOrBetween
-	ShouldNotHappenOnOrBetween = assertions.ShouldNotHappenOnOrBetween
-	ShouldHappenWithin         = assertions.ShouldHappenWithin
-	ShouldNotHappenWithin      = assertions.ShouldNotHappenWithin
-	ShouldBeChronological      = assertions.ShouldBeChronological
-)

+ 0 - 3
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/assertions.goconvey

@@ -1,3 +0,0 @@
-#ignore
--timeout=1s
--coverpkg=github.com/smartystreets/goconvey/convey/assertions,github.com/smartystreets/goconvey/convey/assertions/oglematchers

+ 0 - 140
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/collections.go

@@ -1,140 +0,0 @@
-package assertions
-
-import (
-	"fmt"
-	"reflect"
-
-	"github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-)
-
-// ShouldContain receives exactly two parameters. The first is a slice and the
-// second is a proposed member. Membership is determined using ShouldEqual.
-func ShouldContain(actual interface{}, expected ...interface{}) string {
-	if fail := need(1, expected); fail != success {
-		return fail
-	}
-
-	if matchError := oglematchers.Contains(expected[0]).Matches(actual); matchError != nil {
-		typeName := reflect.TypeOf(actual)
-
-		if fmt.Sprintf("%v", matchError) == "which is not a slice or array" {
-			return fmt.Sprintf(shouldHaveBeenAValidCollection, typeName)
-		}
-		return fmt.Sprintf(shouldHaveContained, typeName, expected[0])
-	}
-	return success
-}
-
-// ShouldNotContain receives exactly two parameters. The first is a slice and the
-// second is a proposed member. Membership is determinied using ShouldEqual.
-func ShouldNotContain(actual interface{}, expected ...interface{}) string {
-	if fail := need(1, expected); fail != success {
-		return fail
-	}
-	typeName := reflect.TypeOf(actual)
-
-	if matchError := oglematchers.Contains(expected[0]).Matches(actual); matchError != nil {
-		if fmt.Sprintf("%v", matchError) == "which is not a slice or array" {
-			return fmt.Sprintf(shouldHaveBeenAValidCollection, typeName)
-		}
-		return success
-	}
-	return fmt.Sprintf(shouldNotHaveContained, typeName, expected[0])
-}
-
-// ShouldBeIn receives at least 2 parameters. The first is a proposed member of the collection
-// that is passed in either as the second parameter, or of the collection that is comprised
-// of all the remaining parameters. This assertion ensures that the proposed member is in
-// the collection (using ShouldEqual).
-func ShouldBeIn(actual interface{}, expected ...interface{}) string {
-	if fail := atLeast(1, expected); fail != success {
-		return fail
-	}
-
-	if len(expected) == 1 {
-		return shouldBeIn(actual, expected[0])
-	}
-	return shouldBeIn(actual, expected)
-}
-func shouldBeIn(actual interface{}, expected interface{}) string {
-	if matchError := oglematchers.Contains(actual).Matches(expected); matchError != nil {
-		return fmt.Sprintf(shouldHaveBeenIn, actual, reflect.TypeOf(expected))
-	}
-	return success
-}
-
-// ShouldNotBeIn receives at least 2 parameters. The first is a proposed member of the collection
-// that is passed in either as the second parameter, or of the collection that is comprised
-// of all the remaining parameters. This assertion ensures that the proposed member is NOT in
-// the collection (using ShouldEqual).
-func ShouldNotBeIn(actual interface{}, expected ...interface{}) string {
-	if fail := atLeast(1, expected); fail != success {
-		return fail
-	}
-
-	if len(expected) == 1 {
-		return shouldNotBeIn(actual, expected[0])
-	}
-	return shouldNotBeIn(actual, expected)
-}
-func shouldNotBeIn(actual interface{}, expected interface{}) string {
-	if matchError := oglematchers.Contains(actual).Matches(expected); matchError == nil {
-		return fmt.Sprintf(shouldNotHaveBeenIn, actual, reflect.TypeOf(expected))
-	}
-	return success
-}
-
-// ShouldBeEmpty receives a single parameter (actual) and determines whether or not
-// calling len(actual) would return `0`. It obeys the rules specified by the len
-// function for determining length: http://golang.org/pkg/builtin/#len
-func ShouldBeEmpty(actual interface{}, expected ...interface{}) string {
-	if fail := need(0, expected); fail != success {
-		return fail
-	}
-
-	if actual == nil {
-		return success
-	}
-
-	value := reflect.ValueOf(actual)
-	switch value.Kind() {
-	case reflect.Slice:
-		if value.Len() == 0 {
-			return success
-		}
-	case reflect.Chan:
-		if value.Len() == 0 {
-			return success
-		}
-	case reflect.Map:
-		if value.Len() == 0 {
-			return success
-		}
-	case reflect.String:
-		if value.Len() == 0 {
-			return success
-		}
-	case reflect.Ptr:
-		elem := value.Elem()
-		kind := elem.Kind()
-		if (kind == reflect.Slice || kind == reflect.Array) && elem.Len() == 0 {
-			return success
-		}
-	}
-
-	return fmt.Sprintf(shouldHaveBeenEmpty, actual)
-}
-
-// ShouldNotBeEmpty receives a single parameter (actual) and determines whether or not
-// calling len(actual) would return a value greater than zero. It obeys the rules
-// specified by the `len` function for determining length: http://golang.org/pkg/builtin/#len
-func ShouldNotBeEmpty(actual interface{}, expected ...interface{}) string {
-	if fail := need(0, expected); fail != success {
-		return fail
-	}
-
-	if empty := ShouldBeEmpty(actual, expected...); empty != success {
-		return success
-	}
-	return fmt.Sprintf(shouldNotHaveBeenEmpty, actual)
-}

+ 0 - 103
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/collections_test.go

@@ -1,103 +0,0 @@
-package assertions
-
-import (
-	"fmt"
-	"testing"
-	"time"
-)
-
-func TestShouldContain(t *testing.T) {
-	fail(t, so([]int{}, ShouldContain), "This assertion requires exactly 1 comparison values (you provided 0).")
-	fail(t, so([]int{}, ShouldContain, 1, 2, 3), "This assertion requires exactly 1 comparison values (you provided 3).")
-
-	fail(t, so(Thing1{}, ShouldContain, 1), "You must provide a valid container (was assertions.Thing1)!")
-	fail(t, so(nil, ShouldContain, 1), "You must provide a valid container (was <nil>)!")
-	fail(t, so([]int{1}, ShouldContain, 2), "Expected the container ([]int) to contain: '2' (but it didn't)!")
-
-	pass(t, so([]int{1}, ShouldContain, 1))
-	pass(t, so([]int{1, 2, 3}, ShouldContain, 2))
-}
-
-func TestShouldNotContain(t *testing.T) {
-	fail(t, so([]int{}, ShouldNotContain), "This assertion requires exactly 1 comparison values (you provided 0).")
-	fail(t, so([]int{}, ShouldNotContain, 1, 2, 3), "This assertion requires exactly 1 comparison values (you provided 3).")
-
-	fail(t, so(Thing1{}, ShouldNotContain, 1), "You must provide a valid container (was assertions.Thing1)!")
-	fail(t, so(nil, ShouldNotContain, 1), "You must provide a valid container (was <nil>)!")
-
-	fail(t, so([]int{1}, ShouldNotContain, 1), "Expected the container ([]int) NOT to contain: '1' (but it did)!")
-	fail(t, so([]int{1, 2, 3}, ShouldNotContain, 2), "Expected the container ([]int) NOT to contain: '2' (but it did)!")
-
-	pass(t, so([]int{1}, ShouldNotContain, 2))
-}
-
-func TestShouldBeIn(t *testing.T) {
-	fail(t, so(4, ShouldBeIn), shouldHaveProvidedCollectionMembers)
-
-	container := []int{1, 2, 3, 4}
-	pass(t, so(4, ShouldBeIn, container))
-	pass(t, so(4, ShouldBeIn, 1, 2, 3, 4))
-
-	fail(t, so(4, ShouldBeIn, 1, 2, 3), "Expected '4' to be in the container ([]interface {}, but it wasn't)!")
-	fail(t, so(4, ShouldBeIn, []int{1, 2, 3}), "Expected '4' to be in the container ([]int, but it wasn't)!")
-}
-
-func TestShouldNotBeIn(t *testing.T) {
-	fail(t, so(4, ShouldNotBeIn), shouldHaveProvidedCollectionMembers)
-
-	container := []int{1, 2, 3, 4}
-	pass(t, so(42, ShouldNotBeIn, container))
-	pass(t, so(42, ShouldNotBeIn, 1, 2, 3, 4))
-
-	fail(t, so(2, ShouldNotBeIn, 1, 2, 3), "Expected '2' NOT to be in the container ([]interface {}, but it was)!")
-	fail(t, so(2, ShouldNotBeIn, []int{1, 2, 3}), "Expected '2' NOT to be in the container ([]int, but it was)!")
-}
-
-func TestShouldBeEmpty(t *testing.T) {
-	fail(t, so(1, ShouldBeEmpty, 2, 3), "This assertion requires exactly 0 comparison values (you provided 2).")
-
-	pass(t, so([]int{}, ShouldBeEmpty))           // empty slice
-	pass(t, so([]interface{}{}, ShouldBeEmpty))   // empty slice
-	pass(t, so(map[string]int{}, ShouldBeEmpty))  // empty map
-	pass(t, so("", ShouldBeEmpty))                // empty string
-	pass(t, so(&[]int{}, ShouldBeEmpty))          // pointer to empty slice
-	pass(t, so(&[0]int{}, ShouldBeEmpty))         // pointer to empty array
-	pass(t, so(nil, ShouldBeEmpty))               // nil
-	pass(t, so(make(chan string), ShouldBeEmpty)) // empty channel
-
-	fail(t, so([]int{1}, ShouldBeEmpty), "Expected [1] to be empty (but it wasn't)!")                      // non-empty slice
-	fail(t, so([]interface{}{1}, ShouldBeEmpty), "Expected [1] to be empty (but it wasn't)!")              // non-empty slice
-	fail(t, so(map[string]int{"hi": 0}, ShouldBeEmpty), "Expected map[hi:0] to be empty (but it wasn't)!") // non-empty map
-	fail(t, so("hi", ShouldBeEmpty), "Expected hi to be empty (but it wasn't)!")                           // non-empty string
-	fail(t, so(&[]int{1}, ShouldBeEmpty), "Expected &[1] to be empty (but it wasn't)!")                    // pointer to non-empty slice
-	fail(t, so(&[1]int{1}, ShouldBeEmpty), "Expected &[1] to be empty (but it wasn't)!")                   // pointer to non-empty array
-	c := make(chan int, 1)                                                                                 // non-empty channel
-	go func() { c <- 1 }()
-	time.Sleep(time.Millisecond)
-	fail(t, so(c, ShouldBeEmpty), fmt.Sprintf("Expected %+v to be empty (but it wasn't)!", c))
-}
-
-func TestShouldNotBeEmpty(t *testing.T) {
-	fail(t, so(1, ShouldNotBeEmpty, 2, 3), "This assertion requires exactly 0 comparison values (you provided 2).")
-
-	fail(t, so([]int{}, ShouldNotBeEmpty), "Expected [] to NOT be empty (but it was)!")             // empty slice
-	fail(t, so([]interface{}{}, ShouldNotBeEmpty), "Expected [] to NOT be empty (but it was)!")     // empty slice
-	fail(t, so(map[string]int{}, ShouldNotBeEmpty), "Expected map[] to NOT be empty (but it was)!") // empty map
-	fail(t, so("", ShouldNotBeEmpty), "Expected  to NOT be empty (but it was)!")                    // empty string
-	fail(t, so(&[]int{}, ShouldNotBeEmpty), "Expected &[] to NOT be empty (but it was)!")           // pointer to empty slice
-	fail(t, so(&[0]int{}, ShouldNotBeEmpty), "Expected &[] to NOT be empty (but it was)!")          // pointer to empty array
-	fail(t, so(nil, ShouldNotBeEmpty), "Expected <nil> to NOT be empty (but it was)!")              // nil
-	c := make(chan int, 0)                                                                          // non-empty channel
-	fail(t, so(c, ShouldNotBeEmpty), fmt.Sprintf("Expected %+v to NOT be empty (but it was)!", c))  // empty channel
-
-	pass(t, so([]int{1}, ShouldNotBeEmpty))                // non-empty slice
-	pass(t, so([]interface{}{1}, ShouldNotBeEmpty))        // non-empty slice
-	pass(t, so(map[string]int{"hi": 0}, ShouldNotBeEmpty)) // non-empty map
-	pass(t, so("hi", ShouldNotBeEmpty))                    // non-empty string
-	pass(t, so(&[]int{1}, ShouldNotBeEmpty))               // pointer to non-empty slice
-	pass(t, so(&[1]int{1}, ShouldNotBeEmpty))              // pointer to non-empty array
-	c = make(chan int, 1)
-	go func() { c <- 1 }()
-	time.Sleep(time.Millisecond)
-	pass(t, so(c, ShouldNotBeEmpty))
-}

+ 0 - 43
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/doc.go

@@ -1,43 +0,0 @@
-// Package assertions contains the implementations for all assertions which
-// are referenced in the convey package for use with the So(...) method.
-package assertions
-
-// This function is not used by the goconvey library. It's actually a convenience method
-// for running assertions on arbitrary arguments outside of any testing context, like for
-// application logging. It allows you to perform assertion-like behavior (and get nicely
-// formatted messages detailing discrepancies) but without the probram blowing up or panicking.
-// All that is required is to import this package and call `So` with one of the assertions
-// exported by this package as the second parameter.
-// The first return parameter is a boolean indicating if the assertion was true. The second
-// return parameter is the well-formatted message showing why an assertion was incorrect, or
-// blank if the assertion was correct.
-//
-// Example:
-//
-//   if ok, message := So(x, ShouldBeGreaterThan, y); !ok {
-//        log.Println(message)
-//   }
-//
-func So(actual interface{}, assert assertion, expected ...interface{}) (bool, string) {
-	serializer = noop
-
-	if result := so(actual, assert, expected...); len(result) == 0 {
-		return true, result
-	} else {
-		return false, result
-	}
-}
-
-// so is like So, except that it only returns the string message, which is blank if the
-// assertion passed. Used to facilitate testing.
-func so(actual interface{}, assert func(interface{}, ...interface{}) string, expected ...interface{}) string {
-	return assert(actual, expected...)
-}
-
-// assertion is an alias for a function with a signature that the So()
-// function can handle. Any future or custom assertions should conform to this
-// method signature. The return value should be an empty string if the assertion
-// passes and a well-formed failure message if not.
-type assertion func(actual interface{}, expected ...interface{}) string
-
-////////////////////////////////////////////////////////////////////////////

+ 0 - 279
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/equality.go

@@ -1,279 +0,0 @@
-package assertions
-
-import (
-	"errors"
-	"fmt"
-	"math"
-	"reflect"
-	"strings"
-
-	"github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-)
-
-// default acceptable delta for ShouldAlmostEqual
-const defaultDelta = 0.0000000001
-
-// ShouldEqual receives exactly two parameters and does an equality check.
-func ShouldEqual(actual interface{}, expected ...interface{}) string {
-	if message := need(1, expected); message != success {
-		return message
-	}
-	return shouldEqual(actual, expected[0])
-}
-func shouldEqual(actual, expected interface{}) (message string) {
-	defer func() {
-		if r := recover(); r != nil {
-			message = serializer.serialize(expected, actual, fmt.Sprintf(shouldHaveBeenEqual, expected, actual))
-			return
-		}
-	}()
-
-	if matchError := oglematchers.Equals(expected).Matches(actual); matchError != nil {
-		message = serializer.serialize(expected, actual, fmt.Sprintf(shouldHaveBeenEqual, expected, actual))
-		return
-	}
-
-	return success
-}
-
-// ShouldNotEqual receives exactly two parameters and does an inequality check.
-func ShouldNotEqual(actual interface{}, expected ...interface{}) string {
-	if fail := need(1, expected); fail != success {
-		return fail
-	} else if ShouldEqual(actual, expected[0]) == success {
-		return fmt.Sprintf(shouldNotHaveBeenEqual, actual, expected[0])
-	}
-	return success
-}
-
-// ShouldAlmostEqual makes sure that two parameters are close enough to being equal.
-// The acceptable delta may be specified with a third argument,
-// or a very small default delta will be used.
-func ShouldAlmostEqual(actual interface{}, expected ...interface{}) string {
-	actualFloat, expectedFloat, deltaFloat, err := cleanAlmostEqualInput(actual, expected...)
-
-	if err != "" {
-		return err
-	}
-
-	if math.Abs(actualFloat-expectedFloat) <= deltaFloat {
-		return success
-	} else {
-		return fmt.Sprintf(shouldHaveBeenAlmostEqual, actualFloat, expectedFloat)
-	}
-}
-
-// ShouldNotAlmostEqual is the inverse of ShouldAlmostEqual
-func ShouldNotAlmostEqual(actual interface{}, expected ...interface{}) string {
-	actualFloat, expectedFloat, deltaFloat, err := cleanAlmostEqualInput(actual, expected...)
-
-	if err != "" {
-		return err
-	}
-
-	if math.Abs(actualFloat-expectedFloat) > deltaFloat {
-		return success
-	} else {
-		return fmt.Sprintf(shouldHaveNotBeenAlmostEqual, actualFloat, expectedFloat)
-	}
-}
-
-func cleanAlmostEqualInput(actual interface{}, expected ...interface{}) (float64, float64, float64, string) {
-	deltaFloat := 0.0000000001
-
-	if len(expected) == 0 {
-		return 0.0, 0.0, 0.0, "This assertion requires exactly one comparison value and an optional delta (you provided neither)"
-	} else if len(expected) == 2 {
-		delta, err := getFloat(expected[1])
-
-		if err != nil {
-			return 0.0, 0.0, 0.0, "delta must be a numerical type"
-		}
-
-		deltaFloat = delta
-	} else if len(expected) > 2 {
-		return 0.0, 0.0, 0.0, "This assertion requires exactly one comparison value and an optional delta (you provided more values)"
-	}
-
-	actualFloat, err := getFloat(actual)
-
-	if err != nil {
-		return 0.0, 0.0, 0.0, err.Error()
-	}
-
-	expectedFloat, err := getFloat(expected[0])
-
-	if err != nil {
-		return 0.0, 0.0, 0.0, err.Error()
-	}
-
-	return actualFloat, expectedFloat, deltaFloat, ""
-}
-
-// returns the float value of any real number, or error if it is not a numerical type
-func getFloat(num interface{}) (float64, error) {
-	numValue := reflect.ValueOf(num)
-	numKind := numValue.Kind()
-
-	if numKind == reflect.Int ||
-		numKind == reflect.Int8 ||
-		numKind == reflect.Int16 ||
-		numKind == reflect.Int32 ||
-		numKind == reflect.Int64 {
-		return float64(numValue.Int()), nil
-	} else if numKind == reflect.Uint ||
-		numKind == reflect.Uint8 ||
-		numKind == reflect.Uint16 ||
-		numKind == reflect.Uint32 ||
-		numKind == reflect.Uint64 {
-		return float64(numValue.Uint()), nil
-	} else if numKind == reflect.Float32 ||
-		numKind == reflect.Float64 {
-		return numValue.Float(), nil
-	} else {
-		return 0.0, errors.New("must be a numerical type, but was " + numKind.String())
-	}
-}
-
-// ShouldResemble receives exactly two parameters and does a deep equal check (see reflect.DeepEqual)
-func ShouldResemble(actual interface{}, expected ...interface{}) string {
-	if message := need(1, expected); message != success {
-		return message
-	}
-
-	if matchError := oglematchers.DeepEquals(expected[0]).Matches(actual); matchError != nil {
-		expectedSyntax := fmt.Sprintf("%#v", expected[0])
-		actualSyntax := fmt.Sprintf("%#v", actual)
-		var message string
-		if expectedSyntax == actualSyntax {
-			message = fmt.Sprintf(shouldHaveResembledTypeMismatch, expected[0], actual, expected[0], actual)
-		} else {
-			message = fmt.Sprintf(shouldHaveResembled, expected[0], actual)
-		}
-		return serializer.serializeDetailed(expected[0], actual, message)
-	}
-
-	return success
-}
-
-// ShouldNotResemble receives exactly two parameters and does an inverse deep equal check (see reflect.DeepEqual)
-func ShouldNotResemble(actual interface{}, expected ...interface{}) string {
-	if message := need(1, expected); message != success {
-		return message
-	} else if ShouldResemble(actual, expected[0]) == success {
-		return fmt.Sprintf(shouldNotHaveResembled, actual, expected[0])
-	}
-	return success
-}
-
-// ShouldPointTo receives exactly two parameters and checks to see that they point to the same address.
-func ShouldPointTo(actual interface{}, expected ...interface{}) string {
-	if message := need(1, expected); message != success {
-		return message
-	}
-	return shouldPointTo(actual, expected[0])
-
-}
-func shouldPointTo(actual, expected interface{}) string {
-	actualValue := reflect.ValueOf(actual)
-	expectedValue := reflect.ValueOf(expected)
-
-	if ShouldNotBeNil(actual) != success {
-		return fmt.Sprintf(shouldHaveBeenNonNilPointer, "first", "nil")
-	} else if ShouldNotBeNil(expected) != success {
-		return fmt.Sprintf(shouldHaveBeenNonNilPointer, "second", "nil")
-	} else if actualValue.Kind() != reflect.Ptr {
-		return fmt.Sprintf(shouldHaveBeenNonNilPointer, "first", "not")
-	} else if expectedValue.Kind() != reflect.Ptr {
-		return fmt.Sprintf(shouldHaveBeenNonNilPointer, "second", "not")
-	} else if ShouldEqual(actualValue.Pointer(), expectedValue.Pointer()) != success {
-		actualAddress := reflect.ValueOf(actual).Pointer()
-		expectedAddress := reflect.ValueOf(expected).Pointer()
-		return serializer.serialize(expectedAddress, actualAddress, fmt.Sprintf(shouldHavePointedTo,
-			actual, actualAddress,
-			expected, expectedAddress))
-	}
-	return success
-}
-
-// ShouldNotPointTo receives exactly two parameters and checks to see that they point to different addresess.
-func ShouldNotPointTo(actual interface{}, expected ...interface{}) string {
-	if message := need(1, expected); message != success {
-		return message
-	}
-	compare := ShouldPointTo(actual, expected[0])
-	if strings.HasPrefix(compare, shouldBePointers) {
-		return compare
-	} else if compare == success {
-		return fmt.Sprintf(shouldNotHavePointedTo, actual, expected[0], reflect.ValueOf(actual).Pointer())
-	}
-	return success
-}
-
-// ShouldBeNil receives a single parameter and ensures that it is nil.
-func ShouldBeNil(actual interface{}, expected ...interface{}) string {
-	if fail := need(0, expected); fail != success {
-		return fail
-	} else if actual == nil {
-		return success
-	} else if interfaceHasNilValue(actual) {
-		return success
-	}
-	return fmt.Sprintf(shouldHaveBeenNil, actual)
-}
-func interfaceHasNilValue(actual interface{}) bool {
-	value := reflect.ValueOf(actual)
-	kind := value.Kind()
-	nilable := kind == reflect.Slice ||
-		kind == reflect.Chan ||
-		kind == reflect.Func ||
-		kind == reflect.Ptr ||
-		kind == reflect.Map
-
-	// Careful: reflect.Value.IsNil() will panic unless it's an interface, chan, map, func, slice, or ptr
-	// Reference: http://golang.org/pkg/reflect/#Value.IsNil
-	return nilable && value.IsNil()
-}
-
-// ShouldNotBeNil receives a single parameter and ensures that it is not nil.
-func ShouldNotBeNil(actual interface{}, expected ...interface{}) string {
-	if fail := need(0, expected); fail != success {
-		return fail
-	} else if ShouldBeNil(actual) == success {
-		return fmt.Sprintf(shouldNotHaveBeenNil, actual)
-	}
-	return success
-}
-
-// ShouldBeTrue receives a single parameter and ensures that it is true.
-func ShouldBeTrue(actual interface{}, expected ...interface{}) string {
-	if fail := need(0, expected); fail != success {
-		return fail
-	} else if actual != true {
-		return fmt.Sprintf(shouldHaveBeenTrue, actual)
-	}
-	return success
-}
-
-// ShouldBeFalse receives a single parameter and ensures that it is false.
-func ShouldBeFalse(actual interface{}, expected ...interface{}) string {
-	if fail := need(0, expected); fail != success {
-		return fail
-	} else if actual != false {
-		return fmt.Sprintf(shouldHaveBeenFalse, actual)
-	}
-	return success
-}
-
-// ShouldBeZeroValue receives a single parameter and ensures that it is
-// the Go equivalent of the default value, or "zero" value.
-func ShouldBeZeroValue(actual interface{}, expected ...interface{}) string {
-	if fail := need(0, expected); fail != success {
-		return fail
-	}
-	zeroVal := reflect.Zero(reflect.TypeOf(actual)).Interface()
-	if !reflect.DeepEqual(zeroVal, actual) {
-		return serializer.serialize(zeroVal, actual, fmt.Sprintf(shouldHaveBeenZeroValue, actual))
-	}
-	return success
-}

+ 0 - 267
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/equality_test.go

@@ -1,267 +0,0 @@
-package assertions
-
-import (
-	"fmt"
-	"reflect"
-	"testing"
-)
-
-func TestShouldEqual(t *testing.T) {
-	serializer = newFakeSerializer()
-
-	fail(t, so(1, ShouldEqual), "This assertion requires exactly 1 comparison values (you provided 0).")
-	fail(t, so(1, ShouldEqual, 1, 2), "This assertion requires exactly 1 comparison values (you provided 2).")
-	fail(t, so(1, ShouldEqual, 1, 2, 3), "This assertion requires exactly 1 comparison values (you provided 3).")
-
-	pass(t, so(1, ShouldEqual, 1))
-	fail(t, so(1, ShouldEqual, 2), "2|1|Expected: '2' Actual: '1' (Should be equal)")
-
-	pass(t, so(true, ShouldEqual, true))
-	fail(t, so(true, ShouldEqual, false), "false|true|Expected: 'false' Actual: 'true' (Should be equal)")
-
-	pass(t, so("hi", ShouldEqual, "hi"))
-	fail(t, so("hi", ShouldEqual, "bye"), "bye|hi|Expected: 'bye' Actual: 'hi' (Should be equal)")
-
-	pass(t, so(42, ShouldEqual, uint(42)))
-
-	fail(t, so(Thing1{"hi"}, ShouldEqual, Thing1{}), "{}|{hi}|Expected: '{}' Actual: '{hi}' (Should be equal)")
-	fail(t, so(Thing1{"hi"}, ShouldEqual, Thing1{"hi"}), "{hi}|{hi}|Expected: '{hi}' Actual: '{hi}' (Should be equal)")
-	fail(t, so(&Thing1{"hi"}, ShouldEqual, &Thing1{"hi"}), "&{hi}|&{hi}|Expected: '&{hi}' Actual: '&{hi}' (Should be equal)")
-
-	fail(t, so(Thing1{}, ShouldEqual, Thing2{}), "{}|{}|Expected: '{}' Actual: '{}' (Should be equal)")
-}
-
-func TestShouldNotEqual(t *testing.T) {
-	fail(t, so(1, ShouldNotEqual), "This assertion requires exactly 1 comparison values (you provided 0).")
-	fail(t, so(1, ShouldNotEqual, 1, 2), "This assertion requires exactly 1 comparison values (you provided 2).")
-	fail(t, so(1, ShouldNotEqual, 1, 2, 3), "This assertion requires exactly 1 comparison values (you provided 3).")
-
-	pass(t, so(1, ShouldNotEqual, 2))
-	fail(t, so(1, ShouldNotEqual, 1), "Expected '1' to NOT equal '1' (but it did)!")
-
-	pass(t, so(true, ShouldNotEqual, false))
-	fail(t, so(true, ShouldNotEqual, true), "Expected 'true' to NOT equal 'true' (but it did)!")
-
-	pass(t, so("hi", ShouldNotEqual, "bye"))
-	fail(t, so("hi", ShouldNotEqual, "hi"), "Expected 'hi' to NOT equal 'hi' (but it did)!")
-
-	pass(t, so(&Thing1{"hi"}, ShouldNotEqual, &Thing1{"hi"}))
-	pass(t, so(Thing1{"hi"}, ShouldNotEqual, Thing1{"hi"}))
-	pass(t, so(Thing1{}, ShouldNotEqual, Thing1{}))
-	pass(t, so(Thing1{}, ShouldNotEqual, Thing2{}))
-}
-
-func TestShouldAlmostEqual(t *testing.T) {
-	fail(t, so(1, ShouldAlmostEqual), "This assertion requires exactly one comparison value and an optional delta (you provided neither)")
-	fail(t, so(1, ShouldAlmostEqual, 1, 2, 3), "This assertion requires exactly one comparison value and an optional delta (you provided more values)")
-
-	// with the default delta
-	pass(t, so(1, ShouldAlmostEqual, .99999999999999))
-	pass(t, so(1.3612499999999996, ShouldAlmostEqual, 1.36125))
-	pass(t, so(0.7285312499999999, ShouldAlmostEqual, 0.72853125))
-	fail(t, so(1, ShouldAlmostEqual, .99), "Expected '1' to almost equal '0.99' (but it didn't)!")
-
-	// with a different delta
-	pass(t, so(100.0, ShouldAlmostEqual, 110.0, 10.0))
-	fail(t, so(100.0, ShouldAlmostEqual, 111.0, 10.5), "Expected '100' to almost equal '111' (but it didn't)!")
-
-	// ints should work
-	pass(t, so(100, ShouldAlmostEqual, 100.0))
-	fail(t, so(100, ShouldAlmostEqual, 99.0), "Expected '100' to almost equal '99' (but it didn't)!")
-
-	// float32 should work
-	pass(t, so(float64(100.0), ShouldAlmostEqual, float32(100.0)))
-	fail(t, so(float32(100.0), ShouldAlmostEqual, 99.0, float32(0.1)), "Expected '100' to almost equal '99' (but it didn't)!")
-}
-
-func TestShouldNotAlmostEqual(t *testing.T) {
-	fail(t, so(1, ShouldNotAlmostEqual), "This assertion requires exactly one comparison value and an optional delta (you provided neither)")
-	fail(t, so(1, ShouldNotAlmostEqual, 1, 2, 3), "This assertion requires exactly one comparison value and an optional delta (you provided more values)")
-
-	// with the default delta
-	fail(t, so(1, ShouldNotAlmostEqual, .99999999999999), "Expected '1' to NOT almost equal '0.99999999999999' (but it did)!")
-	fail(t, so(1.3612499999999996, ShouldNotAlmostEqual, 1.36125), "Expected '1.3612499999999996' to NOT almost equal '1.36125' (but it did)!")
-	pass(t, so(1, ShouldNotAlmostEqual, .99))
-
-	// with a different delta
-	fail(t, so(100.0, ShouldNotAlmostEqual, 110.0, 10.0), "Expected '100' to NOT almost equal '110' (but it did)!")
-	pass(t, so(100.0, ShouldNotAlmostEqual, 111.0, 10.5))
-
-	// ints should work
-	fail(t, so(100, ShouldNotAlmostEqual, 100.0), "Expected '100' to NOT almost equal '100' (but it did)!")
-	pass(t, so(100, ShouldNotAlmostEqual, 99.0))
-
-	// float32 should work
-	fail(t, so(float64(100.0), ShouldNotAlmostEqual, float32(100.0)), "Expected '100' to NOT almost equal '100' (but it did)!")
-	pass(t, so(float32(100.0), ShouldNotAlmostEqual, 99.0, float32(0.1)))
-}
-
-func TestShouldResemble(t *testing.T) {
-	serializer = newFakeSerializer()
-
-	fail(t, so(Thing1{"hi"}, ShouldResemble), "This assertion requires exactly 1 comparison values (you provided 0).")
-	fail(t, so(Thing1{"hi"}, ShouldResemble, Thing1{"hi"}, Thing1{"hi"}), "This assertion requires exactly 1 comparison values (you provided 2).")
-
-	pass(t, so(Thing1{"hi"}, ShouldResemble, Thing1{"hi"}))
-	fail(t, so(Thing1{"hi"}, ShouldResemble, Thing1{"bye"}), "{bye}|{hi}|Expected: 'assertions.Thing1{a:\"bye\"}' Actual: 'assertions.Thing1{a:\"hi\"}' (Should resemble)!")
-
-	var (
-		a []int
-		b []int = []int{}
-	)
-
-	fail(t, so(a, ShouldResemble, b), "[]|[]|Expected: '[]int{}' Actual: '[]int(nil)' (Should resemble)!")
-	fail(t, so(2, ShouldResemble, 1), "1|2|Expected: '1' Actual: '2' (Should resemble)!")
-
-	fail(t, so(StringStringMapAlias{"hi": "bye"}, ShouldResemble, map[string]string{"hi": "bye"}),
-		"map[hi:bye]|map[hi:bye]|Expected: 'map[string]string{\"hi\":\"bye\"}' Actual: 'assertions.StringStringMapAlias{\"hi\":\"bye\"}' (Should resemble)!")
-	fail(t, so(StringSliceAlias{"hi", "bye"}, ShouldResemble, []string{"hi", "bye"}),
-		"[hi bye]|[hi bye]|Expected: '[]string{\"hi\", \"bye\"}' Actual: 'assertions.StringSliceAlias{\"hi\", \"bye\"}' (Should resemble)!")
-
-	// some types come out looking the same when represented with "%#v" so we show type mismatch info:
-	fail(t, so(StringAlias("hi"), ShouldResemble, "hi"), "hi|hi|Expected: '\"hi\"' Actual: '\"hi\"' (Type mismatch: 'string' vs 'assertions.StringAlias')!")
-	fail(t, so(IntAlias(42), ShouldResemble, 42), "42|42|Expected: '42' Actual: '42' (Type mismatch: 'int' vs 'assertions.IntAlias')!")
-}
-
-func TestShouldNotResemble(t *testing.T) {
-	fail(t, so(Thing1{"hi"}, ShouldNotResemble), "This assertion requires exactly 1 comparison values (you provided 0).")
-	fail(t, so(Thing1{"hi"}, ShouldNotResemble, Thing1{"hi"}, Thing1{"hi"}), "This assertion requires exactly 1 comparison values (you provided 2).")
-
-	pass(t, so(Thing1{"hi"}, ShouldNotResemble, Thing1{"bye"}))
-	fail(t, so(Thing1{"hi"}, ShouldNotResemble, Thing1{"hi"}),
-		"Expected 'assertions.Thing1{a:\"hi\"}' to NOT resemble 'assertions.Thing1{a:\"hi\"}' (but it did)!")
-
-	pass(t, so(map[string]string{"hi": "bye"}, ShouldResemble, map[string]string{"hi": "bye"}))
-	pass(t, so(IntAlias(42), ShouldNotResemble, 42))
-
-	pass(t, so(StringSliceAlias{"hi", "bye"}, ShouldNotResemble, []string{"hi", "bye"}))
-}
-
-func TestShouldPointTo(t *testing.T) {
-	serializer = newFakeSerializer()
-
-	t1 := &Thing1{}
-	t2 := t1
-	t3 := &Thing1{}
-
-	pointer1 := reflect.ValueOf(t1).Pointer()
-	pointer3 := reflect.ValueOf(t3).Pointer()
-
-	fail(t, so(t1, ShouldPointTo), "This assertion requires exactly 1 comparison values (you provided 0).")
-	fail(t, so(t1, ShouldPointTo, t2, t3), "This assertion requires exactly 1 comparison values (you provided 2).")
-
-	pass(t, so(t1, ShouldPointTo, t2))
-	fail(t, so(t1, ShouldPointTo, t3), fmt.Sprintf(
-		"%v|%v|Expected '&{a:}' (address: '%v') and '&{a:}' (address: '%v') to be the same address (but their weren't)!",
-		pointer3, pointer1, pointer1, pointer3))
-
-	t4 := Thing1{}
-	t5 := t4
-
-	fail(t, so(t4, ShouldPointTo, t5), "Both arguments should be pointers (the first was not)!")
-	fail(t, so(&t4, ShouldPointTo, t5), "Both arguments should be pointers (the second was not)!")
-	fail(t, so(nil, ShouldPointTo, nil), "Both arguments should be pointers (the first was nil)!")
-	fail(t, so(&t4, ShouldPointTo, nil), "Both arguments should be pointers (the second was nil)!")
-}
-
-func TestShouldNotPointTo(t *testing.T) {
-	t1 := &Thing1{}
-	t2 := t1
-	t3 := &Thing1{}
-
-	pointer1 := reflect.ValueOf(t1).Pointer()
-
-	fail(t, so(t1, ShouldNotPointTo), "This assertion requires exactly 1 comparison values (you provided 0).")
-	fail(t, so(t1, ShouldNotPointTo, t2, t3), "This assertion requires exactly 1 comparison values (you provided 2).")
-
-	pass(t, so(t1, ShouldNotPointTo, t3))
-	fail(t, so(t1, ShouldNotPointTo, t2), fmt.Sprintf("Expected '&{a:}' and '&{a:}' to be different references (but they matched: '%v')!", pointer1))
-
-	t4 := Thing1{}
-	t5 := t4
-
-	fail(t, so(t4, ShouldNotPointTo, t5), "Both arguments should be pointers (the first was not)!")
-	fail(t, so(&t4, ShouldNotPointTo, t5), "Both arguments should be pointers (the second was not)!")
-	fail(t, so(nil, ShouldNotPointTo, nil), "Both arguments should be pointers (the first was nil)!")
-	fail(t, so(&t4, ShouldNotPointTo, nil), "Both arguments should be pointers (the second was nil)!")
-}
-
-func TestShouldBeNil(t *testing.T) {
-	fail(t, so(nil, ShouldBeNil, nil, nil, nil), "This assertion requires exactly 0 comparison values (you provided 3).")
-	fail(t, so(nil, ShouldBeNil, nil), "This assertion requires exactly 0 comparison values (you provided 1).")
-
-	pass(t, so(nil, ShouldBeNil))
-	fail(t, so(1, ShouldBeNil), "Expected: nil Actual: '1'")
-
-	var thing Thinger
-	pass(t, so(thing, ShouldBeNil))
-	thing = &Thing{}
-	fail(t, so(thing, ShouldBeNil), "Expected: nil Actual: '&{}'")
-
-	var thingOne *Thing1
-	pass(t, so(thingOne, ShouldBeNil))
-
-	var nilSlice []int = nil
-	pass(t, so(nilSlice, ShouldBeNil))
-
-	var nilMap map[string]string = nil
-	pass(t, so(nilMap, ShouldBeNil))
-
-	var nilChannel chan int = nil
-	pass(t, so(nilChannel, ShouldBeNil))
-
-	var nilFunc func() = nil
-	pass(t, so(nilFunc, ShouldBeNil))
-
-	var nilInterface interface{} = nil
-	pass(t, so(nilInterface, ShouldBeNil))
-}
-
-func TestShouldNotBeNil(t *testing.T) {
-	fail(t, so(nil, ShouldNotBeNil, nil, nil, nil), "This assertion requires exactly 0 comparison values (you provided 3).")
-	fail(t, so(nil, ShouldNotBeNil, nil), "This assertion requires exactly 0 comparison values (you provided 1).")
-
-	fail(t, so(nil, ShouldNotBeNil), "Expected '<nil>' to NOT be nil (but it was)!")
-	pass(t, so(1, ShouldNotBeNil))
-
-	var thing Thinger
-	fail(t, so(thing, ShouldNotBeNil), "Expected '<nil>' to NOT be nil (but it was)!")
-	thing = &Thing{}
-	pass(t, so(thing, ShouldNotBeNil))
-}
-
-func TestShouldBeTrue(t *testing.T) {
-	fail(t, so(true, ShouldBeTrue, 1, 2, 3), "This assertion requires exactly 0 comparison values (you provided 3).")
-	fail(t, so(true, ShouldBeTrue, 1), "This assertion requires exactly 0 comparison values (you provided 1).")
-
-	fail(t, so(false, ShouldBeTrue), "Expected: true Actual: false")
-	fail(t, so(1, ShouldBeTrue), "Expected: true Actual: 1")
-	pass(t, so(true, ShouldBeTrue))
-}
-
-func TestShouldBeFalse(t *testing.T) {
-	fail(t, so(false, ShouldBeFalse, 1, 2, 3), "This assertion requires exactly 0 comparison values (you provided 3).")
-	fail(t, so(false, ShouldBeFalse, 1), "This assertion requires exactly 0 comparison values (you provided 1).")
-
-	fail(t, so(true, ShouldBeFalse), "Expected: false Actual: true")
-	fail(t, so(1, ShouldBeFalse), "Expected: false Actual: 1")
-	pass(t, so(false, ShouldBeFalse))
-}
-
-func TestShouldBeZeroValue(t *testing.T) {
-	serializer = newFakeSerializer()
-
-	fail(t, so(0, ShouldBeZeroValue, 1, 2, 3), "This assertion requires exactly 0 comparison values (you provided 3).")
-	fail(t, so(false, ShouldBeZeroValue, true), "This assertion requires exactly 0 comparison values (you provided 1).")
-
-	fail(t, so(1, ShouldBeZeroValue), "0|1|'1' should have been the zero value")                                       //"Expected: (zero value) Actual: 1")
-	fail(t, so(true, ShouldBeZeroValue), "false|true|'true' should have been the zero value")                          //"Expected: (zero value) Actual: true")
-	fail(t, so("123", ShouldBeZeroValue), "|123|'123' should have been the zero value")                                //"Expected: (zero value) Actual: 123")
-	fail(t, so(" ", ShouldBeZeroValue), "| |' ' should have been the zero value")                                      //"Expected: (zero value) Actual:  ")
-	fail(t, so([]string{"Nonempty"}, ShouldBeZeroValue), "[]|[Nonempty]|'[Nonempty]' should have been the zero value") //"Expected: (zero value) Actual: [Nonempty]")
-	fail(t, so(struct{ a string }{a: "asdf"}, ShouldBeZeroValue), "{}|{asdf}|'{a:asdf}' should have been the zero value")
-	pass(t, so(0, ShouldBeZeroValue))
-	pass(t, so(false, ShouldBeZeroValue))
-	pass(t, so("", ShouldBeZeroValue))
-	pass(t, so(struct{}{}, ShouldBeZeroValue))
-}

+ 0 - 22
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/filter.go

@@ -1,22 +0,0 @@
-package assertions
-
-import "fmt"
-
-const (
-	success         = ""
-	needExactValues = "This assertion requires exactly %d comparison values (you provided %d)."
-)
-
-func need(needed int, expected []interface{}) string {
-	if len(expected) != needed {
-		return fmt.Sprintf(needExactValues, needed, len(expected))
-	}
-	return success
-}
-
-func atLeast(minimum int, expected []interface{}) string {
-	if len(expected) < 1 {
-		return shouldHaveProvidedCollectionMembers
-	}
-	return success
-}

+ 0 - 6
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/init.go

@@ -1,6 +0,0 @@
-package assertions
-
-var (
-	serializer Serializer = newSerializer()
-	noop       Serializer = new(noopSerializer)
-)

+ 0 - 87
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/messages.go

@@ -1,87 +0,0 @@
-package assertions
-
-const ( // equality
-	shouldHaveBeenEqual             = "Expected: '%v'\nActual:   '%v'\n(Should be equal)"
-	shouldNotHaveBeenEqual          = "Expected     '%v'\nto NOT equal '%v'\n(but it did)!"
-	shouldHaveBeenAlmostEqual       = "Expected '%v' to almost equal '%v' (but it didn't)!"
-	shouldHaveNotBeenAlmostEqual    = "Expected '%v' to NOT almost equal '%v' (but it did)!"
-	shouldHaveResembled             = "Expected: '%#v'\nActual:   '%#v'\n(Should resemble)!"
-	shouldHaveResembledTypeMismatch = "Expected: '%#v'\nActual:   '%#v'\n(Type mismatch: '%T' vs '%T')!"
-	shouldNotHaveResembled          = "Expected        '%#v'\nto NOT resemble '%#v'\n(but it did)!"
-	shouldBePointers                = "Both arguments should be pointers "
-	shouldHaveBeenNonNilPointer     = shouldBePointers + "(the %s was %s)!"
-	shouldHavePointedTo             = "Expected '%+v' (address: '%v') and '%+v' (address: '%v') to be the same address (but their weren't)!"
-	shouldNotHavePointedTo          = "Expected '%+v' and '%+v' to be different references (but they matched: '%v')!"
-	shouldHaveBeenNil               = "Expected: nil\nActual:   '%v'"
-	shouldNotHaveBeenNil            = "Expected '%+v' to NOT be nil (but it was)!"
-	shouldHaveBeenTrue              = "Expected: true\nActual:   %v"
-	shouldHaveBeenFalse             = "Expected: false\nActual:   %v"
-	shouldHaveBeenZeroValue         = "'%+v' should have been the zero value" //"Expected: (zero value)\nActual:   %v"
-)
-
-const ( // quantity comparisons
-	shouldHaveBeenGreater            = "Expected '%v' to be greater than '%v' (but it wasn't)!"
-	shouldHaveBeenGreaterOrEqual     = "Expected '%v' to be greater than or equal to '%v' (but it wasn't)!"
-	shouldHaveBeenLess               = "Expected '%v' to be less than '%v' (but it wasn't)!"
-	shouldHaveBeenLessOrEqual        = "Expected '%v' to be less than or equal to '%v' (but it wasn't)!"
-	shouldHaveBeenBetween            = "Expected '%v' to be between '%v' and '%v' (but it wasn't)!"
-	shouldNotHaveBeenBetween         = "Expected '%v' NOT to be between '%v' and '%v' (but it was)!"
-	shouldHaveDifferentUpperAndLower = "The lower and upper bounds must be different values (they were both '%v')."
-	shouldHaveBeenBetweenOrEqual     = "Expected '%v' to be between '%v' and '%v' or equal to one of them (but it wasn't)!"
-	shouldNotHaveBeenBetweenOrEqual  = "Expected '%v' NOT to be between '%v' and '%v' or equal to one of them (but it was)!"
-)
-
-const ( // collections
-	shouldHaveContained                 = "Expected the container (%v) to contain: '%v' (but it didn't)!"
-	shouldNotHaveContained              = "Expected the container (%v) NOT to contain: '%v' (but it did)!"
-	shouldHaveBeenIn                    = "Expected '%v' to be in the container (%v, but it wasn't)!"
-	shouldNotHaveBeenIn                 = "Expected '%v' NOT to be in the container (%v, but it was)!"
-	shouldHaveBeenAValidCollection      = "You must provide a valid container (was %v)!"
-	shouldHaveProvidedCollectionMembers = "This assertion requires at least 1 comparison value (you provided 0)."
-	shouldHaveBeenEmpty                 = "Expected %+v to be empty (but it wasn't)!"
-	shouldNotHaveBeenEmpty              = "Expected %+v to NOT be empty (but it was)!"
-)
-
-const ( // strings
-	shouldHaveStartedWith           = "Expected      '%v'\nto start with '%v'\n(but it didn't)!"
-	shouldNotHaveStartedWith        = "Expected          '%v'\nNOT to start with '%v'\n(but it did)!"
-	shouldHaveEndedWith             = "Expected    '%v'\nto end with '%v'\n(but it didn't)!"
-	shouldNotHaveEndedWith          = "Expected        '%v'\nNOT to end with '%v'\n(but it did)!"
-	shouldBothBeStrings             = "Both arguments to this assertion must be strings (you provided %v and %v)."
-	shouldBeString                  = "The argument to this assertion must be a string (you provided %v)."
-	shouldHaveContainedSubstring    = "Expected '%s' to contain substring '%s' (but it didn't)!"
-	shouldNotHaveContainedSubstring = "Expected '%s' NOT to contain substring '%s' (but it didn't)!"
-	shouldHaveBeenBlank             = "Expected '%s' to be blank (but it wasn't)!"
-	shouldNotHaveBeenBlank          = "Expected value to NOT be blank (but it was)!"
-)
-
-const ( // panics
-	shouldUseVoidNiladicFunction = "You must provide a void, niladic function as the first argument!"
-	shouldHavePanickedWith       = "Expected func() to panic with '%v' (but it panicked with '%v')!"
-	shouldHavePanicked           = "Expected func() to panic (but it didn't)!"
-	shouldNotHavePanicked        = "Expected func() NOT to panic (error: '%+v')!"
-	shouldNotHavePanickedWith    = "Expected func() NOT to panic with '%v' (but it did)!"
-)
-
-const ( // type checking
-	shouldHaveBeenA    = "Expected '%v' to be: '%v' (but was: '%v')!"
-	shouldNotHaveBeenA = "Expected '%v' to NOT be: '%v' (but it was)!"
-
-	shouldHaveImplemented             = "Expected: '%v interface support'\nActual:   '%v' does not implement the interface!"
-	shouldNotHaveImplemented          = "Expected         '%v'\nto NOT implement '%v'\n(but it did)!"
-	shouldCompareWithInterfacePointer = "The expected value must be a pointer to an interface type (eg. *fmt.Stringer)"
-	shouldNotBeNilActual              = "The actual value was 'nil' and should be a value or a pointer to a value!"
-)
-
-const ( // time comparisons
-	shouldUseTimes                   = "You must provide time instances as arguments to this assertion."
-	shouldUseTimeSlice               = "You must provide a slice of time instances as the first argument to this assertion."
-	shouldUseDurationAndTime         = "You must provide a duration and a time as arguments to this assertion."
-	shouldHaveHappenedBefore         = "Expected '%v' to happen before '%v' (it happened '%v' after)!"
-	shouldHaveHappenedAfter          = "Expected '%v' to happen after '%v' (it happened '%v' before)!"
-	shouldHaveHappenedBetween        = "Expected '%v' to happen between '%v' and '%v' (it happened '%v' outside threshold)!"
-	shouldNotHaveHappenedOnOrBetween = "Expected '%v' to NOT happen on or between '%v' and '%v' (but it did)!"
-
-	// format params: incorrect-index, previous-index, previous-time, incorrect-index, incorrect-time
-	shouldHaveBeenChronological = "The 'Time' at index [%d] should have happened after the previous one (but it didn't!):\n  [%d]: %s\n  [%d]: %s (see, it happened before!)"
-)

+ 0 - 5
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/.gitignore

@@ -1,5 +0,0 @@
-*.6
-6.out
-_obj/
-_test/
-_testmain.go

+ 0 - 202
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/LICENSE

@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.

+ 0 - 56
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/README.markdown

@@ -1,56 +0,0 @@
-`oglematchers` is a package for the Go programming language containing a set of
-matchers, useful in a testing or mocking framework, inspired by and mostly
-compatible with [Google Test][googletest] for C++ and
-[Google JS Test][google-js-test]. The package is used by the
-[ogletest][ogletest] testing framework and [oglemock][oglemock] mocking
-framework, which may be more directly useful to you, but can be generically used
-elsewhere as well.
-
-A "matcher" is simply an object with a `Matches` method defining a set of golang
-values matched by the matcher, and a `Description` method describing that set.
-For example, here are some matchers:
-
-```go
-// Numbers
-Equals(17.13)
-LessThan(19)
-
-// Strings
-Equals("taco")
-HasSubstr("burrito")
-MatchesRegex("t.*o")
-
-// Combining matchers
-AnyOf(LessThan(17), GreaterThan(19))
-```
-
-There are lots more; see [here][reference] for a reference. You can also add
-your own simply by implementing the `oglematchers.Matcher` interface.
-
-
-Installation
-------------
-
-First, make sure you have installed Go 1.0.2 or newer. See
-[here][golang-install] for instructions.
-
-Use the following command to install `oglematchers` and keep it up to date:
-
-    go get -u github.com/smartystreets/goconvey/convey/assertions/oglematchers
-
-
-Documentation
--------------
-
-See [here][reference] for documentation hosted on GoPkgDoc. Alternatively, you
-can install the package and then use `go doc`:
-
-    go doc github.com/smartystreets/goconvey/convey/assertions/oglematchers
-
-
-[reference]: http://gopkgdoc.appspot.com/pkg/github.com/smartystreets/goconvey/convey/assertions/oglematchers
-[golang-install]: http://golang.org/doc/install.html
-[googletest]: http://code.google.com/p/googletest/
-[google-js-test]: http://code.google.com/p/google-js-test/
-[ogletest]: http://github.com/smartystreets/goconvey/convey/assertions/ogletest
-[oglemock]: http://github.com/smartystreets/goconvey/convey/assertions/oglemock

+ 0 - 70
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/all_of.go

@@ -1,70 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"strings"
-)
-
-// AllOf accepts a set of matchers S and returns a matcher that follows the
-// algorithm below when considering a candidate c:
-//
-//  1. Return true if for every Matcher m in S, m matches c.
-//
-//  2. Otherwise, if there is a matcher m in S such that m returns a fatal
-//     error for c, return that matcher's error message.
-//
-//  3. Otherwise, return false with the error from some wrapped matcher.
-//
-// This is akin to a logical AND operation for matchers.
-func AllOf(matchers ...Matcher) Matcher {
-	return &allOfMatcher{matchers}
-}
-
-type allOfMatcher struct {
-	wrappedMatchers []Matcher
-}
-
-func (m *allOfMatcher) Description() string {
-	// Special case: the empty set.
-	if len(m.wrappedMatchers) == 0 {
-		return "is anything"
-	}
-
-	// Join the descriptions for the wrapped matchers.
-	wrappedDescs := make([]string, len(m.wrappedMatchers))
-	for i, wrappedMatcher := range m.wrappedMatchers {
-		wrappedDescs[i] = wrappedMatcher.Description()
-	}
-
-	return strings.Join(wrappedDescs, ", and ")
-}
-
-func (m *allOfMatcher) Matches(c interface{}) (err error) {
-	for _, wrappedMatcher := range m.wrappedMatchers {
-		if wrappedErr := wrappedMatcher.Matches(c); wrappedErr != nil {
-			err = wrappedErr
-
-			// If the error is fatal, return immediately with this error.
-			_, ok := wrappedErr.(*FatalError)
-			if ok {
-				return
-			}
-		}
-	}
-
-	return
-}

+ 0 - 110
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/all_of_test.go

@@ -1,110 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	"errors"
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type allOfFakeMatcher struct {
-	desc string
-	err  error
-}
-
-func (m *allOfFakeMatcher) Matches(c interface{}) error {
-	return m.err
-}
-
-func (m *allOfFakeMatcher) Description() string {
-	return m.desc
-}
-
-type AllOfTest struct {
-}
-
-func init() { RegisterTestSuite(&AllOfTest{}) }
-
-////////////////////////////////////////////////////////////////////////
-// Tests
-////////////////////////////////////////////////////////////////////////
-
-func (t *AllOfTest) DescriptionWithEmptySet() {
-	m := AllOf()
-	ExpectEq("is anything", m.Description())
-}
-
-func (t *AllOfTest) DescriptionWithOneMatcher() {
-	m := AllOf(&allOfFakeMatcher{"taco", errors.New("")})
-	ExpectEq("taco", m.Description())
-}
-
-func (t *AllOfTest) DescriptionWithMultipleMatchers() {
-	m := AllOf(
-		&allOfFakeMatcher{"taco", errors.New("")},
-		&allOfFakeMatcher{"burrito", errors.New("")},
-		&allOfFakeMatcher{"enchilada", errors.New("")})
-
-	ExpectEq("taco, and burrito, and enchilada", m.Description())
-}
-
-func (t *AllOfTest) EmptySet() {
-	m := AllOf()
-	err := m.Matches(17)
-
-	ExpectEq(nil, err)
-}
-
-func (t *AllOfTest) OneMatcherReturnsFatalErrorAndSomeOthersFail() {
-	m := AllOf(
-		&allOfFakeMatcher{"", errors.New("")},
-		&allOfFakeMatcher{"", NewFatalError("taco")},
-		&allOfFakeMatcher{"", errors.New("")},
-		&allOfFakeMatcher{"", nil})
-
-	err := m.Matches(17)
-
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("taco")))
-}
-
-func (t *AllOfTest) OneMatcherReturnsNonFatalAndOthersSayTrue() {
-	m := AllOf(
-		&allOfFakeMatcher{"", nil},
-		&allOfFakeMatcher{"", errors.New("taco")},
-		&allOfFakeMatcher{"", nil})
-
-	err := m.Matches(17)
-
-	ExpectFalse(isFatal(err))
-	ExpectThat(err, Error(Equals("taco")))
-}
-
-func (t *AllOfTest) AllMatchersSayTrue() {
-	m := AllOf(
-		&allOfFakeMatcher{"", nil},
-		&allOfFakeMatcher{"", nil},
-		&allOfFakeMatcher{"", nil})
-
-	err := m.Matches(17)
-
-	ExpectEq(nil, err)
-}

+ 0 - 32
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/any.go

@@ -1,32 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-// Any returns a matcher that matches any value.
-func Any() Matcher {
-	return &anyMatcher{}
-}
-
-type anyMatcher struct {
-}
-
-func (m *anyMatcher) Description() string {
-	return "is anything"
-}
-
-func (m *anyMatcher) Matches(c interface{}) error {
-	return nil
-}

+ 0 - 93
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/any_of.go

@@ -1,93 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"errors"
-	"fmt"
-	"reflect"
-	"strings"
-)
-
-// AnyOf accepts a set of values S and returns a matcher that follows the
-// algorithm below when considering a candidate c:
-//
-//  1. If there exists a value m in S such that m implements the Matcher
-//     interface and m matches c, return true.
-//
-//  2. Otherwise, if there exists a value v in S such that v does not implement
-//     the Matcher interface and the matcher Equals(v) matches c, return true.
-//
-//  3. Otherwise, if there is a value m in S such that m implements the Matcher
-//     interface and m returns a fatal error for c, return that fatal error.
-//
-//  4. Otherwise, return false.
-//
-// This is akin to a logical OR operation for matchers, with non-matchers x
-// being treated as Equals(x).
-func AnyOf(vals ...interface{}) Matcher {
-	// Get ahold of a type variable for the Matcher interface.
-	var dummy *Matcher
-	matcherType := reflect.TypeOf(dummy).Elem()
-
-	// Create a matcher for each value, or use the value itself if it's already a
-	// matcher.
-	wrapped := make([]Matcher, len(vals))
-	for i, v := range vals {
-		if reflect.TypeOf(v).Implements(matcherType) {
-			wrapped[i] = v.(Matcher)
-		} else {
-			wrapped[i] = Equals(v)
-		}
-	}
-
-	return &anyOfMatcher{wrapped}
-}
-
-type anyOfMatcher struct {
-	wrapped []Matcher
-}
-
-func (m *anyOfMatcher) Description() string {
-	wrappedDescs := make([]string, len(m.wrapped))
-	for i, matcher := range m.wrapped {
-		wrappedDescs[i] = matcher.Description()
-	}
-
-	return fmt.Sprintf("or(%s)", strings.Join(wrappedDescs, ", "))
-}
-
-func (m *anyOfMatcher) Matches(c interface{}) (err error) {
-	err = errors.New("")
-
-	// Try each matcher in turn.
-	for _, matcher := range m.wrapped {
-		wrappedErr := matcher.Matches(c)
-
-		// Return immediately if there's a match.
-		if wrappedErr == nil {
-			err = nil
-			return
-		}
-
-		// Note the fatal error, if any.
-		if _, isFatal := wrappedErr.(*FatalError); isFatal {
-			err = wrappedErr
-		}
-	}
-
-	return
-}

+ 0 - 121
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/any_of_test.go

@@ -1,121 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	"errors"
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type fakeAnyOfMatcher struct {
-	desc string
-	err  error
-}
-
-func (m *fakeAnyOfMatcher) Matches(c interface{}) error {
-	return m.err
-}
-
-func (m *fakeAnyOfMatcher) Description() string {
-	return m.desc
-}
-
-type AnyOfTest struct {
-}
-
-func init() { RegisterTestSuite(&AnyOfTest{}) }
-
-////////////////////////////////////////////////////////////////////////
-// Tests
-////////////////////////////////////////////////////////////////////////
-
-func (t *AnyOfTest) EmptySet() {
-	matcher := AnyOf()
-
-	err := matcher.Matches(0)
-	ExpectThat(err, Error(Equals("")))
-}
-
-func (t *AnyOfTest) OneTrue() {
-	matcher := AnyOf(
-		&fakeAnyOfMatcher{"", NewFatalError("foo")},
-		17,
-		&fakeAnyOfMatcher{"", errors.New("foo")},
-		&fakeAnyOfMatcher{"", nil},
-		&fakeAnyOfMatcher{"", errors.New("foo")},
-	)
-
-	err := matcher.Matches(0)
-	ExpectEq(nil, err)
-}
-
-func (t *AnyOfTest) OneEqual() {
-	matcher := AnyOf(
-		&fakeAnyOfMatcher{"", NewFatalError("foo")},
-		&fakeAnyOfMatcher{"", errors.New("foo")},
-		13,
-		"taco",
-		19,
-		&fakeAnyOfMatcher{"", errors.New("foo")},
-	)
-
-	err := matcher.Matches("taco")
-	ExpectEq(nil, err)
-}
-
-func (t *AnyOfTest) OneFatal() {
-	matcher := AnyOf(
-		&fakeAnyOfMatcher{"", errors.New("foo")},
-		17,
-		&fakeAnyOfMatcher{"", NewFatalError("taco")},
-		&fakeAnyOfMatcher{"", errors.New("foo")},
-	)
-
-	err := matcher.Matches(0)
-	ExpectThat(err, Error(Equals("taco")))
-}
-
-func (t *AnyOfTest) AllFalseAndNotEqual() {
-	matcher := AnyOf(
-		&fakeAnyOfMatcher{"", errors.New("foo")},
-		17,
-		&fakeAnyOfMatcher{"", errors.New("foo")},
-		19,
-	)
-
-	err := matcher.Matches(0)
-	ExpectThat(err, Error(Equals("")))
-}
-
-func (t *AnyOfTest) DescriptionForEmptySet() {
-	matcher := AnyOf()
-	ExpectEq("or()", matcher.Description())
-}
-
-func (t *AnyOfTest) DescriptionForNonEmptySet() {
-	matcher := AnyOf(
-		&fakeAnyOfMatcher{"taco", nil},
-		"burrito",
-		&fakeAnyOfMatcher{"enchilada", nil},
-	)
-
-	ExpectEq("or(taco, burrito, enchilada)", matcher.Description())
-}

+ 0 - 53
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/any_test.go

@@ -1,53 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type AnyTest struct {
-}
-
-func init() { RegisterTestSuite(&AnyTest{}) }
-
-////////////////////////////////////////////////////////////////////////
-// Tests
-////////////////////////////////////////////////////////////////////////
-
-func (t *AnyTest) Description() {
-	m := Any()
-	ExpectEq("is anything", m.Description())
-}
-
-func (t *AnyTest) Matches() {
-	var err error
-	m := Any()
-
-	err = m.Matches(nil)
-	ExpectEq(nil, err)
-
-	err = m.Matches(17)
-	ExpectEq(nil, err)
-
-	err = m.Matches("taco")
-	ExpectEq(nil, err)
-}

+ 0 - 61
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/contains.go

@@ -1,61 +0,0 @@
-// Copyright 2012 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"fmt"
-	"reflect"
-)
-
-// Return a matcher that matches arrays slices with at least one element that
-// matches the supplied argument. If the argument x is not itself a Matcher,
-// this is equivalent to Contains(Equals(x)).
-func Contains(x interface{}) Matcher {
-	var result containsMatcher
-	var ok bool
-
-	if result.elementMatcher, ok = x.(Matcher); !ok {
-		result.elementMatcher = Equals(x)
-	}
-
-	return &result
-}
-
-type containsMatcher struct {
-	elementMatcher Matcher
-}
-
-func (m *containsMatcher) Description() string {
-	return fmt.Sprintf("contains: %s", m.elementMatcher.Description())
-}
-
-func (m *containsMatcher) Matches(candidate interface{}) error {
-	// The candidate must be a slice or an array.
-	v := reflect.ValueOf(candidate)
-	if v.Kind() != reflect.Slice && v.Kind() != reflect.Array {
-		return NewFatalError("which is not a slice or array")
-	}
-
-	// Check each element.
-	for i := 0; i < v.Len(); i++ {
-		elem := v.Index(i)
-		if matchErr := m.elementMatcher.Matches(elem.Interface()); matchErr == nil {
-			return nil
-		}
-	}
-
-	return fmt.Errorf("")
-}

+ 0 - 234
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/contains_test.go

@@ -1,234 +0,0 @@
-// Copyright 2012 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type ContainsTest struct{}
-
-func init() { RegisterTestSuite(&ContainsTest{}) }
-
-////////////////////////////////////////////////////////////////////////
-// Tests
-////////////////////////////////////////////////////////////////////////
-
-func (t *ContainsTest) WrongTypeCandidates() {
-	m := Contains("")
-	ExpectEq("contains: ", m.Description())
-
-	var err error
-
-	// Nil candidate
-	err = m.Matches(nil)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("array")))
-	ExpectThat(err, Error(HasSubstr("slice")))
-
-	// String candidate
-	err = m.Matches("")
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("array")))
-	ExpectThat(err, Error(HasSubstr("slice")))
-
-	// Map candidate
-	err = m.Matches(make(map[string]string))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("array")))
-	ExpectThat(err, Error(HasSubstr("slice")))
-}
-
-func (t *ContainsTest) NilArgument() {
-	m := Contains(nil)
-	ExpectEq("contains: is nil", m.Description())
-
-	var c interface{}
-	var err error
-
-	// Empty array of pointers
-	c = [...]*int{}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Empty slice of pointers
-	c = []*int{}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Non-empty array of integers
-	c = [...]int{17, 0, 19}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Non-empty slice of integers
-	c = []int{17, 0, 19}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Non-matching array of pointers
-	c = [...]*int{new(int), new(int)}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Non-matching slice of pointers
-	c = []*int{new(int), new(int)}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Matching array of pointers
-	c = [...]*int{new(int), nil, new(int)}
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Matching slice of pointers
-	c = []*int{new(int), nil, new(int)}
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Non-matching slice of pointers from matching array
-	someArray := [...]*int{new(int), nil, new(int)}
-	c = someArray[0:1]
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-}
-
-func (t *ContainsTest) StringArgument() {
-	m := Contains("taco")
-	ExpectEq("contains: taco", m.Description())
-
-	var c interface{}
-	var err error
-
-	// Non-matching array of strings
-	c = [...]string{"burrito", "enchilada"}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Non-matching slice of strings
-	c = []string{"burrito", "enchilada"}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Matching array of strings
-	c = [...]string{"burrito", "taco", "enchilada"}
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Matching slice of strings
-	c = []string{"burrito", "taco", "enchilada"}
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Non-matching slice of strings from matching array
-	someArray := [...]string{"burrito", "taco", "enchilada"}
-	c = someArray[0:1]
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-}
-
-func (t *ContainsTest) IntegerArgument() {
-	m := Contains(int(17))
-	ExpectEq("contains: 17", m.Description())
-
-	var c interface{}
-	var err error
-
-	// Non-matching array of integers
-	c = [...]int{13, 19}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Non-matching slice of integers
-	c = []int{13, 19}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Matching array of integers
-	c = [...]int{13, 17, 19}
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Matching slice of integers
-	c = []int{13, 17, 19}
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Non-matching slice of integers from matching array
-	someArray := [...]int{13, 17, 19}
-	c = someArray[0:1]
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Non-matching array of floats
-	c = [...]float32{13, 17.5, 19}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Non-matching slice of floats
-	c = []float32{13, 17.5, 19}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Matching array of floats
-	c = [...]float32{13, 17, 19}
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Matching slice of floats
-	c = []float32{13, 17, 19}
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-}
-
-func (t *ContainsTest) MatcherArgument() {
-	m := Contains(HasSubstr("ac"))
-	ExpectEq("contains: has substring \"ac\"", m.Description())
-
-	var c interface{}
-	var err error
-
-	// Non-matching array of strings
-	c = [...]string{"burrito", "enchilada"}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Non-matching slice of strings
-	c = []string{"burrito", "enchilada"}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Matching array of strings
-	c = [...]string{"burrito", "taco", "enchilada"}
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Matching slice of strings
-	c = []string{"burrito", "taco", "enchilada"}
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Non-matching slice of strings from matching array
-	someArray := [...]string{"burrito", "taco", "enchilada"}
-	c = someArray[0:1]
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-}

+ 0 - 88
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/deep_equals.go

@@ -1,88 +0,0 @@
-// Copyright 2012 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"bytes"
-	"errors"
-	"fmt"
-	"reflect"
-)
-
-var byteSliceType reflect.Type = reflect.TypeOf([]byte{})
-
-// DeepEquals returns a matcher that matches based on 'deep equality', as
-// defined by the reflect package. This matcher requires that values have
-// identical types to x.
-func DeepEquals(x interface{}) Matcher {
-	return &deepEqualsMatcher{x}
-}
-
-type deepEqualsMatcher struct {
-	x interface{}
-}
-
-func (m *deepEqualsMatcher) Description() string {
-	xDesc := fmt.Sprintf("%v", m.x)
-	xValue := reflect.ValueOf(m.x)
-
-	// Special case: fmt.Sprintf presents nil slices as "[]", but
-	// reflect.DeepEqual makes a distinction between nil and empty slices. Make
-	// this less confusing.
-	if xValue.Kind() == reflect.Slice && xValue.IsNil() {
-		xDesc = "<nil slice>"
-	}
-
-	return fmt.Sprintf("deep equals: %s", xDesc)
-}
-
-func (m *deepEqualsMatcher) Matches(c interface{}) error {
-	// Make sure the types match.
-	ct := reflect.TypeOf(c)
-	xt := reflect.TypeOf(m.x)
-
-	if ct != xt {
-		return NewFatalError(fmt.Sprintf("which is of type %v", ct))
-	}
-
-	// Special case: handle byte slices more efficiently.
-	cValue := reflect.ValueOf(c)
-	xValue := reflect.ValueOf(m.x)
-
-	if ct == byteSliceType && !cValue.IsNil() && !xValue.IsNil() {
-		xBytes := m.x.([]byte)
-		cBytes := c.([]byte)
-
-		if bytes.Equal(cBytes, xBytes) {
-			return nil
-		}
-
-		return errors.New("")
-	}
-
-	// Defer to the reflect package.
-	if reflect.DeepEqual(m.x, c) {
-		return nil
-	}
-
-	// Special case: if the comparison failed because c is the nil slice, given
-	// an indication of this (since its value is printed as "[]").
-	if cValue.Kind() == reflect.Slice && cValue.IsNil() {
-		return errors.New("which is nil")
-	}
-
-	return errors.New("")
-}

+ 0 - 344
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/deep_equals_test.go

@@ -1,344 +0,0 @@
-// Copyright 2012 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	"bytes"
-	"testing"
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type DeepEqualsTest struct{}
-
-func init() { RegisterTestSuite(&DeepEqualsTest{}) }
-
-////////////////////////////////////////////////////////////////////////
-// Tests
-////////////////////////////////////////////////////////////////////////
-
-func (t *DeepEqualsTest) WrongTypeCandidateWithScalarValue() {
-	var x int = 17
-	m := DeepEquals(x)
-
-	var err error
-
-	// Nil candidate.
-	err = m.Matches(nil)
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("<nil>")))
-
-	// Int alias candidate.
-	type intAlias int
-	err = m.Matches(intAlias(x))
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("intAlias")))
-
-	// String candidate.
-	err = m.Matches("taco")
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("string")))
-
-	// Byte slice candidate.
-	err = m.Matches([]byte{})
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("[]uint8")))
-
-	// Other slice candidate.
-	err = m.Matches([]uint16{})
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("[]uint16")))
-
-	// Unsigned int candidate.
-	err = m.Matches(uint(17))
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("uint")))
-}
-
-func (t *DeepEqualsTest) WrongTypeCandidateWithByteSliceValue() {
-	x := []byte{}
-	m := DeepEquals(x)
-
-	var err error
-
-	// Nil candidate.
-	err = m.Matches(nil)
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("<nil>")))
-
-	// String candidate.
-	err = m.Matches("taco")
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("string")))
-
-	// Slice candidate with wrong value type.
-	err = m.Matches([]uint16{})
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("[]uint16")))
-}
-
-func (t *DeepEqualsTest) WrongTypeCandidateWithOtherSliceValue() {
-	x := []uint16{}
-	m := DeepEquals(x)
-
-	var err error
-
-	// Nil candidate.
-	err = m.Matches(nil)
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("<nil>")))
-
-	// String candidate.
-	err = m.Matches("taco")
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("string")))
-
-	// Byte slice candidate with wrong value type.
-	err = m.Matches([]byte{})
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("[]uint8")))
-
-	// Other slice candidate with wrong value type.
-	err = m.Matches([]uint32{})
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("[]uint32")))
-}
-
-func (t *DeepEqualsTest) WrongTypeCandidateWithNilLiteralValue() {
-	m := DeepEquals(nil)
-
-	var err error
-
-	// String candidate.
-	err = m.Matches("taco")
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("string")))
-
-	// Nil byte slice candidate.
-	err = m.Matches([]byte(nil))
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("[]uint8")))
-
-	// Nil other slice candidate.
-	err = m.Matches([]uint16(nil))
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("type")))
-	ExpectThat(err, Error(HasSubstr("[]uint16")))
-}
-
-func (t *DeepEqualsTest) NilLiteralValue() {
-	m := DeepEquals(nil)
-	ExpectEq("deep equals: <nil>", m.Description())
-
-	var c interface{}
-	var err error
-
-	// Nil literal candidate.
-	c = nil
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-}
-
-func (t *DeepEqualsTest) IntValue() {
-	m := DeepEquals(int(17))
-	ExpectEq("deep equals: 17", m.Description())
-
-	var c interface{}
-	var err error
-
-	// Matching int.
-	c = int(17)
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Non-matching int.
-	c = int(18)
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-}
-
-func (t *DeepEqualsTest) ByteSliceValue() {
-	x := []byte{17, 19}
-	m := DeepEquals(x)
-	ExpectEq("deep equals: [17 19]", m.Description())
-
-	var c []byte
-	var err error
-
-	// Matching.
-	c = make([]byte, len(x))
-	AssertEq(len(x), copy(c, x))
-
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Nil slice.
-	c = []byte(nil)
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("which is nil")))
-
-	// Prefix.
-	AssertGt(len(x), 1)
-	c = make([]byte, len(x)-1)
-	AssertEq(len(x)-1, copy(c, x))
-
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Suffix.
-	c = make([]byte, len(x)+1)
-	AssertEq(len(x), copy(c, x))
-
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-}
-
-func (t *DeepEqualsTest) OtherSliceValue() {
-	x := []uint16{17, 19}
-	m := DeepEquals(x)
-	ExpectEq("deep equals: [17 19]", m.Description())
-
-	var c []uint16
-	var err error
-
-	// Matching.
-	c = make([]uint16, len(x))
-	AssertEq(len(x), copy(c, x))
-
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Nil slice.
-	c = []uint16(nil)
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("which is nil")))
-
-	// Prefix.
-	AssertGt(len(x), 1)
-	c = make([]uint16, len(x)-1)
-	AssertEq(len(x)-1, copy(c, x))
-
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-
-	// Suffix.
-	c = make([]uint16, len(x)+1)
-	AssertEq(len(x), copy(c, x))
-
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-}
-
-func (t *DeepEqualsTest) NilByteSliceValue() {
-	x := []byte(nil)
-	m := DeepEquals(x)
-	ExpectEq("deep equals: <nil slice>", m.Description())
-
-	var c []byte
-	var err error
-
-	// Nil slice.
-	c = []byte(nil)
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Non-nil slice.
-	c = []byte{}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-}
-
-func (t *DeepEqualsTest) NilOtherSliceValue() {
-	x := []uint16(nil)
-	m := DeepEquals(x)
-	ExpectEq("deep equals: <nil slice>", m.Description())
-
-	var c []uint16
-	var err error
-
-	// Nil slice.
-	c = []uint16(nil)
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Non-nil slice.
-	c = []uint16{}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("")))
-}
-
-////////////////////////////////////////////////////////////////////////
-// Benchmarks
-////////////////////////////////////////////////////////////////////////
-
-func benchmarkWithSize(b *testing.B, size int) {
-	b.StopTimer()
-	buf := bytes.Repeat([]byte{0x01}, size)
-	bufCopy := make([]byte, size)
-	copy(bufCopy, buf)
-
-	matcher := DeepEquals(buf)
-	b.StartTimer()
-
-	for i := 0; i < b.N; i++ {
-		matcher.Matches(bufCopy)
-	}
-
-	b.SetBytes(int64(size))
-}
-
-func BenchmarkShortByteSlice(b *testing.B) {
-	benchmarkWithSize(b, 256)
-}
-
-func BenchmarkLongByteSlice(b *testing.B) {
-	benchmarkWithSize(b, 1<<24)
-}

+ 0 - 91
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/elements_are.go

@@ -1,91 +0,0 @@
-// Copyright 2012 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"errors"
-	"fmt"
-	"reflect"
-	"strings"
-)
-
-// Given a list of arguments M, ElementsAre returns a matcher that matches
-// arrays and slices A where all of the following hold:
-//
-//  *  A is the same length as M.
-//
-//  *  For each i < len(A) where M[i] is a matcher, A[i] matches M[i].
-//
-//  *  For each i < len(A) where M[i] is not a matcher, A[i] matches
-//     Equals(M[i]).
-//
-func ElementsAre(M ...interface{}) Matcher {
-	// Copy over matchers, or convert to Equals(x) for non-matcher x.
-	subMatchers := make([]Matcher, len(M))
-	for i, x := range M {
-		if matcher, ok := x.(Matcher); ok {
-			subMatchers[i] = matcher
-			continue
-		}
-
-		subMatchers[i] = Equals(x)
-	}
-
-	return &elementsAreMatcher{subMatchers}
-}
-
-type elementsAreMatcher struct {
-	subMatchers []Matcher
-}
-
-func (m *elementsAreMatcher) Description() string {
-	subDescs := make([]string, len(m.subMatchers))
-	for i, sm := range m.subMatchers {
-		subDescs[i] = sm.Description()
-	}
-
-	return fmt.Sprintf("elements are: [%s]", strings.Join(subDescs, ", "))
-}
-
-func (m *elementsAreMatcher) Matches(candidates interface{}) error {
-	// The candidate must be a slice or an array.
-	v := reflect.ValueOf(candidates)
-	if v.Kind() != reflect.Slice && v.Kind() != reflect.Array {
-		return NewFatalError("which is not a slice or array")
-	}
-
-	// The length must be correct.
-	if v.Len() != len(m.subMatchers) {
-		return errors.New(fmt.Sprintf("which is of length %d", v.Len()))
-	}
-
-	// Check each element.
-	for i, subMatcher := range m.subMatchers {
-		c := v.Index(i)
-		if matchErr := subMatcher.Matches(c.Interface()); matchErr != nil {
-			// Return an errors indicating which element doesn't match. If the
-			// matcher error was fatal, make this one fatal too.
-			err := errors.New(fmt.Sprintf("whose element %d doesn't match", i))
-			if _, isFatal := matchErr.(*FatalError); isFatal {
-				err = NewFatalError(err.Error())
-			}
-
-			return err
-		}
-	}
-
-	return nil
-}

+ 0 - 208
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/elements_are_test.go

@@ -1,208 +0,0 @@
-// Copyright 2012 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type ElementsAreTest struct {
-}
-
-func init() { RegisterTestSuite(&ElementsAreTest{}) }
-
-////////////////////////////////////////////////////////////////////////
-// Tests
-////////////////////////////////////////////////////////////////////////
-
-func (t *ElementsAreTest) EmptySet() {
-	m := ElementsAre()
-	ExpectEq("elements are: []", m.Description())
-
-	var c []interface{}
-	var err error
-
-	// No candidates.
-	c = []interface{}{}
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// One candidate.
-	c = []interface{}{17}
-	err = m.Matches(c)
-	ExpectThat(err, Error(HasSubstr("length 1")))
-}
-
-func (t *ElementsAreTest) OneMatcher() {
-	m := ElementsAre(LessThan(17))
-	ExpectEq("elements are: [less than 17]", m.Description())
-
-	var c []interface{}
-	var err error
-
-	// No candidates.
-	c = []interface{}{}
-	err = m.Matches(c)
-	ExpectThat(err, Error(HasSubstr("length 0")))
-
-	// Matching candidate.
-	c = []interface{}{16}
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Non-matching candidate.
-	c = []interface{}{19}
-	err = m.Matches(c)
-	ExpectNe(nil, err)
-
-	// Two candidates.
-	c = []interface{}{17, 19}
-	err = m.Matches(c)
-	ExpectThat(err, Error(HasSubstr("length 2")))
-}
-
-func (t *ElementsAreTest) OneValue() {
-	m := ElementsAre(17)
-	ExpectEq("elements are: [17]", m.Description())
-
-	var c []interface{}
-	var err error
-
-	// No candidates.
-	c = []interface{}{}
-	err = m.Matches(c)
-	ExpectThat(err, Error(HasSubstr("length 0")))
-
-	// Matching int.
-	c = []interface{}{int(17)}
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Matching float.
-	c = []interface{}{float32(17)}
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// Non-matching candidate.
-	c = []interface{}{19}
-	err = m.Matches(c)
-	ExpectNe(nil, err)
-
-	// Two candidates.
-	c = []interface{}{17, 19}
-	err = m.Matches(c)
-	ExpectThat(err, Error(HasSubstr("length 2")))
-}
-
-func (t *ElementsAreTest) MultipleElements() {
-	m := ElementsAre("taco", LessThan(17))
-	ExpectEq("elements are: [taco, less than 17]", m.Description())
-
-	var c []interface{}
-	var err error
-
-	// One candidate.
-	c = []interface{}{17}
-	err = m.Matches(c)
-	ExpectThat(err, Error(HasSubstr("length 1")))
-
-	// Both matching.
-	c = []interface{}{"taco", 16}
-	err = m.Matches(c)
-	ExpectEq(nil, err)
-
-	// First non-matching.
-	c = []interface{}{"burrito", 16}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("whose element 0 doesn't match")))
-
-	// Second non-matching.
-	c = []interface{}{"taco", 17}
-	err = m.Matches(c)
-	ExpectThat(err, Error(Equals("whose element 1 doesn't match")))
-
-	// Three candidates.
-	c = []interface{}{"taco", 17, 19}
-	err = m.Matches(c)
-	ExpectThat(err, Error(HasSubstr("length 3")))
-}
-
-func (t *ElementsAreTest) ArrayCandidates() {
-	m := ElementsAre("taco", LessThan(17))
-
-	var err error
-
-	// One candidate.
-	err = m.Matches([1]interface{}{"taco"})
-	ExpectThat(err, Error(HasSubstr("length 1")))
-
-	// Both matching.
-	err = m.Matches([2]interface{}{"taco", 16})
-	ExpectEq(nil, err)
-
-	// First non-matching.
-	err = m.Matches([2]interface{}{"burrito", 16})
-	ExpectThat(err, Error(Equals("whose element 0 doesn't match")))
-}
-
-func (t *ElementsAreTest) WrongTypeCandidate() {
-	m := ElementsAre("taco")
-
-	var err error
-
-	// String candidate.
-	err = m.Matches("taco")
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("array")))
-	ExpectThat(err, Error(HasSubstr("slice")))
-
-	// Map candidate.
-	err = m.Matches(map[string]string{})
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("array")))
-	ExpectThat(err, Error(HasSubstr("slice")))
-
-	// Nil candidate.
-	err = m.Matches(nil)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("array")))
-	ExpectThat(err, Error(HasSubstr("slice")))
-}
-
-func (t *ElementsAreTest) PropagatesFatality() {
-	m := ElementsAre(LessThan(17))
-	ExpectEq("elements are: [less than 17]", m.Description())
-
-	var c []interface{}
-	var err error
-
-	// Non-fatal error.
-	c = []interface{}{19}
-	err = m.Matches(c)
-	AssertNe(nil, err)
-	ExpectFalse(isFatal(err))
-
-	// Fatal error.
-	c = []interface{}{"taco"}
-	err = m.Matches(c)
-	AssertNe(nil, err)
-	ExpectTrue(isFatal(err))
-}

+ 0 - 529
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/equals.go

@@ -1,529 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"errors"
-	"fmt"
-	"math"
-	"reflect"
-)
-
-// Equals(x) returns a matcher that matches values v such that v and x are
-// equivalent. This includes the case when the comparison v == x using Go's
-// built-in comparison operator is legal, but for convenience the following
-// rules also apply:
-//
-//  *  Type checking is done based on underlying types rather than actual
-//     types, so that e.g. two aliases for string can be compared:
-//
-//         type stringAlias1 string
-//         type stringAlias2 string
-//
-//         a := "taco"
-//         b := stringAlias1("taco")
-//         c := stringAlias2("taco")
-//
-//         ExpectTrue(a == b)  // Legal, passes
-//         ExpectTrue(b == c)  // Illegal, doesn't compile
-//
-//         ExpectThat(a, Equals(b))  // Passes
-//         ExpectThat(b, Equals(c))  // Passes
-//
-//  *  Values of numeric type are treated as if they were abstract numbers, and
-//     compared accordingly. Therefore Equals(17) will match int(17),
-//     int16(17), uint(17), float32(17), complex64(17), and so on.
-//
-// If you want a stricter matcher that contains no such cleverness, see
-// IdenticalTo instead.
-func Equals(x interface{}) Matcher {
-	v := reflect.ValueOf(x)
-
-	// The == operator is not defined for array or struct types.
-	if v.Kind() == reflect.Array || v.Kind() == reflect.Struct {
-		panic(fmt.Sprintf("oglematchers.Equals: unsupported kind %v", v.Kind()))
-	}
-
-	// The == operator is not defined for non-nil slices.
-	if v.Kind() == reflect.Slice && v.Pointer() != uintptr(0) {
-		panic(fmt.Sprintf("oglematchers.Equals: non-nil slice"))
-	}
-
-	return &equalsMatcher{v}
-}
-
-type equalsMatcher struct {
-	expectedValue reflect.Value
-}
-
-////////////////////////////////////////////////////////////////////////
-// Numeric types
-////////////////////////////////////////////////////////////////////////
-
-func isSignedInteger(v reflect.Value) bool {
-	k := v.Kind()
-	return k >= reflect.Int && k <= reflect.Int64
-}
-
-func isUnsignedInteger(v reflect.Value) bool {
-	k := v.Kind()
-	return k >= reflect.Uint && k <= reflect.Uint64
-}
-
-func isInteger(v reflect.Value) bool {
-	return isSignedInteger(v) || isUnsignedInteger(v)
-}
-
-func isFloat(v reflect.Value) bool {
-	k := v.Kind()
-	return k == reflect.Float32 || k == reflect.Float64
-}
-
-func isComplex(v reflect.Value) bool {
-	k := v.Kind()
-	return k == reflect.Complex64 || k == reflect.Complex128
-}
-
-func checkAgainstInt64(e int64, c reflect.Value) (err error) {
-	err = errors.New("")
-
-	switch {
-	case isSignedInteger(c):
-		if c.Int() == e {
-			err = nil
-		}
-
-	case isUnsignedInteger(c):
-		u := c.Uint()
-		if u <= math.MaxInt64 && int64(u) == e {
-			err = nil
-		}
-
-	// Turn around the various floating point types so that the checkAgainst*
-	// functions for them can deal with precision issues.
-	case isFloat(c), isComplex(c):
-		return Equals(c.Interface()).Matches(e)
-
-	default:
-		err = NewFatalError("which is not numeric")
-	}
-
-	return
-}
-
-func checkAgainstUint64(e uint64, c reflect.Value) (err error) {
-	err = errors.New("")
-
-	switch {
-	case isSignedInteger(c):
-		i := c.Int()
-		if i >= 0 && uint64(i) == e {
-			err = nil
-		}
-
-	case isUnsignedInteger(c):
-		if c.Uint() == e {
-			err = nil
-		}
-
-	// Turn around the various floating point types so that the checkAgainst*
-	// functions for them can deal with precision issues.
-	case isFloat(c), isComplex(c):
-		return Equals(c.Interface()).Matches(e)
-
-	default:
-		err = NewFatalError("which is not numeric")
-	}
-
-	return
-}
-
-func checkAgainstFloat32(e float32, c reflect.Value) (err error) {
-	err = errors.New("")
-
-	switch {
-	case isSignedInteger(c):
-		if float32(c.Int()) == e {
-			err = nil
-		}
-
-	case isUnsignedInteger(c):
-		if float32(c.Uint()) == e {
-			err = nil
-		}
-
-	case isFloat(c):
-		// Compare using float32 to avoid a false sense of precision; otherwise
-		// e.g. Equals(float32(0.1)) won't match float32(0.1).
-		if float32(c.Float()) == e {
-			err = nil
-		}
-
-	case isComplex(c):
-		comp := c.Complex()
-		rl := real(comp)
-		im := imag(comp)
-
-		// Compare using float32 to avoid a false sense of precision; otherwise
-		// e.g. Equals(float32(0.1)) won't match (0.1 + 0i).
-		if im == 0 && float32(rl) == e {
-			err = nil
-		}
-
-	default:
-		err = NewFatalError("which is not numeric")
-	}
-
-	return
-}
-
-func checkAgainstFloat64(e float64, c reflect.Value) (err error) {
-	err = errors.New("")
-
-	ck := c.Kind()
-
-	switch {
-	case isSignedInteger(c):
-		if float64(c.Int()) == e {
-			err = nil
-		}
-
-	case isUnsignedInteger(c):
-		if float64(c.Uint()) == e {
-			err = nil
-		}
-
-	// If the actual value is lower precision, turn the comparison around so we
-	// apply the low-precision rules. Otherwise, e.g. Equals(0.1) may not match
-	// float32(0.1).
-	case ck == reflect.Float32 || ck == reflect.Complex64:
-		return Equals(c.Interface()).Matches(e)
-
-		// Otherwise, compare with double precision.
-	case isFloat(c):
-		if c.Float() == e {
-			err = nil
-		}
-
-	case isComplex(c):
-		comp := c.Complex()
-		rl := real(comp)
-		im := imag(comp)
-
-		if im == 0 && rl == e {
-			err = nil
-		}
-
-	default:
-		err = NewFatalError("which is not numeric")
-	}
-
-	return
-}
-
-func checkAgainstComplex64(e complex64, c reflect.Value) (err error) {
-	err = errors.New("")
-	realPart := real(e)
-	imaginaryPart := imag(e)
-
-	switch {
-	case isInteger(c) || isFloat(c):
-		// If we have no imaginary part, then we should just compare against the
-		// real part. Otherwise, we can't be equal.
-		if imaginaryPart != 0 {
-			return
-		}
-
-		return checkAgainstFloat32(realPart, c)
-
-	case isComplex(c):
-		// Compare using complex64 to avoid a false sense of precision; otherwise
-		// e.g. Equals(0.1 + 0i) won't match float32(0.1).
-		if complex64(c.Complex()) == e {
-			err = nil
-		}
-
-	default:
-		err = NewFatalError("which is not numeric")
-	}
-
-	return
-}
-
-func checkAgainstComplex128(e complex128, c reflect.Value) (err error) {
-	err = errors.New("")
-	realPart := real(e)
-	imaginaryPart := imag(e)
-
-	switch {
-	case isInteger(c) || isFloat(c):
-		// If we have no imaginary part, then we should just compare against the
-		// real part. Otherwise, we can't be equal.
-		if imaginaryPart != 0 {
-			return
-		}
-
-		return checkAgainstFloat64(realPart, c)
-
-	case isComplex(c):
-		if c.Complex() == e {
-			err = nil
-		}
-
-	default:
-		err = NewFatalError("which is not numeric")
-	}
-
-	return
-}
-
-////////////////////////////////////////////////////////////////////////
-// Other types
-////////////////////////////////////////////////////////////////////////
-
-func checkAgainstBool(e bool, c reflect.Value) (err error) {
-	if c.Kind() != reflect.Bool {
-		err = NewFatalError("which is not a bool")
-		return
-	}
-
-	err = errors.New("")
-	if c.Bool() == e {
-		err = nil
-	}
-	return
-}
-
-func checkAgainstUintptr(e uintptr, c reflect.Value) (err error) {
-	if c.Kind() != reflect.Uintptr {
-		err = NewFatalError("which is not a uintptr")
-		return
-	}
-
-	err = errors.New("")
-	if uintptr(c.Uint()) == e {
-		err = nil
-	}
-	return
-}
-
-func checkAgainstChan(e reflect.Value, c reflect.Value) (err error) {
-	// Create a description of e's type, e.g. "chan int".
-	typeStr := fmt.Sprintf("%s %s", e.Type().ChanDir(), e.Type().Elem())
-
-	// Make sure c is a chan of the correct type.
-	if c.Kind() != reflect.Chan ||
-		c.Type().ChanDir() != e.Type().ChanDir() ||
-		c.Type().Elem() != e.Type().Elem() {
-		err = NewFatalError(fmt.Sprintf("which is not a %s", typeStr))
-		return
-	}
-
-	err = errors.New("")
-	if c.Pointer() == e.Pointer() {
-		err = nil
-	}
-	return
-}
-
-func checkAgainstFunc(e reflect.Value, c reflect.Value) (err error) {
-	// Make sure c is a function.
-	if c.Kind() != reflect.Func {
-		err = NewFatalError("which is not a function")
-		return
-	}
-
-	err = errors.New("")
-	if c.Pointer() == e.Pointer() {
-		err = nil
-	}
-	return
-}
-
-func checkAgainstMap(e reflect.Value, c reflect.Value) (err error) {
-	// Make sure c is a map.
-	if c.Kind() != reflect.Map {
-		err = NewFatalError("which is not a map")
-		return
-	}
-
-	err = errors.New("")
-	if c.Pointer() == e.Pointer() {
-		err = nil
-	}
-	return
-}
-
-func checkAgainstPtr(e reflect.Value, c reflect.Value) (err error) {
-	// Create a description of e's type, e.g. "*int".
-	typeStr := fmt.Sprintf("*%v", e.Type().Elem())
-
-	// Make sure c is a pointer of the correct type.
-	if c.Kind() != reflect.Ptr ||
-		c.Type().Elem() != e.Type().Elem() {
-		err = NewFatalError(fmt.Sprintf("which is not a %s", typeStr))
-		return
-	}
-
-	err = errors.New("")
-	if c.Pointer() == e.Pointer() {
-		err = nil
-	}
-	return
-}
-
-func checkAgainstSlice(e reflect.Value, c reflect.Value) (err error) {
-	// Create a description of e's type, e.g. "[]int".
-	typeStr := fmt.Sprintf("[]%v", e.Type().Elem())
-
-	// Make sure c is a slice of the correct type.
-	if c.Kind() != reflect.Slice ||
-		c.Type().Elem() != e.Type().Elem() {
-		err = NewFatalError(fmt.Sprintf("which is not a %s", typeStr))
-		return
-	}
-
-	err = errors.New("")
-	if c.Pointer() == e.Pointer() {
-		err = nil
-	}
-	return
-}
-
-func checkAgainstString(e reflect.Value, c reflect.Value) (err error) {
-	// Make sure c is a string.
-	if c.Kind() != reflect.String {
-		err = NewFatalError("which is not a string")
-		return
-	}
-
-	err = errors.New("")
-	if c.String() == e.String() {
-		err = nil
-	}
-	return
-}
-
-func checkAgainstUnsafePointer(e reflect.Value, c reflect.Value) (err error) {
-	// Make sure c is a pointer.
-	if c.Kind() != reflect.UnsafePointer {
-		err = NewFatalError("which is not a unsafe.Pointer")
-		return
-	}
-
-	err = errors.New("")
-	if c.Pointer() == e.Pointer() {
-		err = nil
-	}
-	return
-}
-
-func checkForNil(c reflect.Value) (err error) {
-	err = errors.New("")
-
-	// Make sure it is legal to call IsNil.
-	switch c.Kind() {
-	case reflect.Invalid:
-	case reflect.Chan:
-	case reflect.Func:
-	case reflect.Interface:
-	case reflect.Map:
-	case reflect.Ptr:
-	case reflect.Slice:
-
-	default:
-		err = NewFatalError("which cannot be compared to nil")
-		return
-	}
-
-	// Ask whether the value is nil. Handle a nil literal (kind Invalid)
-	// specially, since it's not legal to call IsNil there.
-	if c.Kind() == reflect.Invalid || c.IsNil() {
-		err = nil
-	}
-	return
-}
-
-////////////////////////////////////////////////////////////////////////
-// Public implementation
-////////////////////////////////////////////////////////////////////////
-
-func (m *equalsMatcher) Matches(candidate interface{}) error {
-	e := m.expectedValue
-	c := reflect.ValueOf(candidate)
-	ek := e.Kind()
-
-	switch {
-	case ek == reflect.Bool:
-		return checkAgainstBool(e.Bool(), c)
-
-	case isSignedInteger(e):
-		return checkAgainstInt64(e.Int(), c)
-
-	case isUnsignedInteger(e):
-		return checkAgainstUint64(e.Uint(), c)
-
-	case ek == reflect.Uintptr:
-		return checkAgainstUintptr(uintptr(e.Uint()), c)
-
-	case ek == reflect.Float32:
-		return checkAgainstFloat32(float32(e.Float()), c)
-
-	case ek == reflect.Float64:
-		return checkAgainstFloat64(e.Float(), c)
-
-	case ek == reflect.Complex64:
-		return checkAgainstComplex64(complex64(e.Complex()), c)
-
-	case ek == reflect.Complex128:
-		return checkAgainstComplex128(complex128(e.Complex()), c)
-
-	case ek == reflect.Chan:
-		return checkAgainstChan(e, c)
-
-	case ek == reflect.Func:
-		return checkAgainstFunc(e, c)
-
-	case ek == reflect.Map:
-		return checkAgainstMap(e, c)
-
-	case ek == reflect.Ptr:
-		return checkAgainstPtr(e, c)
-
-	case ek == reflect.Slice:
-		return checkAgainstSlice(e, c)
-
-	case ek == reflect.String:
-		return checkAgainstString(e, c)
-
-	case ek == reflect.UnsafePointer:
-		return checkAgainstUnsafePointer(e, c)
-
-	case ek == reflect.Invalid:
-		return checkForNil(c)
-	}
-
-	panic(fmt.Sprintf("equalsMatcher.Matches: unexpected kind: %v", ek))
-}
-
-func (m *equalsMatcher) Description() string {
-	// Special case: handle nil.
-	if !m.expectedValue.IsValid() {
-		return "is nil"
-	}
-
-	return fmt.Sprintf("%v", m.expectedValue.Interface())
-}

+ 0 - 3785
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/equals_test.go

@@ -1,3785 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	"fmt"
-	"math"
-	"unsafe"
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-var someInt int = -17
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type EqualsTest struct {
-}
-
-func init() { RegisterTestSuite(&EqualsTest{}) }
-
-type equalsTestCase struct {
-	candidate      interface{}
-	expectedResult bool
-	shouldBeFatal  bool
-	expectedError  string
-}
-
-func (t *EqualsTest) checkTestCases(matcher Matcher, cases []equalsTestCase) {
-	for i, c := range cases {
-		err := matcher.Matches(c.candidate)
-		ExpectEq(c.expectedResult, (err == nil), "Result for case %d: %v", i, c)
-
-		if err == nil {
-			continue
-		}
-
-		_, isFatal := err.(*FatalError)
-		ExpectEq(c.shouldBeFatal, isFatal, "Fatality for case %d: %v", i, c)
-
-		ExpectThat(err, Error(Equals(c.expectedError)), "Case %d: %v", i, c)
-	}
-}
-
-////////////////////////////////////////////////////////////////////////
-// nil
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) EqualsNil() {
-	matcher := Equals(nil)
-	ExpectEq("is nil", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Legal types
-		equalsTestCase{nil, true, false, ""},
-		equalsTestCase{chan int(nil), true, false, ""},
-		equalsTestCase{(func())(nil), true, false, ""},
-		equalsTestCase{interface{}(nil), true, false, ""},
-		equalsTestCase{map[int]int(nil), true, false, ""},
-		equalsTestCase{(*int)(nil), true, false, ""},
-		equalsTestCase{[]int(nil), true, false, ""},
-
-		equalsTestCase{make(chan int), false, false, ""},
-		equalsTestCase{func() {}, false, false, ""},
-		equalsTestCase{map[int]int{}, false, false, ""},
-		equalsTestCase{&someInt, false, false, ""},
-		equalsTestCase{[]int{}, false, false, ""},
-
-		// Illegal types
-		equalsTestCase{17, false, true, "which cannot be compared to nil"},
-		equalsTestCase{int8(17), false, true, "which cannot be compared to nil"},
-		equalsTestCase{uintptr(17), false, true, "which cannot be compared to nil"},
-		equalsTestCase{[...]int{}, false, true, "which cannot be compared to nil"},
-		equalsTestCase{"taco", false, true, "which cannot be compared to nil"},
-		equalsTestCase{equalsTestCase{}, false, true, "which cannot be compared to nil"},
-		equalsTestCase{unsafe.Pointer(&someInt), false, true, "which cannot be compared to nil"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// Integer literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NegativeIntegerLiteral() {
-	// -2^30
-	matcher := Equals(-1073741824)
-	ExpectEq("-1073741824", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of -1073741824.
-		equalsTestCase{-1073741824, true, false, ""},
-		equalsTestCase{-1073741824.0, true, false, ""},
-		equalsTestCase{-1073741824 + 0i, true, false, ""},
-		equalsTestCase{int(-1073741824), true, false, ""},
-		equalsTestCase{int32(-1073741824), true, false, ""},
-		equalsTestCase{int64(-1073741824), true, false, ""},
-		equalsTestCase{float32(-1073741824), true, false, ""},
-		equalsTestCase{float64(-1073741824), true, false, ""},
-		equalsTestCase{complex64(-1073741824), true, false, ""},
-		equalsTestCase{complex128(-1073741824), true, false, ""},
-		equalsTestCase{interface{}(int(-1073741824)), true, false, ""},
-
-		// Values that would be -1073741824 in two's complement.
-		equalsTestCase{uint((1 << 32) - 1073741824), false, false, ""},
-		equalsTestCase{uint32((1 << 32) - 1073741824), false, false, ""},
-		equalsTestCase{uint64((1 << 64) - 1073741824), false, false, ""},
-
-		// Non-equal values of signed integer type.
-		equalsTestCase{int(-1073741823), false, false, ""},
-		equalsTestCase{int32(-1073741823), false, false, ""},
-		equalsTestCase{int64(-1073741823), false, false, ""},
-
-		// Non-equal values of other numeric types.
-		equalsTestCase{float64(-1073741824.1), false, false, ""},
-		equalsTestCase{float64(-1073741823.9), false, false, ""},
-		equalsTestCase{complex128(-1073741823), false, false, ""},
-		equalsTestCase{complex128(-1073741824 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) PositiveIntegerLiteral() {
-	// 2^30
-	matcher := Equals(1073741824)
-	ExpectEq("1073741824", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of 1073741824.
-		equalsTestCase{1073741824, true, false, ""},
-		equalsTestCase{1073741824.0, true, false, ""},
-		equalsTestCase{1073741824 + 0i, true, false, ""},
-		equalsTestCase{int(1073741824), true, false, ""},
-		equalsTestCase{uint(1073741824), true, false, ""},
-		equalsTestCase{int32(1073741824), true, false, ""},
-		equalsTestCase{int64(1073741824), true, false, ""},
-		equalsTestCase{uint32(1073741824), true, false, ""},
-		equalsTestCase{uint64(1073741824), true, false, ""},
-		equalsTestCase{float32(1073741824), true, false, ""},
-		equalsTestCase{float64(1073741824), true, false, ""},
-		equalsTestCase{complex64(1073741824), true, false, ""},
-		equalsTestCase{complex128(1073741824), true, false, ""},
-		equalsTestCase{interface{}(int(1073741824)), true, false, ""},
-		equalsTestCase{interface{}(uint(1073741824)), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int(1073741823), false, false, ""},
-		equalsTestCase{int32(1073741823), false, false, ""},
-		equalsTestCase{int64(1073741823), false, false, ""},
-		equalsTestCase{float64(1073741824.1), false, false, ""},
-		equalsTestCase{float64(1073741823.9), false, false, ""},
-		equalsTestCase{complex128(1073741823), false, false, ""},
-		equalsTestCase{complex128(1073741824 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// Floating point literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NegativeIntegralFloatingPointLiteral() {
-	// -2^30
-	matcher := Equals(-1073741824.0)
-	ExpectEq("-1.073741824e+09", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of -1073741824.
-		equalsTestCase{-1073741824, true, false, ""},
-		equalsTestCase{-1073741824.0, true, false, ""},
-		equalsTestCase{-1073741824 + 0i, true, false, ""},
-		equalsTestCase{int(-1073741824), true, false, ""},
-		equalsTestCase{int32(-1073741824), true, false, ""},
-		equalsTestCase{int64(-1073741824), true, false, ""},
-		equalsTestCase{float32(-1073741824), true, false, ""},
-		equalsTestCase{float64(-1073741824), true, false, ""},
-		equalsTestCase{complex64(-1073741824), true, false, ""},
-		equalsTestCase{complex128(-1073741824), true, false, ""},
-		equalsTestCase{interface{}(int(-1073741824)), true, false, ""},
-		equalsTestCase{interface{}(float64(-1073741824)), true, false, ""},
-
-		// Values that would be -1073741824 in two's complement.
-		equalsTestCase{uint((1 << 32) - 1073741824), false, false, ""},
-		equalsTestCase{uint32((1 << 32) - 1073741824), false, false, ""},
-		equalsTestCase{uint64((1 << 64) - 1073741824), false, false, ""},
-
-		// Non-equal values of signed integer type.
-		equalsTestCase{int(-1073741823), false, false, ""},
-		equalsTestCase{int32(-1073741823), false, false, ""},
-		equalsTestCase{int64(-1073741823), false, false, ""},
-
-		// Non-equal values of other numeric types.
-		equalsTestCase{float64(-1073741824.1), false, false, ""},
-		equalsTestCase{float64(-1073741823.9), false, false, ""},
-		equalsTestCase{complex128(-1073741823), false, false, ""},
-		equalsTestCase{complex128(-1073741824 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) PositiveIntegralFloatingPointLiteral() {
-	// 2^30
-	matcher := Equals(1073741824.0)
-	ExpectEq("1.073741824e+09", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of 1073741824.
-		equalsTestCase{1073741824, true, false, ""},
-		equalsTestCase{1073741824.0, true, false, ""},
-		equalsTestCase{1073741824 + 0i, true, false, ""},
-		equalsTestCase{int(1073741824), true, false, ""},
-		equalsTestCase{int32(1073741824), true, false, ""},
-		equalsTestCase{int64(1073741824), true, false, ""},
-		equalsTestCase{uint(1073741824), true, false, ""},
-		equalsTestCase{uint32(1073741824), true, false, ""},
-		equalsTestCase{uint64(1073741824), true, false, ""},
-		equalsTestCase{float32(1073741824), true, false, ""},
-		equalsTestCase{float64(1073741824), true, false, ""},
-		equalsTestCase{complex64(1073741824), true, false, ""},
-		equalsTestCase{complex128(1073741824), true, false, ""},
-		equalsTestCase{interface{}(int(1073741824)), true, false, ""},
-		equalsTestCase{interface{}(float64(1073741824)), true, false, ""},
-
-		// Values that would be 1073741824 in two's complement.
-		equalsTestCase{uint((1 << 32) - 1073741824), false, false, ""},
-		equalsTestCase{uint32((1 << 32) - 1073741824), false, false, ""},
-		equalsTestCase{uint64((1 << 64) - 1073741824), false, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int(1073741823), false, false, ""},
-		equalsTestCase{int32(1073741823), false, false, ""},
-		equalsTestCase{int64(1073741823), false, false, ""},
-		equalsTestCase{uint(1073741823), false, false, ""},
-		equalsTestCase{uint32(1073741823), false, false, ""},
-		equalsTestCase{uint64(1073741823), false, false, ""},
-		equalsTestCase{float64(1073741824.1), false, false, ""},
-		equalsTestCase{float64(1073741823.9), false, false, ""},
-		equalsTestCase{complex128(1073741823), false, false, ""},
-		equalsTestCase{complex128(1073741824 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) NonIntegralFloatingPointLiteral() {
-	matcher := Equals(17.1)
-	ExpectEq("17.1", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of 17.1.
-		equalsTestCase{17.1, true, false, ""},
-		equalsTestCase{17.1, true, false, ""},
-		equalsTestCase{17.1 + 0i, true, false, ""},
-		equalsTestCase{float32(17.1), true, false, ""},
-		equalsTestCase{float64(17.1), true, false, ""},
-		equalsTestCase{complex64(17.1), true, false, ""},
-		equalsTestCase{complex128(17.1), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{17, false, false, ""},
-		equalsTestCase{17.2, false, false, ""},
-		equalsTestCase{18, false, false, ""},
-		equalsTestCase{int(17), false, false, ""},
-		equalsTestCase{int(18), false, false, ""},
-		equalsTestCase{int32(17), false, false, ""},
-		equalsTestCase{int64(17), false, false, ""},
-		equalsTestCase{uint(17), false, false, ""},
-		equalsTestCase{uint32(17), false, false, ""},
-		equalsTestCase{uint64(17), false, false, ""},
-		equalsTestCase{complex128(17.1 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// bool
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) False() {
-	matcher := Equals(false)
-	ExpectEq("false", matcher.Description())
-
-	cases := []equalsTestCase{
-		// bools
-		equalsTestCase{false, true, false, ""},
-		equalsTestCase{bool(false), true, false, ""},
-
-		equalsTestCase{true, false, false, ""},
-		equalsTestCase{bool(true), false, false, ""},
-
-		// Other types.
-		equalsTestCase{int(0), false, true, "which is not a bool"},
-		equalsTestCase{int8(0), false, true, "which is not a bool"},
-		equalsTestCase{int16(0), false, true, "which is not a bool"},
-		equalsTestCase{int32(0), false, true, "which is not a bool"},
-		equalsTestCase{int64(0), false, true, "which is not a bool"},
-		equalsTestCase{uint(0), false, true, "which is not a bool"},
-		equalsTestCase{uint8(0), false, true, "which is not a bool"},
-		equalsTestCase{uint16(0), false, true, "which is not a bool"},
-		equalsTestCase{uint32(0), false, true, "which is not a bool"},
-		equalsTestCase{uint64(0), false, true, "which is not a bool"},
-		equalsTestCase{uintptr(0), false, true, "which is not a bool"},
-		equalsTestCase{[...]int{}, false, true, "which is not a bool"},
-		equalsTestCase{make(chan int), false, true, "which is not a bool"},
-		equalsTestCase{func() {}, false, true, "which is not a bool"},
-		equalsTestCase{map[int]int{}, false, true, "which is not a bool"},
-		equalsTestCase{&someInt, false, true, "which is not a bool"},
-		equalsTestCase{[]int{}, false, true, "which is not a bool"},
-		equalsTestCase{"taco", false, true, "which is not a bool"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not a bool"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) True() {
-	matcher := Equals(true)
-	ExpectEq("true", matcher.Description())
-
-	cases := []equalsTestCase{
-		// bools
-		equalsTestCase{true, true, false, ""},
-		equalsTestCase{bool(true), true, false, ""},
-
-		equalsTestCase{false, false, false, ""},
-		equalsTestCase{bool(false), false, false, ""},
-
-		// Other types.
-		equalsTestCase{int(1), false, true, "which is not a bool"},
-		equalsTestCase{int8(1), false, true, "which is not a bool"},
-		equalsTestCase{int16(1), false, true, "which is not a bool"},
-		equalsTestCase{int32(1), false, true, "which is not a bool"},
-		equalsTestCase{int64(1), false, true, "which is not a bool"},
-		equalsTestCase{uint(1), false, true, "which is not a bool"},
-		equalsTestCase{uint8(1), false, true, "which is not a bool"},
-		equalsTestCase{uint16(1), false, true, "which is not a bool"},
-		equalsTestCase{uint32(1), false, true, "which is not a bool"},
-		equalsTestCase{uint64(1), false, true, "which is not a bool"},
-		equalsTestCase{uintptr(1), false, true, "which is not a bool"},
-		equalsTestCase{[...]int{}, false, true, "which is not a bool"},
-		equalsTestCase{make(chan int), false, true, "which is not a bool"},
-		equalsTestCase{func() {}, false, true, "which is not a bool"},
-		equalsTestCase{map[int]int{}, false, true, "which is not a bool"},
-		equalsTestCase{&someInt, false, true, "which is not a bool"},
-		equalsTestCase{[]int{}, false, true, "which is not a bool"},
-		equalsTestCase{"taco", false, true, "which is not a bool"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not a bool"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// int
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NegativeInt() {
-	// -2^30
-	matcher := Equals(int(-1073741824))
-	ExpectEq("-1073741824", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of -1073741824.
-		equalsTestCase{-1073741824, true, false, ""},
-		equalsTestCase{-1073741824.0, true, false, ""},
-		equalsTestCase{-1073741824 + 0i, true, false, ""},
-		equalsTestCase{int(-1073741824), true, false, ""},
-		equalsTestCase{int32(-1073741824), true, false, ""},
-		equalsTestCase{int64(-1073741824), true, false, ""},
-		equalsTestCase{float32(-1073741824), true, false, ""},
-		equalsTestCase{float64(-1073741824), true, false, ""},
-		equalsTestCase{complex64(-1073741824), true, false, ""},
-		equalsTestCase{complex128(-1073741824), true, false, ""},
-		equalsTestCase{interface{}(int(-1073741824)), true, false, ""},
-
-		// Values that would be -1073741824 in two's complement.
-		equalsTestCase{uint((1 << 32) - 1073741824), false, false, ""},
-		equalsTestCase{uint32((1 << 32) - 1073741824), false, false, ""},
-		equalsTestCase{uint64((1 << 64) - 1073741824), false, false, ""},
-
-		// Non-equal values of signed integer type.
-		equalsTestCase{int(-1073741823), false, false, ""},
-		equalsTestCase{int32(-1073741823), false, false, ""},
-		equalsTestCase{int64(-1073741823), false, false, ""},
-
-		// Non-equal values of other numeric types.
-		equalsTestCase{float64(-1073741824.1), false, false, ""},
-		equalsTestCase{float64(-1073741823.9), false, false, ""},
-		equalsTestCase{complex128(-1073741823), false, false, ""},
-		equalsTestCase{complex128(-1073741824 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) PositiveInt() {
-	// 2^30
-	matcher := Equals(int(1073741824))
-	ExpectEq("1073741824", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of 1073741824.
-		equalsTestCase{1073741824, true, false, ""},
-		equalsTestCase{1073741824.0, true, false, ""},
-		equalsTestCase{1073741824 + 0i, true, false, ""},
-		equalsTestCase{int(1073741824), true, false, ""},
-		equalsTestCase{uint(1073741824), true, false, ""},
-		equalsTestCase{int32(1073741824), true, false, ""},
-		equalsTestCase{int64(1073741824), true, false, ""},
-		equalsTestCase{uint32(1073741824), true, false, ""},
-		equalsTestCase{uint64(1073741824), true, false, ""},
-		equalsTestCase{float32(1073741824), true, false, ""},
-		equalsTestCase{float64(1073741824), true, false, ""},
-		equalsTestCase{complex64(1073741824), true, false, ""},
-		equalsTestCase{complex128(1073741824), true, false, ""},
-		equalsTestCase{interface{}(int(1073741824)), true, false, ""},
-		equalsTestCase{interface{}(uint(1073741824)), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int(1073741823), false, false, ""},
-		equalsTestCase{int32(1073741823), false, false, ""},
-		equalsTestCase{int64(1073741823), false, false, ""},
-		equalsTestCase{float64(1073741824.1), false, false, ""},
-		equalsTestCase{float64(1073741823.9), false, false, ""},
-		equalsTestCase{complex128(1073741823), false, false, ""},
-		equalsTestCase{complex128(1073741824 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// int8
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NegativeInt8() {
-	matcher := Equals(int8(-17))
-	ExpectEq("-17", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of -17.
-		equalsTestCase{-17, true, false, ""},
-		equalsTestCase{-17.0, true, false, ""},
-		equalsTestCase{-17 + 0i, true, false, ""},
-		equalsTestCase{int(-17), true, false, ""},
-		equalsTestCase{int8(-17), true, false, ""},
-		equalsTestCase{int16(-17), true, false, ""},
-		equalsTestCase{int32(-17), true, false, ""},
-		equalsTestCase{int64(-17), true, false, ""},
-		equalsTestCase{float32(-17), true, false, ""},
-		equalsTestCase{float64(-17), true, false, ""},
-		equalsTestCase{complex64(-17), true, false, ""},
-		equalsTestCase{complex128(-17), true, false, ""},
-		equalsTestCase{interface{}(int(-17)), true, false, ""},
-
-		// Values that would be -17 in two's complement.
-		equalsTestCase{uint((1 << 32) - 17), false, false, ""},
-		equalsTestCase{uint8((1 << 8) - 17), false, false, ""},
-		equalsTestCase{uint16((1 << 16) - 17), false, false, ""},
-		equalsTestCase{uint32((1 << 32) - 17), false, false, ""},
-		equalsTestCase{uint64((1 << 64) - 17), false, false, ""},
-
-		// Non-equal values of signed integer type.
-		equalsTestCase{int(-16), false, false, ""},
-		equalsTestCase{int8(-16), false, false, ""},
-		equalsTestCase{int16(-16), false, false, ""},
-		equalsTestCase{int32(-16), false, false, ""},
-		equalsTestCase{int64(-16), false, false, ""},
-
-		// Non-equal values of other numeric types.
-		equalsTestCase{float32(-17.1), false, false, ""},
-		equalsTestCase{float32(-16.9), false, false, ""},
-		equalsTestCase{complex64(-16), false, false, ""},
-		equalsTestCase{complex64(-17 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr((1 << 32) - 17), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{-17}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{-17}, false, true, "which is not numeric"},
-		equalsTestCase{"-17", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) ZeroInt8() {
-	matcher := Equals(int8(0))
-	ExpectEq("0", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of 0.
-		equalsTestCase{0, true, false, ""},
-		equalsTestCase{0.0, true, false, ""},
-		equalsTestCase{0 + 0i, true, false, ""},
-		equalsTestCase{int(0), true, false, ""},
-		equalsTestCase{int8(0), true, false, ""},
-		equalsTestCase{int16(0), true, false, ""},
-		equalsTestCase{int32(0), true, false, ""},
-		equalsTestCase{int64(0), true, false, ""},
-		equalsTestCase{float32(0), true, false, ""},
-		equalsTestCase{float64(0), true, false, ""},
-		equalsTestCase{complex64(0), true, false, ""},
-		equalsTestCase{complex128(0), true, false, ""},
-		equalsTestCase{interface{}(int(0)), true, false, ""},
-		equalsTestCase{uint(0), true, false, ""},
-		equalsTestCase{uint8(0), true, false, ""},
-		equalsTestCase{uint16(0), true, false, ""},
-		equalsTestCase{uint32(0), true, false, ""},
-		equalsTestCase{uint64(0), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int(1), false, false, ""},
-		equalsTestCase{int8(1), false, false, ""},
-		equalsTestCase{int16(1), false, false, ""},
-		equalsTestCase{int32(1), false, false, ""},
-		equalsTestCase{int64(1), false, false, ""},
-		equalsTestCase{float32(-0.1), false, false, ""},
-		equalsTestCase{float32(0.1), false, false, ""},
-		equalsTestCase{complex64(1), false, false, ""},
-		equalsTestCase{complex64(0 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{0}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{0}, false, true, "which is not numeric"},
-		equalsTestCase{"0", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) PositiveInt8() {
-	matcher := Equals(int8(17))
-	ExpectEq("17", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of 17.
-		equalsTestCase{17, true, false, ""},
-		equalsTestCase{17.0, true, false, ""},
-		equalsTestCase{17 + 0i, true, false, ""},
-		equalsTestCase{int(17), true, false, ""},
-		equalsTestCase{int8(17), true, false, ""},
-		equalsTestCase{int16(17), true, false, ""},
-		equalsTestCase{int32(17), true, false, ""},
-		equalsTestCase{int64(17), true, false, ""},
-		equalsTestCase{float32(17), true, false, ""},
-		equalsTestCase{float64(17), true, false, ""},
-		equalsTestCase{complex64(17), true, false, ""},
-		equalsTestCase{complex128(17), true, false, ""},
-		equalsTestCase{interface{}(int(17)), true, false, ""},
-		equalsTestCase{uint(17), true, false, ""},
-		equalsTestCase{uint8(17), true, false, ""},
-		equalsTestCase{uint16(17), true, false, ""},
-		equalsTestCase{uint32(17), true, false, ""},
-		equalsTestCase{uint64(17), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int(16), false, false, ""},
-		equalsTestCase{int8(16), false, false, ""},
-		equalsTestCase{int16(16), false, false, ""},
-		equalsTestCase{int32(16), false, false, ""},
-		equalsTestCase{int64(16), false, false, ""},
-		equalsTestCase{float32(16.9), false, false, ""},
-		equalsTestCase{float32(17.1), false, false, ""},
-		equalsTestCase{complex64(16), false, false, ""},
-		equalsTestCase{complex64(17 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(17), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{17}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{17}, false, true, "which is not numeric"},
-		equalsTestCase{"17", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// int16
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NegativeInt16() {
-	matcher := Equals(int16(-32766))
-	ExpectEq("-32766", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of -32766.
-		equalsTestCase{-32766, true, false, ""},
-		equalsTestCase{-32766.0, true, false, ""},
-		equalsTestCase{-32766 + 0i, true, false, ""},
-		equalsTestCase{int(-32766), true, false, ""},
-		equalsTestCase{int16(-32766), true, false, ""},
-		equalsTestCase{int32(-32766), true, false, ""},
-		equalsTestCase{int64(-32766), true, false, ""},
-		equalsTestCase{float32(-32766), true, false, ""},
-		equalsTestCase{float64(-32766), true, false, ""},
-		equalsTestCase{complex64(-32766), true, false, ""},
-		equalsTestCase{complex128(-32766), true, false, ""},
-		equalsTestCase{interface{}(int(-32766)), true, false, ""},
-
-		// Values that would be -32766 in two's complement.
-		equalsTestCase{uint((1 << 32) - 32766), false, false, ""},
-		equalsTestCase{uint16((1 << 16) - 32766), false, false, ""},
-		equalsTestCase{uint32((1 << 32) - 32766), false, false, ""},
-		equalsTestCase{uint64((1 << 64) - 32766), false, false, ""},
-
-		// Non-equal values of signed integer type.
-		equalsTestCase{int(-16), false, false, ""},
-		equalsTestCase{int8(-16), false, false, ""},
-		equalsTestCase{int16(-16), false, false, ""},
-		equalsTestCase{int32(-16), false, false, ""},
-		equalsTestCase{int64(-16), false, false, ""},
-
-		// Non-equal values of other numeric types.
-		equalsTestCase{float32(-32766.1), false, false, ""},
-		equalsTestCase{float32(-32765.9), false, false, ""},
-		equalsTestCase{complex64(-32766.1), false, false, ""},
-		equalsTestCase{complex64(-32766 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr((1 << 32) - 32766), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{-32766}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{-32766}, false, true, "which is not numeric"},
-		equalsTestCase{"-32766", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) ZeroInt16() {
-	matcher := Equals(int16(0))
-	ExpectEq("0", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of 0.
-		equalsTestCase{0, true, false, ""},
-		equalsTestCase{0.0, true, false, ""},
-		equalsTestCase{0 + 0i, true, false, ""},
-		equalsTestCase{int(0), true, false, ""},
-		equalsTestCase{int8(0), true, false, ""},
-		equalsTestCase{int16(0), true, false, ""},
-		equalsTestCase{int32(0), true, false, ""},
-		equalsTestCase{int64(0), true, false, ""},
-		equalsTestCase{float32(0), true, false, ""},
-		equalsTestCase{float64(0), true, false, ""},
-		equalsTestCase{complex64(0), true, false, ""},
-		equalsTestCase{complex128(0), true, false, ""},
-		equalsTestCase{interface{}(int(0)), true, false, ""},
-		equalsTestCase{uint(0), true, false, ""},
-		equalsTestCase{uint8(0), true, false, ""},
-		equalsTestCase{uint16(0), true, false, ""},
-		equalsTestCase{uint32(0), true, false, ""},
-		equalsTestCase{uint64(0), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int(1), false, false, ""},
-		equalsTestCase{int8(1), false, false, ""},
-		equalsTestCase{int16(1), false, false, ""},
-		equalsTestCase{int32(1), false, false, ""},
-		equalsTestCase{int64(1), false, false, ""},
-		equalsTestCase{float32(-0.1), false, false, ""},
-		equalsTestCase{float32(0.1), false, false, ""},
-		equalsTestCase{complex64(1), false, false, ""},
-		equalsTestCase{complex64(0 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{0}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{0}, false, true, "which is not numeric"},
-		equalsTestCase{"0", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) PositiveInt16() {
-	matcher := Equals(int16(32765))
-	ExpectEq("32765", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of 32765.
-		equalsTestCase{32765, true, false, ""},
-		equalsTestCase{32765.0, true, false, ""},
-		equalsTestCase{32765 + 0i, true, false, ""},
-		equalsTestCase{int(32765), true, false, ""},
-		equalsTestCase{int16(32765), true, false, ""},
-		equalsTestCase{int32(32765), true, false, ""},
-		equalsTestCase{int64(32765), true, false, ""},
-		equalsTestCase{float32(32765), true, false, ""},
-		equalsTestCase{float64(32765), true, false, ""},
-		equalsTestCase{complex64(32765), true, false, ""},
-		equalsTestCase{complex128(32765), true, false, ""},
-		equalsTestCase{interface{}(int(32765)), true, false, ""},
-		equalsTestCase{uint(32765), true, false, ""},
-		equalsTestCase{uint16(32765), true, false, ""},
-		equalsTestCase{uint32(32765), true, false, ""},
-		equalsTestCase{uint64(32765), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int(32764), false, false, ""},
-		equalsTestCase{int16(32764), false, false, ""},
-		equalsTestCase{int32(32764), false, false, ""},
-		equalsTestCase{int64(32764), false, false, ""},
-		equalsTestCase{float32(32764.9), false, false, ""},
-		equalsTestCase{float32(32765.1), false, false, ""},
-		equalsTestCase{complex64(32765.9), false, false, ""},
-		equalsTestCase{complex64(32765 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(32765), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{32765}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{32765}, false, true, "which is not numeric"},
-		equalsTestCase{"32765", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// int32
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NegativeInt32() {
-	// -2^30
-	matcher := Equals(int32(-1073741824))
-	ExpectEq("-1073741824", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of -1073741824.
-		equalsTestCase{-1073741824, true, false, ""},
-		equalsTestCase{-1073741824.0, true, false, ""},
-		equalsTestCase{-1073741824 + 0i, true, false, ""},
-		equalsTestCase{int(-1073741824), true, false, ""},
-		equalsTestCase{int32(-1073741824), true, false, ""},
-		equalsTestCase{int64(-1073741824), true, false, ""},
-		equalsTestCase{float32(-1073741824), true, false, ""},
-		equalsTestCase{float64(-1073741824), true, false, ""},
-		equalsTestCase{complex64(-1073741824), true, false, ""},
-		equalsTestCase{complex128(-1073741824), true, false, ""},
-		equalsTestCase{interface{}(int(-1073741824)), true, false, ""},
-
-		// Values that would be -1073741824 in two's complement.
-		equalsTestCase{uint((1 << 32) - 1073741824), false, false, ""},
-		equalsTestCase{uint32((1 << 32) - 1073741824), false, false, ""},
-		equalsTestCase{uint64((1 << 64) - 1073741824), false, false, ""},
-
-		// Non-equal values of signed integer type.
-		equalsTestCase{int(-1073741823), false, false, ""},
-		equalsTestCase{int32(-1073741823), false, false, ""},
-		equalsTestCase{int64(-1073741823), false, false, ""},
-
-		// Non-equal values of other numeric types.
-		equalsTestCase{float64(-1073741824.1), false, false, ""},
-		equalsTestCase{float64(-1073741823.9), false, false, ""},
-		equalsTestCase{complex128(-1073741823), false, false, ""},
-		equalsTestCase{complex128(-1073741824 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) PositiveInt32() {
-	// 2^30
-	matcher := Equals(int32(1073741824))
-	ExpectEq("1073741824", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of 1073741824.
-		equalsTestCase{1073741824, true, false, ""},
-		equalsTestCase{1073741824.0, true, false, ""},
-		equalsTestCase{1073741824 + 0i, true, false, ""},
-		equalsTestCase{int(1073741824), true, false, ""},
-		equalsTestCase{uint(1073741824), true, false, ""},
-		equalsTestCase{int32(1073741824), true, false, ""},
-		equalsTestCase{int64(1073741824), true, false, ""},
-		equalsTestCase{uint32(1073741824), true, false, ""},
-		equalsTestCase{uint64(1073741824), true, false, ""},
-		equalsTestCase{float32(1073741824), true, false, ""},
-		equalsTestCase{float64(1073741824), true, false, ""},
-		equalsTestCase{complex64(1073741824), true, false, ""},
-		equalsTestCase{complex128(1073741824), true, false, ""},
-		equalsTestCase{interface{}(int(1073741824)), true, false, ""},
-		equalsTestCase{interface{}(uint(1073741824)), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int(1073741823), false, false, ""},
-		equalsTestCase{int32(1073741823), false, false, ""},
-		equalsTestCase{int64(1073741823), false, false, ""},
-		equalsTestCase{float64(1073741824.1), false, false, ""},
-		equalsTestCase{float64(1073741823.9), false, false, ""},
-		equalsTestCase{complex128(1073741823), false, false, ""},
-		equalsTestCase{complex128(1073741824 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// int64
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NegativeInt64() {
-	// -2^40
-	matcher := Equals(int64(-1099511627776))
-	ExpectEq("-1099511627776", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of -1099511627776.
-		equalsTestCase{-1099511627776.0, true, false, ""},
-		equalsTestCase{-1099511627776 + 0i, true, false, ""},
-		equalsTestCase{int64(-1099511627776), true, false, ""},
-		equalsTestCase{float32(-1099511627776), true, false, ""},
-		equalsTestCase{float64(-1099511627776), true, false, ""},
-		equalsTestCase{complex64(-1099511627776), true, false, ""},
-		equalsTestCase{complex128(-1099511627776), true, false, ""},
-		equalsTestCase{interface{}(int64(-1099511627776)), true, false, ""},
-
-		// Values that would be -1099511627776 in two's complement.
-		equalsTestCase{uint64((1 << 64) - 1099511627776), false, false, ""},
-
-		// Non-equal values of signed integer type.
-		equalsTestCase{int64(-1099511627775), false, false, ""},
-
-		// Non-equal values of other numeric types.
-		equalsTestCase{float64(-1099511627776.1), false, false, ""},
-		equalsTestCase{float64(-1099511627775.9), false, false, ""},
-		equalsTestCase{complex128(-1099511627775), false, false, ""},
-		equalsTestCase{complex128(-1099511627776 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) PositiveInt64() {
-	// 2^40
-	matcher := Equals(int64(1099511627776))
-	ExpectEq("1099511627776", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of 1099511627776.
-		equalsTestCase{1099511627776.0, true, false, ""},
-		equalsTestCase{1099511627776 + 0i, true, false, ""},
-		equalsTestCase{int64(1099511627776), true, false, ""},
-		equalsTestCase{uint64(1099511627776), true, false, ""},
-		equalsTestCase{float32(1099511627776), true, false, ""},
-		equalsTestCase{float64(1099511627776), true, false, ""},
-		equalsTestCase{complex64(1099511627776), true, false, ""},
-		equalsTestCase{complex128(1099511627776), true, false, ""},
-		equalsTestCase{interface{}(int64(1099511627776)), true, false, ""},
-		equalsTestCase{interface{}(uint64(1099511627776)), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int64(1099511627775), false, false, ""},
-		equalsTestCase{uint64(1099511627775), false, false, ""},
-		equalsTestCase{float64(1099511627776.1), false, false, ""},
-		equalsTestCase{float64(1099511627775.9), false, false, ""},
-		equalsTestCase{complex128(1099511627775), false, false, ""},
-		equalsTestCase{complex128(1099511627776 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) Int64NotExactlyRepresentableBySinglePrecision() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := Equals(int64(kTwoTo25 + 1))
-	ExpectEq("33554433", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Integers.
-		equalsTestCase{int64(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 2), false, false, ""},
-
-		equalsTestCase{uint64(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 2), false, false, ""},
-
-		// Single-precision floating point.
-		equalsTestCase{float32(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{float32(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 3), false, false, ""},
-
-		equalsTestCase{complex64(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{complex64(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 3), false, false, ""},
-
-		// Double-precision floating point.
-		equalsTestCase{float64(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 2), false, false, ""},
-
-		equalsTestCase{complex128(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 2), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) Int64NotExactlyRepresentableByDoublePrecision() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := Equals(int64(kTwoTo54 + 1))
-	ExpectEq("18014398509481985", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Integers.
-		equalsTestCase{int64(kTwoTo54 + 0), false, false, ""},
-		equalsTestCase{int64(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{int64(kTwoTo54 + 2), false, false, ""},
-
-		equalsTestCase{uint64(kTwoTo54 + 0), false, false, ""},
-		equalsTestCase{uint64(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{uint64(kTwoTo54 + 2), false, false, ""},
-
-		// Double-precision floating point.
-		equalsTestCase{float64(kTwoTo54 - 2), false, false, ""},
-		equalsTestCase{float64(kTwoTo54 - 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 0), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 2), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 3), false, false, ""},
-
-		equalsTestCase{complex128(kTwoTo54 - 2), false, false, ""},
-		equalsTestCase{complex128(kTwoTo54 - 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 0), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 2), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// uint
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) SmallUint() {
-	const kExpected = 17
-	matcher := Equals(uint(kExpected))
-	ExpectEq("17", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{17, true, false, ""},
-		equalsTestCase{17.0, true, false, ""},
-		equalsTestCase{17 + 0i, true, false, ""},
-		equalsTestCase{int(kExpected), true, false, ""},
-		equalsTestCase{int8(kExpected), true, false, ""},
-		equalsTestCase{int16(kExpected), true, false, ""},
-		equalsTestCase{int32(kExpected), true, false, ""},
-		equalsTestCase{int64(kExpected), true, false, ""},
-		equalsTestCase{uint(kExpected), true, false, ""},
-		equalsTestCase{uint8(kExpected), true, false, ""},
-		equalsTestCase{uint16(kExpected), true, false, ""},
-		equalsTestCase{uint32(kExpected), true, false, ""},
-		equalsTestCase{uint64(kExpected), true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric types.
-		equalsTestCase{kExpected + 1, false, false, ""},
-		equalsTestCase{int(kExpected + 1), false, false, ""},
-		equalsTestCase{int8(kExpected + 1), false, false, ""},
-		equalsTestCase{int16(kExpected + 1), false, false, ""},
-		equalsTestCase{int32(kExpected + 1), false, false, ""},
-		equalsTestCase{int64(kExpected + 1), false, false, ""},
-		equalsTestCase{uint(kExpected + 1), false, false, ""},
-		equalsTestCase{uint8(kExpected + 1), false, false, ""},
-		equalsTestCase{uint16(kExpected + 1), false, false, ""},
-		equalsTestCase{uint32(kExpected + 1), false, false, ""},
-		equalsTestCase{uint64(kExpected + 1), false, false, ""},
-		equalsTestCase{float32(kExpected + 1), false, false, ""},
-		equalsTestCase{float64(kExpected + 1), false, false, ""},
-		equalsTestCase{complex64(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex64(kExpected + 1), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex128(kExpected + 1), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) LargeUint() {
-	const kExpected = (1 << 16) + 17
-	matcher := Equals(uint(kExpected))
-	ExpectEq("65553", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{65553, true, false, ""},
-		equalsTestCase{65553.0, true, false, ""},
-		equalsTestCase{65553 + 0i, true, false, ""},
-		equalsTestCase{int32(kExpected), true, false, ""},
-		equalsTestCase{int64(kExpected), true, false, ""},
-		equalsTestCase{uint32(kExpected), true, false, ""},
-		equalsTestCase{uint64(kExpected), true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric types.
-		equalsTestCase{int16(17), false, false, ""},
-		equalsTestCase{int32(kExpected + 1), false, false, ""},
-		equalsTestCase{int64(kExpected + 1), false, false, ""},
-		equalsTestCase{uint16(17), false, false, ""},
-		equalsTestCase{uint32(kExpected + 1), false, false, ""},
-		equalsTestCase{uint64(kExpected + 1), false, false, ""},
-		equalsTestCase{float64(kExpected + 1), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex128(kExpected + 1), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) UintNotExactlyRepresentableBySinglePrecision() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := Equals(uint(kTwoTo25 + 1))
-	ExpectEq("33554433", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Integers.
-		equalsTestCase{int64(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 2), false, false, ""},
-
-		equalsTestCase{uint64(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 2), false, false, ""},
-
-		// Single-precision floating point.
-		equalsTestCase{float32(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{float32(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 3), false, false, ""},
-
-		equalsTestCase{complex64(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{complex64(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 3), false, false, ""},
-
-		// Double-precision floating point.
-		equalsTestCase{float64(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 2), false, false, ""},
-
-		equalsTestCase{complex128(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 2), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// uint8
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) SmallUint8() {
-	const kExpected = 17
-	matcher := Equals(uint8(kExpected))
-	ExpectEq("17", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{17, true, false, ""},
-		equalsTestCase{17.0, true, false, ""},
-		equalsTestCase{17 + 0i, true, false, ""},
-		equalsTestCase{int(kExpected), true, false, ""},
-		equalsTestCase{int8(kExpected), true, false, ""},
-		equalsTestCase{int16(kExpected), true, false, ""},
-		equalsTestCase{int32(kExpected), true, false, ""},
-		equalsTestCase{int64(kExpected), true, false, ""},
-		equalsTestCase{uint(kExpected), true, false, ""},
-		equalsTestCase{uint8(kExpected), true, false, ""},
-		equalsTestCase{uint16(kExpected), true, false, ""},
-		equalsTestCase{uint32(kExpected), true, false, ""},
-		equalsTestCase{uint64(kExpected), true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric types.
-		equalsTestCase{kExpected + 1, false, false, ""},
-		equalsTestCase{int(kExpected + 1), false, false, ""},
-		equalsTestCase{int8(kExpected + 1), false, false, ""},
-		equalsTestCase{int16(kExpected + 1), false, false, ""},
-		equalsTestCase{int32(kExpected + 1), false, false, ""},
-		equalsTestCase{int64(kExpected + 1), false, false, ""},
-		equalsTestCase{uint(kExpected + 1), false, false, ""},
-		equalsTestCase{uint8(kExpected + 1), false, false, ""},
-		equalsTestCase{uint16(kExpected + 1), false, false, ""},
-		equalsTestCase{uint32(kExpected + 1), false, false, ""},
-		equalsTestCase{uint64(kExpected + 1), false, false, ""},
-		equalsTestCase{float32(kExpected + 1), false, false, ""},
-		equalsTestCase{float64(kExpected + 1), false, false, ""},
-		equalsTestCase{complex64(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex64(kExpected + 1), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex128(kExpected + 1), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// uint16
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) SmallUint16() {
-	const kExpected = 17
-	matcher := Equals(uint16(kExpected))
-	ExpectEq("17", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{17, true, false, ""},
-		equalsTestCase{17.0, true, false, ""},
-		equalsTestCase{17 + 0i, true, false, ""},
-		equalsTestCase{int(kExpected), true, false, ""},
-		equalsTestCase{int8(kExpected), true, false, ""},
-		equalsTestCase{int16(kExpected), true, false, ""},
-		equalsTestCase{int32(kExpected), true, false, ""},
-		equalsTestCase{int64(kExpected), true, false, ""},
-		equalsTestCase{uint(kExpected), true, false, ""},
-		equalsTestCase{uint8(kExpected), true, false, ""},
-		equalsTestCase{uint16(kExpected), true, false, ""},
-		equalsTestCase{uint32(kExpected), true, false, ""},
-		equalsTestCase{uint64(kExpected), true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric types.
-		equalsTestCase{kExpected + 1, false, false, ""},
-		equalsTestCase{int(kExpected + 1), false, false, ""},
-		equalsTestCase{int8(kExpected + 1), false, false, ""},
-		equalsTestCase{int16(kExpected + 1), false, false, ""},
-		equalsTestCase{int32(kExpected + 1), false, false, ""},
-		equalsTestCase{int64(kExpected + 1), false, false, ""},
-		equalsTestCase{uint(kExpected + 1), false, false, ""},
-		equalsTestCase{uint8(kExpected + 1), false, false, ""},
-		equalsTestCase{uint16(kExpected + 1), false, false, ""},
-		equalsTestCase{uint32(kExpected + 1), false, false, ""},
-		equalsTestCase{uint64(kExpected + 1), false, false, ""},
-		equalsTestCase{float32(kExpected + 1), false, false, ""},
-		equalsTestCase{float64(kExpected + 1), false, false, ""},
-		equalsTestCase{complex64(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex64(kExpected + 1), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex128(kExpected + 1), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) LargeUint16() {
-	const kExpected = (1 << 8) + 17
-	matcher := Equals(uint16(kExpected))
-	ExpectEq("273", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{273, true, false, ""},
-		equalsTestCase{273.0, true, false, ""},
-		equalsTestCase{273 + 0i, true, false, ""},
-		equalsTestCase{int16(kExpected), true, false, ""},
-		equalsTestCase{int32(kExpected), true, false, ""},
-		equalsTestCase{int64(kExpected), true, false, ""},
-		equalsTestCase{uint16(kExpected), true, false, ""},
-		equalsTestCase{uint32(kExpected), true, false, ""},
-		equalsTestCase{uint64(kExpected), true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric types.
-		equalsTestCase{int8(17), false, false, ""},
-		equalsTestCase{int16(kExpected + 1), false, false, ""},
-		equalsTestCase{int32(kExpected + 1), false, false, ""},
-		equalsTestCase{int64(kExpected + 1), false, false, ""},
-		equalsTestCase{uint8(17), false, false, ""},
-		equalsTestCase{uint16(kExpected + 1), false, false, ""},
-		equalsTestCase{uint32(kExpected + 1), false, false, ""},
-		equalsTestCase{uint64(kExpected + 1), false, false, ""},
-		equalsTestCase{float64(kExpected + 1), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex128(kExpected + 1), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// uint32
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) SmallUint32() {
-	const kExpected = 17
-	matcher := Equals(uint32(kExpected))
-	ExpectEq("17", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{17, true, false, ""},
-		equalsTestCase{17.0, true, false, ""},
-		equalsTestCase{17 + 0i, true, false, ""},
-		equalsTestCase{int(kExpected), true, false, ""},
-		equalsTestCase{int8(kExpected), true, false, ""},
-		equalsTestCase{int16(kExpected), true, false, ""},
-		equalsTestCase{int32(kExpected), true, false, ""},
-		equalsTestCase{int64(kExpected), true, false, ""},
-		equalsTestCase{uint(kExpected), true, false, ""},
-		equalsTestCase{uint8(kExpected), true, false, ""},
-		equalsTestCase{uint16(kExpected), true, false, ""},
-		equalsTestCase{uint32(kExpected), true, false, ""},
-		equalsTestCase{uint64(kExpected), true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric types.
-		equalsTestCase{kExpected + 1, false, false, ""},
-		equalsTestCase{int(kExpected + 1), false, false, ""},
-		equalsTestCase{int8(kExpected + 1), false, false, ""},
-		equalsTestCase{int16(kExpected + 1), false, false, ""},
-		equalsTestCase{int32(kExpected + 1), false, false, ""},
-		equalsTestCase{int64(kExpected + 1), false, false, ""},
-		equalsTestCase{uint(kExpected + 1), false, false, ""},
-		equalsTestCase{uint8(kExpected + 1), false, false, ""},
-		equalsTestCase{uint16(kExpected + 1), false, false, ""},
-		equalsTestCase{uint32(kExpected + 1), false, false, ""},
-		equalsTestCase{uint64(kExpected + 1), false, false, ""},
-		equalsTestCase{float32(kExpected + 1), false, false, ""},
-		equalsTestCase{float64(kExpected + 1), false, false, ""},
-		equalsTestCase{complex64(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex64(kExpected + 1), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex128(kExpected + 1), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) LargeUint32() {
-	const kExpected = (1 << 16) + 17
-	matcher := Equals(uint32(kExpected))
-	ExpectEq("65553", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{65553, true, false, ""},
-		equalsTestCase{65553.0, true, false, ""},
-		equalsTestCase{65553 + 0i, true, false, ""},
-		equalsTestCase{int32(kExpected), true, false, ""},
-		equalsTestCase{int64(kExpected), true, false, ""},
-		equalsTestCase{uint32(kExpected), true, false, ""},
-		equalsTestCase{uint64(kExpected), true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric types.
-		equalsTestCase{int16(17), false, false, ""},
-		equalsTestCase{int32(kExpected + 1), false, false, ""},
-		equalsTestCase{int64(kExpected + 1), false, false, ""},
-		equalsTestCase{uint16(17), false, false, ""},
-		equalsTestCase{uint32(kExpected + 1), false, false, ""},
-		equalsTestCase{uint64(kExpected + 1), false, false, ""},
-		equalsTestCase{float64(kExpected + 1), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex128(kExpected + 1), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) Uint32NotExactlyRepresentableBySinglePrecision() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := Equals(uint32(kTwoTo25 + 1))
-	ExpectEq("33554433", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Integers.
-		equalsTestCase{int64(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 2), false, false, ""},
-
-		equalsTestCase{uint64(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 2), false, false, ""},
-
-		// Single-precision floating point.
-		equalsTestCase{float32(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{float32(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 3), false, false, ""},
-
-		equalsTestCase{complex64(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{complex64(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 3), false, false, ""},
-
-		// Double-precision floating point.
-		equalsTestCase{float64(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 2), false, false, ""},
-
-		equalsTestCase{complex128(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 2), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// uint64
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) SmallUint64() {
-	const kExpected = 17
-	matcher := Equals(uint64(kExpected))
-	ExpectEq("17", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{17, true, false, ""},
-		equalsTestCase{17.0, true, false, ""},
-		equalsTestCase{17 + 0i, true, false, ""},
-		equalsTestCase{int(kExpected), true, false, ""},
-		equalsTestCase{int8(kExpected), true, false, ""},
-		equalsTestCase{int16(kExpected), true, false, ""},
-		equalsTestCase{int32(kExpected), true, false, ""},
-		equalsTestCase{int64(kExpected), true, false, ""},
-		equalsTestCase{uint(kExpected), true, false, ""},
-		equalsTestCase{uint8(kExpected), true, false, ""},
-		equalsTestCase{uint16(kExpected), true, false, ""},
-		equalsTestCase{uint32(kExpected), true, false, ""},
-		equalsTestCase{uint64(kExpected), true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric types.
-		equalsTestCase{kExpected + 1, false, false, ""},
-		equalsTestCase{int(kExpected + 1), false, false, ""},
-		equalsTestCase{int8(kExpected + 1), false, false, ""},
-		equalsTestCase{int16(kExpected + 1), false, false, ""},
-		equalsTestCase{int32(kExpected + 1), false, false, ""},
-		equalsTestCase{int64(kExpected + 1), false, false, ""},
-		equalsTestCase{uint(kExpected + 1), false, false, ""},
-		equalsTestCase{uint8(kExpected + 1), false, false, ""},
-		equalsTestCase{uint16(kExpected + 1), false, false, ""},
-		equalsTestCase{uint32(kExpected + 1), false, false, ""},
-		equalsTestCase{uint64(kExpected + 1), false, false, ""},
-		equalsTestCase{float32(kExpected + 1), false, false, ""},
-		equalsTestCase{float64(kExpected + 1), false, false, ""},
-		equalsTestCase{complex64(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex64(kExpected + 1), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex128(kExpected + 1), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) LargeUint64() {
-	const kExpected = (1 << 32) + 17
-	matcher := Equals(uint64(kExpected))
-	ExpectEq("4294967313", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{4294967313.0, true, false, ""},
-		equalsTestCase{4294967313 + 0i, true, false, ""},
-		equalsTestCase{int64(kExpected), true, false, ""},
-		equalsTestCase{uint64(kExpected), true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric types.
-		equalsTestCase{int(17), false, false, ""},
-		equalsTestCase{int32(17), false, false, ""},
-		equalsTestCase{int64(kExpected + 1), false, false, ""},
-		equalsTestCase{uint(17), false, false, ""},
-		equalsTestCase{uint32(17), false, false, ""},
-		equalsTestCase{uint64(kExpected + 1), false, false, ""},
-		equalsTestCase{float64(kExpected + 1), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex128(kExpected + 1), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) Uint64NotExactlyRepresentableBySinglePrecision() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := Equals(uint64(kTwoTo25 + 1))
-	ExpectEq("33554433", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Integers.
-		equalsTestCase{int64(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 2), false, false, ""},
-
-		equalsTestCase{uint64(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 2), false, false, ""},
-
-		// Single-precision floating point.
-		equalsTestCase{float32(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{float32(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 3), false, false, ""},
-
-		equalsTestCase{complex64(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{complex64(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 3), false, false, ""},
-
-		// Double-precision floating point.
-		equalsTestCase{float64(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 2), false, false, ""},
-
-		equalsTestCase{complex128(kTwoTo25 + 0), false, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 2), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) Uint64NotExactlyRepresentableByDoublePrecision() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := Equals(uint64(kTwoTo54 + 1))
-	ExpectEq("18014398509481985", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Integers.
-		equalsTestCase{int64(kTwoTo54 + 0), false, false, ""},
-		equalsTestCase{int64(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{int64(kTwoTo54 + 2), false, false, ""},
-
-		equalsTestCase{uint64(kTwoTo54 + 0), false, false, ""},
-		equalsTestCase{uint64(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{uint64(kTwoTo54 + 2), false, false, ""},
-
-		// Double-precision floating point.
-		equalsTestCase{float64(kTwoTo54 - 2), false, false, ""},
-		equalsTestCase{float64(kTwoTo54 - 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 0), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 2), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 3), false, false, ""},
-
-		equalsTestCase{complex128(kTwoTo54 - 2), false, false, ""},
-		equalsTestCase{complex128(kTwoTo54 - 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 0), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 2), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// uintptr
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NilUintptr() {
-	var ptr1 uintptr
-	var ptr2 uintptr
-
-	matcher := Equals(ptr1)
-	ExpectEq("0", matcher.Description())
-
-	cases := []equalsTestCase{
-		// uintptrs
-		equalsTestCase{ptr1, true, false, ""},
-		equalsTestCase{ptr2, true, false, ""},
-		equalsTestCase{uintptr(0), true, false, ""},
-		equalsTestCase{uintptr(17), false, false, ""},
-
-		// Other types.
-		equalsTestCase{0, false, true, "which is not a uintptr"},
-		equalsTestCase{bool(false), false, true, "which is not a uintptr"},
-		equalsTestCase{int(0), false, true, "which is not a uintptr"},
-		equalsTestCase{int8(0), false, true, "which is not a uintptr"},
-		equalsTestCase{int16(0), false, true, "which is not a uintptr"},
-		equalsTestCase{int32(0), false, true, "which is not a uintptr"},
-		equalsTestCase{int64(0), false, true, "which is not a uintptr"},
-		equalsTestCase{uint(0), false, true, "which is not a uintptr"},
-		equalsTestCase{uint8(0), false, true, "which is not a uintptr"},
-		equalsTestCase{uint16(0), false, true, "which is not a uintptr"},
-		equalsTestCase{uint32(0), false, true, "which is not a uintptr"},
-		equalsTestCase{uint64(0), false, true, "which is not a uintptr"},
-		equalsTestCase{true, false, true, "which is not a uintptr"},
-		equalsTestCase{[...]int{}, false, true, "which is not a uintptr"},
-		equalsTestCase{make(chan int), false, true, "which is not a uintptr"},
-		equalsTestCase{func() {}, false, true, "which is not a uintptr"},
-		equalsTestCase{map[int]int{}, false, true, "which is not a uintptr"},
-		equalsTestCase{&someInt, false, true, "which is not a uintptr"},
-		equalsTestCase{[]int{}, false, true, "which is not a uintptr"},
-		equalsTestCase{"taco", false, true, "which is not a uintptr"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not a uintptr"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) NonNilUintptr() {
-	matcher := Equals(uintptr(17))
-	ExpectEq("17", matcher.Description())
-
-	cases := []equalsTestCase{
-		// uintptrs
-		equalsTestCase{uintptr(17), true, false, ""},
-		equalsTestCase{uintptr(16), false, false, ""},
-		equalsTestCase{uintptr(0), false, false, ""},
-
-		// Other types.
-		equalsTestCase{0, false, true, "which is not a uintptr"},
-		equalsTestCase{bool(false), false, true, "which is not a uintptr"},
-		equalsTestCase{int(0), false, true, "which is not a uintptr"},
-		equalsTestCase{int8(0), false, true, "which is not a uintptr"},
-		equalsTestCase{int16(0), false, true, "which is not a uintptr"},
-		equalsTestCase{int32(0), false, true, "which is not a uintptr"},
-		equalsTestCase{int64(0), false, true, "which is not a uintptr"},
-		equalsTestCase{uint(0), false, true, "which is not a uintptr"},
-		equalsTestCase{uint8(0), false, true, "which is not a uintptr"},
-		equalsTestCase{uint16(0), false, true, "which is not a uintptr"},
-		equalsTestCase{uint32(0), false, true, "which is not a uintptr"},
-		equalsTestCase{uint64(0), false, true, "which is not a uintptr"},
-		equalsTestCase{true, false, true, "which is not a uintptr"},
-		equalsTestCase{[...]int{}, false, true, "which is not a uintptr"},
-		equalsTestCase{make(chan int), false, true, "which is not a uintptr"},
-		equalsTestCase{func() {}, false, true, "which is not a uintptr"},
-		equalsTestCase{map[int]int{}, false, true, "which is not a uintptr"},
-		equalsTestCase{&someInt, false, true, "which is not a uintptr"},
-		equalsTestCase{[]int{}, false, true, "which is not a uintptr"},
-		equalsTestCase{"taco", false, true, "which is not a uintptr"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not a uintptr"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// float32
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NegativeIntegralFloat32() {
-	matcher := Equals(float32(-32769))
-	ExpectEq("-32769", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of -32769.
-		equalsTestCase{-32769.0, true, false, ""},
-		equalsTestCase{-32769 + 0i, true, false, ""},
-		equalsTestCase{int32(-32769), true, false, ""},
-		equalsTestCase{int64(-32769), true, false, ""},
-		equalsTestCase{float32(-32769), true, false, ""},
-		equalsTestCase{float64(-32769), true, false, ""},
-		equalsTestCase{complex64(-32769), true, false, ""},
-		equalsTestCase{complex128(-32769), true, false, ""},
-		equalsTestCase{interface{}(float32(-32769)), true, false, ""},
-		equalsTestCase{interface{}(int64(-32769)), true, false, ""},
-
-		// Values that would be -32769 in two's complement.
-		equalsTestCase{uint64((1 << 64) - 32769), false, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int64(-32770), false, false, ""},
-		equalsTestCase{float32(-32769.1), false, false, ""},
-		equalsTestCase{float32(-32768.9), false, false, ""},
-		equalsTestCase{float64(-32769.1), false, false, ""},
-		equalsTestCase{float64(-32768.9), false, false, ""},
-		equalsTestCase{complex128(-32768), false, false, ""},
-		equalsTestCase{complex128(-32769 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) NegativeNonIntegralFloat32() {
-	matcher := Equals(float32(-32769.1))
-	ExpectEq("-32769.1", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of -32769.1.
-		equalsTestCase{-32769.1, true, false, ""},
-		equalsTestCase{-32769.1 + 0i, true, false, ""},
-		equalsTestCase{float32(-32769.1), true, false, ""},
-		equalsTestCase{float64(-32769.1), true, false, ""},
-		equalsTestCase{complex64(-32769.1), true, false, ""},
-		equalsTestCase{complex128(-32769.1), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int32(-32769), false, false, ""},
-		equalsTestCase{int32(-32770), false, false, ""},
-		equalsTestCase{int64(-32769), false, false, ""},
-		equalsTestCase{int64(-32770), false, false, ""},
-		equalsTestCase{float32(-32769.2), false, false, ""},
-		equalsTestCase{float32(-32769.0), false, false, ""},
-		equalsTestCase{float64(-32769.2), false, false, ""},
-		equalsTestCase{complex128(-32769.1 + 2i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) LargeNegativeFloat32() {
-	const kExpected = -1 * (1 << 65)
-	matcher := Equals(float32(kExpected))
-	ExpectEq("-3.689349e+19", matcher.Description())
-
-	floatExpected := float32(kExpected)
-	castedInt := int64(floatExpected)
-
-	cases := []equalsTestCase{
-		// Equal values of numeric type.
-		equalsTestCase{kExpected + 0i, true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{castedInt, false, false, ""},
-		equalsTestCase{int64(0), false, false, ""},
-		equalsTestCase{int64(math.MinInt64), false, false, ""},
-		equalsTestCase{int64(math.MaxInt64), false, false, ""},
-		equalsTestCase{float32(kExpected / 2), false, false, ""},
-		equalsTestCase{float64(kExpected / 2), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) ZeroFloat32() {
-	matcher := Equals(float32(0))
-	ExpectEq("0", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of zero.
-		equalsTestCase{0.0, true, false, ""},
-		equalsTestCase{0 + 0i, true, false, ""},
-		equalsTestCase{int(0), true, false, ""},
-		equalsTestCase{int8(0), true, false, ""},
-		equalsTestCase{int16(0), true, false, ""},
-		equalsTestCase{int32(0), true, false, ""},
-		equalsTestCase{int64(0), true, false, ""},
-		equalsTestCase{uint(0), true, false, ""},
-		equalsTestCase{uint8(0), true, false, ""},
-		equalsTestCase{uint16(0), true, false, ""},
-		equalsTestCase{uint32(0), true, false, ""},
-		equalsTestCase{uint64(0), true, false, ""},
-		equalsTestCase{float32(0), true, false, ""},
-		equalsTestCase{float64(0), true, false, ""},
-		equalsTestCase{complex64(0), true, false, ""},
-		equalsTestCase{complex128(0), true, false, ""},
-		equalsTestCase{interface{}(float32(0)), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int64(1), false, false, ""},
-		equalsTestCase{int64(-1), false, false, ""},
-		equalsTestCase{float32(1), false, false, ""},
-		equalsTestCase{float32(-1), false, false, ""},
-		equalsTestCase{complex128(0 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) PositiveIntegralFloat32() {
-	matcher := Equals(float32(32769))
-	ExpectEq("32769", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of 32769.
-		equalsTestCase{32769.0, true, false, ""},
-		equalsTestCase{32769 + 0i, true, false, ""},
-		equalsTestCase{int(32769), true, false, ""},
-		equalsTestCase{int32(32769), true, false, ""},
-		equalsTestCase{int64(32769), true, false, ""},
-		equalsTestCase{uint(32769), true, false, ""},
-		equalsTestCase{uint32(32769), true, false, ""},
-		equalsTestCase{uint64(32769), true, false, ""},
-		equalsTestCase{float32(32769), true, false, ""},
-		equalsTestCase{float64(32769), true, false, ""},
-		equalsTestCase{complex64(32769), true, false, ""},
-		equalsTestCase{complex128(32769), true, false, ""},
-		equalsTestCase{interface{}(float32(32769)), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int64(32770), false, false, ""},
-		equalsTestCase{uint64(32770), false, false, ""},
-		equalsTestCase{float32(32769.1), false, false, ""},
-		equalsTestCase{float32(32768.9), false, false, ""},
-		equalsTestCase{float64(32769.1), false, false, ""},
-		equalsTestCase{float64(32768.9), false, false, ""},
-		equalsTestCase{complex128(32768), false, false, ""},
-		equalsTestCase{complex128(32769 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) PositiveNonIntegralFloat32() {
-	matcher := Equals(float32(32769.1))
-	ExpectEq("32769.1", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of 32769.1.
-		equalsTestCase{32769.1, true, false, ""},
-		equalsTestCase{32769.1 + 0i, true, false, ""},
-		equalsTestCase{float32(32769.1), true, false, ""},
-		equalsTestCase{float64(32769.1), true, false, ""},
-		equalsTestCase{complex64(32769.1), true, false, ""},
-		equalsTestCase{complex128(32769.1), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int32(32769), false, false, ""},
-		equalsTestCase{int32(32770), false, false, ""},
-		equalsTestCase{uint64(32769), false, false, ""},
-		equalsTestCase{uint64(32770), false, false, ""},
-		equalsTestCase{float32(32769.2), false, false, ""},
-		equalsTestCase{float32(32769.0), false, false, ""},
-		equalsTestCase{float64(32769.2), false, false, ""},
-		equalsTestCase{complex128(32769.1 + 2i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) LargePositiveFloat32() {
-	const kExpected = 1 << 65
-	matcher := Equals(float32(kExpected))
-	ExpectEq("3.689349e+19", matcher.Description())
-
-	floatExpected := float32(kExpected)
-	castedInt := uint64(floatExpected)
-
-	cases := []equalsTestCase{
-		// Equal values of numeric type.
-		equalsTestCase{kExpected + 0i, true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{castedInt, false, false, ""},
-		equalsTestCase{int64(0), false, false, ""},
-		equalsTestCase{int64(math.MinInt64), false, false, ""},
-		equalsTestCase{int64(math.MaxInt64), false, false, ""},
-		equalsTestCase{uint64(0), false, false, ""},
-		equalsTestCase{uint64(math.MaxUint64), false, false, ""},
-		equalsTestCase{float32(kExpected / 2), false, false, ""},
-		equalsTestCase{float64(kExpected / 2), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) Float32AboveExactIntegerRange() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := Equals(float32(kTwoTo25 + 1))
-	ExpectEq("3.3554432e+07", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Integers.
-		equalsTestCase{int64(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{int64(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 3), false, false, ""},
-
-		equalsTestCase{uint64(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{uint64(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 3), false, false, ""},
-
-		// Single-precision floating point.
-		equalsTestCase{float32(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{float32(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 3), false, false, ""},
-
-		equalsTestCase{complex64(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{complex64(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 3), false, false, ""},
-
-		// Double-precision floating point.
-		equalsTestCase{float64(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{float64(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 3), false, false, ""},
-
-		equalsTestCase{complex128(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{complex128(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// float64
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NegativeIntegralFloat64() {
-	const kExpected = -(1 << 50)
-	matcher := Equals(float64(kExpected))
-	ExpectEq("-1.125899906842624e+15", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{-1125899906842624.0, true, false, ""},
-		equalsTestCase{-1125899906842624.0 + 0i, true, false, ""},
-		equalsTestCase{int64(kExpected), true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-		equalsTestCase{interface{}(float64(kExpected)), true, false, ""},
-
-		// Values that would be kExpected in two's complement.
-		equalsTestCase{uint64((1 << 64) + kExpected), false, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int64(kExpected + 1), false, false, ""},
-		equalsTestCase{float32(kExpected - (1 << 30)), false, false, ""},
-		equalsTestCase{float32(kExpected + (1 << 30)), false, false, ""},
-		equalsTestCase{float64(kExpected - 0.5), false, false, ""},
-		equalsTestCase{float64(kExpected + 0.5), false, false, ""},
-		equalsTestCase{complex128(kExpected - 1), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) NegativeNonIntegralFloat64() {
-	const kTwoTo50 = 1 << 50
-	const kExpected = -kTwoTo50 - 0.25
-
-	matcher := Equals(float64(kExpected))
-	ExpectEq("-1.1258999068426242e+15", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{kExpected, true, false, ""},
-		equalsTestCase{kExpected + 0i, true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int64(-kTwoTo50), false, false, ""},
-		equalsTestCase{int64(-kTwoTo50 - 1), false, false, ""},
-		equalsTestCase{float32(kExpected - (1 << 30)), false, false, ""},
-		equalsTestCase{float64(kExpected - 0.25), false, false, ""},
-		equalsTestCase{float64(kExpected + 0.25), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) LargeNegativeFloat64() {
-	const kExpected = -1 * (1 << 65)
-	matcher := Equals(float64(kExpected))
-	ExpectEq("-3.6893488147419103e+19", matcher.Description())
-
-	floatExpected := float64(kExpected)
-	castedInt := int64(floatExpected)
-
-	cases := []equalsTestCase{
-		// Equal values of numeric type.
-		equalsTestCase{kExpected + 0i, true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{castedInt, false, false, ""},
-		equalsTestCase{int64(0), false, false, ""},
-		equalsTestCase{int64(math.MinInt64), false, false, ""},
-		equalsTestCase{int64(math.MaxInt64), false, false, ""},
-		equalsTestCase{float32(kExpected / 2), false, false, ""},
-		equalsTestCase{float64(kExpected / 2), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) ZeroFloat64() {
-	matcher := Equals(float64(0))
-	ExpectEq("0", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of zero.
-		equalsTestCase{0.0, true, false, ""},
-		equalsTestCase{0 + 0i, true, false, ""},
-		equalsTestCase{int(0), true, false, ""},
-		equalsTestCase{int8(0), true, false, ""},
-		equalsTestCase{int16(0), true, false, ""},
-		equalsTestCase{int32(0), true, false, ""},
-		equalsTestCase{int64(0), true, false, ""},
-		equalsTestCase{uint(0), true, false, ""},
-		equalsTestCase{uint8(0), true, false, ""},
-		equalsTestCase{uint16(0), true, false, ""},
-		equalsTestCase{uint32(0), true, false, ""},
-		equalsTestCase{uint64(0), true, false, ""},
-		equalsTestCase{float32(0), true, false, ""},
-		equalsTestCase{float64(0), true, false, ""},
-		equalsTestCase{complex64(0), true, false, ""},
-		equalsTestCase{complex128(0), true, false, ""},
-		equalsTestCase{interface{}(float32(0)), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int64(1), false, false, ""},
-		equalsTestCase{int64(-1), false, false, ""},
-		equalsTestCase{float32(1), false, false, ""},
-		equalsTestCase{float32(-1), false, false, ""},
-		equalsTestCase{complex128(0 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) PositiveIntegralFloat64() {
-	const kExpected = 1 << 50
-	matcher := Equals(float64(kExpected))
-	ExpectEq("1.125899906842624e+15", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of 32769.
-		equalsTestCase{1125899906842624.0, true, false, ""},
-		equalsTestCase{1125899906842624.0 + 0i, true, false, ""},
-		equalsTestCase{int64(kExpected), true, false, ""},
-		equalsTestCase{uint64(kExpected), true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-		equalsTestCase{interface{}(float64(kExpected)), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int64(kExpected + 1), false, false, ""},
-		equalsTestCase{uint64(kExpected + 1), false, false, ""},
-		equalsTestCase{float32(kExpected - (1 << 30)), false, false, ""},
-		equalsTestCase{float32(kExpected + (1 << 30)), false, false, ""},
-		equalsTestCase{float64(kExpected - 0.5), false, false, ""},
-		equalsTestCase{float64(kExpected + 0.5), false, false, ""},
-		equalsTestCase{complex128(kExpected - 1), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) PositiveNonIntegralFloat64() {
-	const kTwoTo50 = 1 << 50
-	const kExpected = kTwoTo50 + 0.25
-	matcher := Equals(float64(kExpected))
-	ExpectEq("1.1258999068426242e+15", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{kExpected, true, false, ""},
-		equalsTestCase{kExpected + 0i, true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int64(kTwoTo50), false, false, ""},
-		equalsTestCase{int64(kTwoTo50 - 1), false, false, ""},
-		equalsTestCase{float64(kExpected - 0.25), false, false, ""},
-		equalsTestCase{float64(kExpected + 0.25), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) LargePositiveFloat64() {
-	const kExpected = 1 << 65
-	matcher := Equals(float64(kExpected))
-	ExpectEq("3.6893488147419103e+19", matcher.Description())
-
-	floatExpected := float64(kExpected)
-	castedInt := uint64(floatExpected)
-
-	cases := []equalsTestCase{
-		// Equal values of numeric type.
-		equalsTestCase{kExpected + 0i, true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{castedInt, false, false, ""},
-		equalsTestCase{int64(0), false, false, ""},
-		equalsTestCase{int64(math.MinInt64), false, false, ""},
-		equalsTestCase{int64(math.MaxInt64), false, false, ""},
-		equalsTestCase{uint64(0), false, false, ""},
-		equalsTestCase{uint64(math.MaxUint64), false, false, ""},
-		equalsTestCase{float32(kExpected / 2), false, false, ""},
-		equalsTestCase{float64(kExpected / 2), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) Float64AboveExactIntegerRange() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := Equals(float64(kTwoTo54 + 1))
-	ExpectEq("1.8014398509481984e+16", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Integers.
-		equalsTestCase{int64(kTwoTo54 - 2), false, false, ""},
-		equalsTestCase{int64(kTwoTo54 - 1), true, false, ""},
-		equalsTestCase{int64(kTwoTo54 + 0), true, false, ""},
-		equalsTestCase{int64(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{int64(kTwoTo54 + 2), true, false, ""},
-		equalsTestCase{int64(kTwoTo54 + 3), false, false, ""},
-
-		equalsTestCase{uint64(kTwoTo54 - 2), false, false, ""},
-		equalsTestCase{uint64(kTwoTo54 - 1), true, false, ""},
-		equalsTestCase{uint64(kTwoTo54 + 0), true, false, ""},
-		equalsTestCase{uint64(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{uint64(kTwoTo54 + 2), true, false, ""},
-		equalsTestCase{uint64(kTwoTo54 + 3), false, false, ""},
-
-		// Double-precision floating point.
-		equalsTestCase{float64(kTwoTo54 - 2), false, false, ""},
-		equalsTestCase{float64(kTwoTo54 - 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 0), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 2), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 3), false, false, ""},
-
-		equalsTestCase{complex128(kTwoTo54 - 2), false, false, ""},
-		equalsTestCase{complex128(kTwoTo54 - 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 0), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 2), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// complex64
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NegativeIntegralComplex64() {
-	const kExpected = -32769
-	matcher := Equals(complex64(kExpected))
-	ExpectEq("(-32769+0i)", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{-32769.0, true, false, ""},
-		equalsTestCase{-32769.0 + 0i, true, false, ""},
-		equalsTestCase{int(kExpected), true, false, ""},
-		equalsTestCase{int32(kExpected), true, false, ""},
-		equalsTestCase{int64(kExpected), true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-		equalsTestCase{interface{}(float64(kExpected)), true, false, ""},
-
-		// Values that would be kExpected in two's complement.
-		equalsTestCase{uint32((1 << 32) + kExpected), false, false, ""},
-		equalsTestCase{uint64((1 << 64) + kExpected), false, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int64(kExpected + 1), false, false, ""},
-		equalsTestCase{float32(kExpected - (1 << 30)), false, false, ""},
-		equalsTestCase{float32(kExpected + (1 << 30)), false, false, ""},
-		equalsTestCase{float64(kExpected - 0.5), false, false, ""},
-		equalsTestCase{float64(kExpected + 0.5), false, false, ""},
-		equalsTestCase{complex64(kExpected - 1), false, false, ""},
-		equalsTestCase{complex64(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex128(kExpected - 1), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) NegativeNonIntegralComplex64() {
-	const kTwoTo20 = 1 << 20
-	const kExpected = -kTwoTo20 - 0.25
-
-	matcher := Equals(complex64(kExpected))
-	ExpectEq("(-1.0485762e+06+0i)", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{kExpected, true, false, ""},
-		equalsTestCase{kExpected + 0i, true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int(-kTwoTo20), false, false, ""},
-		equalsTestCase{int(-kTwoTo20 - 1), false, false, ""},
-		equalsTestCase{int32(-kTwoTo20), false, false, ""},
-		equalsTestCase{int32(-kTwoTo20 - 1), false, false, ""},
-		equalsTestCase{int64(-kTwoTo20), false, false, ""},
-		equalsTestCase{int64(-kTwoTo20 - 1), false, false, ""},
-		equalsTestCase{float32(kExpected - (1 << 30)), false, false, ""},
-		equalsTestCase{float64(kExpected - 0.25), false, false, ""},
-		equalsTestCase{float64(kExpected + 0.25), false, false, ""},
-		equalsTestCase{complex64(kExpected - 0.75), false, false, ""},
-		equalsTestCase{complex64(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex128(kExpected - 0.75), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) LargeNegativeComplex64() {
-	const kExpected = -1 * (1 << 65)
-	matcher := Equals(complex64(kExpected))
-	ExpectEq("(-3.689349e+19+0i)", matcher.Description())
-
-	floatExpected := float64(kExpected)
-	castedInt := int64(floatExpected)
-
-	cases := []equalsTestCase{
-		// Equal values of numeric type.
-		equalsTestCase{kExpected + 0i, true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{castedInt, false, false, ""},
-		equalsTestCase{int64(0), false, false, ""},
-		equalsTestCase{int64(math.MinInt64), false, false, ""},
-		equalsTestCase{int64(math.MaxInt64), false, false, ""},
-		equalsTestCase{float32(kExpected / 2), false, false, ""},
-		equalsTestCase{float64(kExpected / 2), false, false, ""},
-		equalsTestCase{complex64(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) ZeroComplex64() {
-	matcher := Equals(complex64(0))
-	ExpectEq("(0+0i)", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of zero.
-		equalsTestCase{0.0, true, false, ""},
-		equalsTestCase{0 + 0i, true, false, ""},
-		equalsTestCase{int(0), true, false, ""},
-		equalsTestCase{int8(0), true, false, ""},
-		equalsTestCase{int16(0), true, false, ""},
-		equalsTestCase{int32(0), true, false, ""},
-		equalsTestCase{int64(0), true, false, ""},
-		equalsTestCase{uint(0), true, false, ""},
-		equalsTestCase{uint8(0), true, false, ""},
-		equalsTestCase{uint16(0), true, false, ""},
-		equalsTestCase{uint32(0), true, false, ""},
-		equalsTestCase{uint64(0), true, false, ""},
-		equalsTestCase{float32(0), true, false, ""},
-		equalsTestCase{float64(0), true, false, ""},
-		equalsTestCase{complex64(0), true, false, ""},
-		equalsTestCase{complex128(0), true, false, ""},
-		equalsTestCase{interface{}(float32(0)), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int64(1), false, false, ""},
-		equalsTestCase{int64(-1), false, false, ""},
-		equalsTestCase{float32(1), false, false, ""},
-		equalsTestCase{float32(-1), false, false, ""},
-		equalsTestCase{float64(1), false, false, ""},
-		equalsTestCase{float64(-1), false, false, ""},
-		equalsTestCase{complex64(0 + 2i), false, false, ""},
-		equalsTestCase{complex128(0 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) PositiveIntegralComplex64() {
-	const kExpected = 1 << 20
-	matcher := Equals(complex64(kExpected))
-	ExpectEq("(1.048576e+06+0i)", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of 32769.
-		equalsTestCase{1048576.0, true, false, ""},
-		equalsTestCase{1048576.0 + 0i, true, false, ""},
-		equalsTestCase{int(kExpected), true, false, ""},
-		equalsTestCase{int32(kExpected), true, false, ""},
-		equalsTestCase{int64(kExpected), true, false, ""},
-		equalsTestCase{uint(kExpected), true, false, ""},
-		equalsTestCase{uint32(kExpected), true, false, ""},
-		equalsTestCase{uint64(kExpected), true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-		equalsTestCase{interface{}(float64(kExpected)), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int(kExpected + 1), false, false, ""},
-		equalsTestCase{int32(kExpected + 1), false, false, ""},
-		equalsTestCase{int64(kExpected + 1), false, false, ""},
-		equalsTestCase{uint(kExpected + 1), false, false, ""},
-		equalsTestCase{uint32(kExpected + 1), false, false, ""},
-		equalsTestCase{uint64(kExpected + 1), false, false, ""},
-		equalsTestCase{float32(kExpected - (1 << 30)), false, false, ""},
-		equalsTestCase{float32(kExpected + (1 << 30)), false, false, ""},
-		equalsTestCase{float64(kExpected - 0.5), false, false, ""},
-		equalsTestCase{float64(kExpected + 0.5), false, false, ""},
-		equalsTestCase{complex128(kExpected - 1), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) PositiveNonIntegralComplex64() {
-	const kTwoTo20 = 1 << 20
-	const kExpected = kTwoTo20 + 0.25
-	matcher := Equals(complex64(kExpected))
-	ExpectEq("(1.0485762e+06+0i)", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{kExpected, true, false, ""},
-		equalsTestCase{kExpected + 0i, true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int64(kTwoTo20), false, false, ""},
-		equalsTestCase{int64(kTwoTo20 - 1), false, false, ""},
-		equalsTestCase{uint64(kTwoTo20), false, false, ""},
-		equalsTestCase{uint64(kTwoTo20 - 1), false, false, ""},
-		equalsTestCase{float32(kExpected - 1), false, false, ""},
-		equalsTestCase{float32(kExpected + 1), false, false, ""},
-		equalsTestCase{float64(kExpected - 0.25), false, false, ""},
-		equalsTestCase{float64(kExpected + 0.25), false, false, ""},
-		equalsTestCase{complex64(kExpected - 1), false, false, ""},
-		equalsTestCase{complex64(kExpected - 1i), false, false, ""},
-		equalsTestCase{complex128(kExpected - 1), false, false, ""},
-		equalsTestCase{complex128(kExpected - 1i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) LargePositiveComplex64() {
-	const kExpected = 1 << 65
-	matcher := Equals(complex64(kExpected))
-	ExpectEq("(3.689349e+19+0i)", matcher.Description())
-
-	floatExpected := float64(kExpected)
-	castedInt := uint64(floatExpected)
-
-	cases := []equalsTestCase{
-		// Equal values of numeric type.
-		equalsTestCase{kExpected + 0i, true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{castedInt, false, false, ""},
-		equalsTestCase{int64(0), false, false, ""},
-		equalsTestCase{int64(math.MinInt64), false, false, ""},
-		equalsTestCase{int64(math.MaxInt64), false, false, ""},
-		equalsTestCase{uint64(0), false, false, ""},
-		equalsTestCase{uint64(math.MaxUint64), false, false, ""},
-		equalsTestCase{float32(kExpected / 2), false, false, ""},
-		equalsTestCase{float64(kExpected / 2), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) Complex64AboveExactIntegerRange() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := Equals(complex64(kTwoTo25 + 1))
-	ExpectEq("(3.3554432e+07+0i)", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Integers.
-		equalsTestCase{int64(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{int64(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{int64(kTwoTo25 + 3), false, false, ""},
-
-		equalsTestCase{uint64(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{uint64(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{uint64(kTwoTo25 + 3), false, false, ""},
-
-		// Single-precision floating point.
-		equalsTestCase{float32(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{float32(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{float32(kTwoTo25 + 3), false, false, ""},
-
-		equalsTestCase{complex64(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{complex64(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{complex64(kTwoTo25 + 3), false, false, ""},
-
-		// Double-precision floating point.
-		equalsTestCase{float64(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{float64(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{float64(kTwoTo25 + 3), false, false, ""},
-
-		equalsTestCase{complex128(kTwoTo25 - 2), false, false, ""},
-		equalsTestCase{complex128(kTwoTo25 - 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 0), true, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 2), true, false, ""},
-		equalsTestCase{complex128(kTwoTo25 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) Complex64WithNonZeroImaginaryPart() {
-	const kRealPart = 17
-	const kImagPart = 0.25i
-	const kExpected = kRealPart + kImagPart
-	matcher := Equals(complex64(kExpected))
-	ExpectEq("(17+0.25i)", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{kExpected, true, false, ""},
-		equalsTestCase{kRealPart + kImagPart, true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int(kRealPart), false, false, ""},
-		equalsTestCase{int8(kRealPart), false, false, ""},
-		equalsTestCase{int16(kRealPart), false, false, ""},
-		equalsTestCase{int32(kRealPart), false, false, ""},
-		equalsTestCase{int64(kRealPart), false, false, ""},
-		equalsTestCase{uint(kRealPart), false, false, ""},
-		equalsTestCase{uint8(kRealPart), false, false, ""},
-		equalsTestCase{uint16(kRealPart), false, false, ""},
-		equalsTestCase{uint32(kRealPart), false, false, ""},
-		equalsTestCase{uint64(kRealPart), false, false, ""},
-		equalsTestCase{float32(kRealPart), false, false, ""},
-		equalsTestCase{float64(kRealPart), false, false, ""},
-		equalsTestCase{complex64(kRealPart), false, false, ""},
-		equalsTestCase{complex64(kRealPart + kImagPart + 0.5), false, false, ""},
-		equalsTestCase{complex64(kRealPart + kImagPart + 0.5i), false, false, ""},
-		equalsTestCase{complex128(kRealPart), false, false, ""},
-		equalsTestCase{complex128(kRealPart + kImagPart + 0.5), false, false, ""},
-		equalsTestCase{complex128(kRealPart + kImagPart + 0.5i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// complex128
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NegativeIntegralComplex128() {
-	const kExpected = -32769
-	matcher := Equals(complex128(kExpected))
-	ExpectEq("(-32769+0i)", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{-32769.0, true, false, ""},
-		equalsTestCase{-32769.0 + 0i, true, false, ""},
-		equalsTestCase{int(kExpected), true, false, ""},
-		equalsTestCase{int32(kExpected), true, false, ""},
-		equalsTestCase{int64(kExpected), true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-		equalsTestCase{interface{}(float64(kExpected)), true, false, ""},
-
-		// Values that would be kExpected in two's complement.
-		equalsTestCase{uint32((1 << 32) + kExpected), false, false, ""},
-		equalsTestCase{uint64((1 << 64) + kExpected), false, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int64(kExpected + 1), false, false, ""},
-		equalsTestCase{float32(kExpected - (1 << 30)), false, false, ""},
-		equalsTestCase{float32(kExpected + (1 << 30)), false, false, ""},
-		equalsTestCase{float64(kExpected - 0.5), false, false, ""},
-		equalsTestCase{float64(kExpected + 0.5), false, false, ""},
-		equalsTestCase{complex64(kExpected - 1), false, false, ""},
-		equalsTestCase{complex64(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex128(kExpected - 1), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) NegativeNonIntegralComplex128() {
-	const kTwoTo20 = 1 << 20
-	const kExpected = -kTwoTo20 - 0.25
-
-	matcher := Equals(complex128(kExpected))
-	ExpectEq("(-1.04857625e+06+0i)", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{kExpected, true, false, ""},
-		equalsTestCase{kExpected + 0i, true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int(-kTwoTo20), false, false, ""},
-		equalsTestCase{int(-kTwoTo20 - 1), false, false, ""},
-		equalsTestCase{int32(-kTwoTo20), false, false, ""},
-		equalsTestCase{int32(-kTwoTo20 - 1), false, false, ""},
-		equalsTestCase{int64(-kTwoTo20), false, false, ""},
-		equalsTestCase{int64(-kTwoTo20 - 1), false, false, ""},
-		equalsTestCase{float32(kExpected - (1 << 30)), false, false, ""},
-		equalsTestCase{float64(kExpected - 0.25), false, false, ""},
-		equalsTestCase{float64(kExpected + 0.25), false, false, ""},
-		equalsTestCase{complex64(kExpected - 0.75), false, false, ""},
-		equalsTestCase{complex64(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex128(kExpected - 0.75), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) LargeNegativeComplex128() {
-	const kExpected = -1 * (1 << 65)
-	matcher := Equals(complex128(kExpected))
-	ExpectEq("(-3.6893488147419103e+19+0i)", matcher.Description())
-
-	floatExpected := float64(kExpected)
-	castedInt := int64(floatExpected)
-
-	cases := []equalsTestCase{
-		// Equal values of numeric type.
-		equalsTestCase{kExpected + 0i, true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{castedInt, false, false, ""},
-		equalsTestCase{int64(0), false, false, ""},
-		equalsTestCase{int64(math.MinInt64), false, false, ""},
-		equalsTestCase{int64(math.MaxInt64), false, false, ""},
-		equalsTestCase{float32(kExpected / 2), false, false, ""},
-		equalsTestCase{float64(kExpected / 2), false, false, ""},
-		equalsTestCase{complex64(kExpected + 2i), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) ZeroComplex128() {
-	matcher := Equals(complex128(0))
-	ExpectEq("(0+0i)", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of zero.
-		equalsTestCase{0.0, true, false, ""},
-		equalsTestCase{0 + 0i, true, false, ""},
-		equalsTestCase{int(0), true, false, ""},
-		equalsTestCase{int8(0), true, false, ""},
-		equalsTestCase{int16(0), true, false, ""},
-		equalsTestCase{int32(0), true, false, ""},
-		equalsTestCase{int64(0), true, false, ""},
-		equalsTestCase{uint(0), true, false, ""},
-		equalsTestCase{uint8(0), true, false, ""},
-		equalsTestCase{uint16(0), true, false, ""},
-		equalsTestCase{uint32(0), true, false, ""},
-		equalsTestCase{uint64(0), true, false, ""},
-		equalsTestCase{float32(0), true, false, ""},
-		equalsTestCase{float64(0), true, false, ""},
-		equalsTestCase{complex64(0), true, false, ""},
-		equalsTestCase{complex128(0), true, false, ""},
-		equalsTestCase{interface{}(float32(0)), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int64(1), false, false, ""},
-		equalsTestCase{int64(-1), false, false, ""},
-		equalsTestCase{float32(1), false, false, ""},
-		equalsTestCase{float32(-1), false, false, ""},
-		equalsTestCase{float64(1), false, false, ""},
-		equalsTestCase{float64(-1), false, false, ""},
-		equalsTestCase{complex64(0 + 2i), false, false, ""},
-		equalsTestCase{complex128(0 + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) PositiveIntegralComplex128() {
-	const kExpected = 1 << 20
-	matcher := Equals(complex128(kExpected))
-	ExpectEq("(1.048576e+06+0i)", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of 32769.
-		equalsTestCase{1048576.0, true, false, ""},
-		equalsTestCase{1048576.0 + 0i, true, false, ""},
-		equalsTestCase{int(kExpected), true, false, ""},
-		equalsTestCase{int32(kExpected), true, false, ""},
-		equalsTestCase{int64(kExpected), true, false, ""},
-		equalsTestCase{uint(kExpected), true, false, ""},
-		equalsTestCase{uint32(kExpected), true, false, ""},
-		equalsTestCase{uint64(kExpected), true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-		equalsTestCase{interface{}(float64(kExpected)), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int(kExpected + 1), false, false, ""},
-		equalsTestCase{int32(kExpected + 1), false, false, ""},
-		equalsTestCase{int64(kExpected + 1), false, false, ""},
-		equalsTestCase{uint(kExpected + 1), false, false, ""},
-		equalsTestCase{uint32(kExpected + 1), false, false, ""},
-		equalsTestCase{uint64(kExpected + 1), false, false, ""},
-		equalsTestCase{float32(kExpected - (1 << 30)), false, false, ""},
-		equalsTestCase{float32(kExpected + (1 << 30)), false, false, ""},
-		equalsTestCase{float64(kExpected - 0.5), false, false, ""},
-		equalsTestCase{float64(kExpected + 0.5), false, false, ""},
-		equalsTestCase{complex128(kExpected - 1), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-
-		// Non-numeric types.
-		equalsTestCase{uintptr(0), false, true, "which is not numeric"},
-		equalsTestCase{true, false, true, "which is not numeric"},
-		equalsTestCase{[...]int{}, false, true, "which is not numeric"},
-		equalsTestCase{make(chan int), false, true, "which is not numeric"},
-		equalsTestCase{func() {}, false, true, "which is not numeric"},
-		equalsTestCase{map[int]int{}, false, true, "which is not numeric"},
-		equalsTestCase{&someInt, false, true, "which is not numeric"},
-		equalsTestCase{[]int{}, false, true, "which is not numeric"},
-		equalsTestCase{"taco", false, true, "which is not numeric"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not numeric"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) PositiveNonIntegralComplex128() {
-	const kTwoTo20 = 1 << 20
-	const kExpected = kTwoTo20 + 0.25
-	matcher := Equals(complex128(kExpected))
-	ExpectEq("(1.04857625e+06+0i)", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{kExpected, true, false, ""},
-		equalsTestCase{kExpected + 0i, true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int64(kTwoTo20), false, false, ""},
-		equalsTestCase{int64(kTwoTo20 - 1), false, false, ""},
-		equalsTestCase{uint64(kTwoTo20), false, false, ""},
-		equalsTestCase{uint64(kTwoTo20 - 1), false, false, ""},
-		equalsTestCase{float32(kExpected - 1), false, false, ""},
-		equalsTestCase{float32(kExpected + 1), false, false, ""},
-		equalsTestCase{float64(kExpected - 0.25), false, false, ""},
-		equalsTestCase{float64(kExpected + 0.25), false, false, ""},
-		equalsTestCase{complex64(kExpected - 1), false, false, ""},
-		equalsTestCase{complex64(kExpected - 1i), false, false, ""},
-		equalsTestCase{complex128(kExpected - 1), false, false, ""},
-		equalsTestCase{complex128(kExpected - 1i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) LargePositiveComplex128() {
-	const kExpected = 1 << 65
-	matcher := Equals(complex128(kExpected))
-	ExpectEq("(3.6893488147419103e+19+0i)", matcher.Description())
-
-	floatExpected := float64(kExpected)
-	castedInt := uint64(floatExpected)
-
-	cases := []equalsTestCase{
-		// Equal values of numeric type.
-		equalsTestCase{kExpected + 0i, true, false, ""},
-		equalsTestCase{float32(kExpected), true, false, ""},
-		equalsTestCase{float64(kExpected), true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{castedInt, false, false, ""},
-		equalsTestCase{int64(0), false, false, ""},
-		equalsTestCase{int64(math.MinInt64), false, false, ""},
-		equalsTestCase{int64(math.MaxInt64), false, false, ""},
-		equalsTestCase{uint64(0), false, false, ""},
-		equalsTestCase{uint64(math.MaxUint64), false, false, ""},
-		equalsTestCase{float32(kExpected / 2), false, false, ""},
-		equalsTestCase{float64(kExpected / 2), false, false, ""},
-		equalsTestCase{complex128(kExpected + 2i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) Complex128AboveExactIntegerRange() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := Equals(complex128(kTwoTo54 + 1))
-	ExpectEq("(1.8014398509481984e+16+0i)", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Integers.
-		equalsTestCase{int64(kTwoTo54 - 2), false, false, ""},
-		equalsTestCase{int64(kTwoTo54 - 1), true, false, ""},
-		equalsTestCase{int64(kTwoTo54 + 0), true, false, ""},
-		equalsTestCase{int64(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{int64(kTwoTo54 + 2), true, false, ""},
-		equalsTestCase{int64(kTwoTo54 + 3), false, false, ""},
-
-		equalsTestCase{uint64(kTwoTo54 - 2), false, false, ""},
-		equalsTestCase{uint64(kTwoTo54 - 1), true, false, ""},
-		equalsTestCase{uint64(kTwoTo54 + 0), true, false, ""},
-		equalsTestCase{uint64(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{uint64(kTwoTo54 + 2), true, false, ""},
-		equalsTestCase{uint64(kTwoTo54 + 3), false, false, ""},
-
-		// Double-precision floating point.
-		equalsTestCase{float64(kTwoTo54 - 2), false, false, ""},
-		equalsTestCase{float64(kTwoTo54 - 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 0), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 2), true, false, ""},
-		equalsTestCase{float64(kTwoTo54 + 3), false, false, ""},
-
-		equalsTestCase{complex128(kTwoTo54 - 2), false, false, ""},
-		equalsTestCase{complex128(kTwoTo54 - 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 0), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 1), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 2), true, false, ""},
-		equalsTestCase{complex128(kTwoTo54 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) Complex128WithNonZeroImaginaryPart() {
-	const kRealPart = 17
-	const kImagPart = 0.25i
-	const kExpected = kRealPart + kImagPart
-	matcher := Equals(complex128(kExpected))
-	ExpectEq("(17+0.25i)", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Various types of the expected value.
-		equalsTestCase{kExpected, true, false, ""},
-		equalsTestCase{kRealPart + kImagPart, true, false, ""},
-		equalsTestCase{complex64(kExpected), true, false, ""},
-		equalsTestCase{complex128(kExpected), true, false, ""},
-
-		// Non-equal values of numeric type.
-		equalsTestCase{int(kRealPart), false, false, ""},
-		equalsTestCase{int8(kRealPart), false, false, ""},
-		equalsTestCase{int16(kRealPart), false, false, ""},
-		equalsTestCase{int32(kRealPart), false, false, ""},
-		equalsTestCase{int64(kRealPart), false, false, ""},
-		equalsTestCase{uint(kRealPart), false, false, ""},
-		equalsTestCase{uint8(kRealPart), false, false, ""},
-		equalsTestCase{uint16(kRealPart), false, false, ""},
-		equalsTestCase{uint32(kRealPart), false, false, ""},
-		equalsTestCase{uint64(kRealPart), false, false, ""},
-		equalsTestCase{float32(kRealPart), false, false, ""},
-		equalsTestCase{float64(kRealPart), false, false, ""},
-		equalsTestCase{complex64(kRealPart), false, false, ""},
-		equalsTestCase{complex64(kRealPart + kImagPart + 0.5), false, false, ""},
-		equalsTestCase{complex64(kRealPart + kImagPart + 0.5i), false, false, ""},
-		equalsTestCase{complex128(kRealPart), false, false, ""},
-		equalsTestCase{complex128(kRealPart + kImagPart + 0.5), false, false, ""},
-		equalsTestCase{complex128(kRealPart + kImagPart + 0.5i), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// array
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) Array() {
-	var someArray [3]int
-	f := func() { Equals(someArray) }
-	ExpectThat(f, Panics(HasSubstr("unsupported kind array")))
-}
-
-////////////////////////////////////////////////////////////////////////
-// chan
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NilChan() {
-	var nilChan1 chan int
-	var nilChan2 chan int
-	var nilChan3 chan uint
-	var nonNilChan1 chan int = make(chan int)
-	var nonNilChan2 chan uint = make(chan uint)
-
-	matcher := Equals(nilChan1)
-	ExpectEq("<nil>", matcher.Description())
-
-	cases := []equalsTestCase{
-		// int channels
-		equalsTestCase{nilChan1, true, false, ""},
-		equalsTestCase{nilChan2, true, false, ""},
-		equalsTestCase{nonNilChan1, false, false, ""},
-
-		// uint channels
-		equalsTestCase{nilChan3, false, true, "which is not a chan int"},
-		equalsTestCase{nonNilChan2, false, true, "which is not a chan int"},
-
-		// Other types.
-		equalsTestCase{0, false, true, "which is not a chan int"},
-		equalsTestCase{bool(false), false, true, "which is not a chan int"},
-		equalsTestCase{int(0), false, true, "which is not a chan int"},
-		equalsTestCase{int8(0), false, true, "which is not a chan int"},
-		equalsTestCase{int16(0), false, true, "which is not a chan int"},
-		equalsTestCase{int32(0), false, true, "which is not a chan int"},
-		equalsTestCase{int64(0), false, true, "which is not a chan int"},
-		equalsTestCase{uint(0), false, true, "which is not a chan int"},
-		equalsTestCase{uint8(0), false, true, "which is not a chan int"},
-		equalsTestCase{uint16(0), false, true, "which is not a chan int"},
-		equalsTestCase{uint32(0), false, true, "which is not a chan int"},
-		equalsTestCase{uint64(0), false, true, "which is not a chan int"},
-		equalsTestCase{true, false, true, "which is not a chan int"},
-		equalsTestCase{[...]int{}, false, true, "which is not a chan int"},
-		equalsTestCase{func() {}, false, true, "which is not a chan int"},
-		equalsTestCase{map[int]int{}, false, true, "which is not a chan int"},
-		equalsTestCase{&someInt, false, true, "which is not a chan int"},
-		equalsTestCase{[]int{}, false, true, "which is not a chan int"},
-		equalsTestCase{"taco", false, true, "which is not a chan int"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not a chan int"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) NonNilChan() {
-	var nilChan1 chan int
-	var nilChan2 chan uint
-	var nonNilChan1 chan int = make(chan int)
-	var nonNilChan2 chan int = make(chan int)
-	var nonNilChan3 chan uint = make(chan uint)
-
-	matcher := Equals(nonNilChan1)
-	ExpectEq(fmt.Sprintf("%v", nonNilChan1), matcher.Description())
-
-	cases := []equalsTestCase{
-		// int channels
-		equalsTestCase{nonNilChan1, true, false, ""},
-		equalsTestCase{nonNilChan2, false, false, ""},
-		equalsTestCase{nilChan1, false, false, ""},
-
-		// uint channels
-		equalsTestCase{nilChan2, false, true, "which is not a chan int"},
-		equalsTestCase{nonNilChan3, false, true, "which is not a chan int"},
-
-		// Other types.
-		equalsTestCase{0, false, true, "which is not a chan int"},
-		equalsTestCase{bool(false), false, true, "which is not a chan int"},
-		equalsTestCase{int(0), false, true, "which is not a chan int"},
-		equalsTestCase{int8(0), false, true, "which is not a chan int"},
-		equalsTestCase{int16(0), false, true, "which is not a chan int"},
-		equalsTestCase{int32(0), false, true, "which is not a chan int"},
-		equalsTestCase{int64(0), false, true, "which is not a chan int"},
-		equalsTestCase{uint(0), false, true, "which is not a chan int"},
-		equalsTestCase{uint8(0), false, true, "which is not a chan int"},
-		equalsTestCase{uint16(0), false, true, "which is not a chan int"},
-		equalsTestCase{uint32(0), false, true, "which is not a chan int"},
-		equalsTestCase{uint64(0), false, true, "which is not a chan int"},
-		equalsTestCase{true, false, true, "which is not a chan int"},
-		equalsTestCase{[...]int{}, false, true, "which is not a chan int"},
-		equalsTestCase{func() {}, false, true, "which is not a chan int"},
-		equalsTestCase{map[int]int{}, false, true, "which is not a chan int"},
-		equalsTestCase{&someInt, false, true, "which is not a chan int"},
-		equalsTestCase{[]int{}, false, true, "which is not a chan int"},
-		equalsTestCase{"taco", false, true, "which is not a chan int"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not a chan int"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) ChanDirection() {
-	var chan1 chan<- int
-	var chan2 <-chan int
-	var chan3 chan int
-
-	matcher := Equals(chan1)
-	ExpectEq(fmt.Sprintf("%v", chan1), matcher.Description())
-
-	cases := []equalsTestCase{
-		equalsTestCase{chan1, true, false, ""},
-		equalsTestCase{chan2, false, true, "which is not a chan<- int"},
-		equalsTestCase{chan3, false, true, "which is not a chan<- int"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// func
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) Functions() {
-	func1 := func() {}
-	func2 := func() {}
-	func3 := func(x int) {}
-
-	matcher := Equals(func1)
-	ExpectEq(fmt.Sprintf("%v", func1), matcher.Description())
-
-	cases := []equalsTestCase{
-		// Functions.
-		equalsTestCase{func1, true, false, ""},
-		equalsTestCase{func2, false, false, ""},
-		equalsTestCase{func3, false, false, ""},
-
-		// Other types.
-		equalsTestCase{0, false, true, "which is not a function"},
-		equalsTestCase{bool(false), false, true, "which is not a function"},
-		equalsTestCase{int(0), false, true, "which is not a function"},
-		equalsTestCase{int8(0), false, true, "which is not a function"},
-		equalsTestCase{int16(0), false, true, "which is not a function"},
-		equalsTestCase{int32(0), false, true, "which is not a function"},
-		equalsTestCase{int64(0), false, true, "which is not a function"},
-		equalsTestCase{uint(0), false, true, "which is not a function"},
-		equalsTestCase{uint8(0), false, true, "which is not a function"},
-		equalsTestCase{uint16(0), false, true, "which is not a function"},
-		equalsTestCase{uint32(0), false, true, "which is not a function"},
-		equalsTestCase{uint64(0), false, true, "which is not a function"},
-		equalsTestCase{true, false, true, "which is not a function"},
-		equalsTestCase{[...]int{}, false, true, "which is not a function"},
-		equalsTestCase{map[int]int{}, false, true, "which is not a function"},
-		equalsTestCase{&someInt, false, true, "which is not a function"},
-		equalsTestCase{[]int{}, false, true, "which is not a function"},
-		equalsTestCase{"taco", false, true, "which is not a function"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not a function"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// map
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NilMap() {
-	var nilMap1 map[int]int
-	var nilMap2 map[int]int
-	var nilMap3 map[int]uint
-	var nonNilMap1 map[int]int = make(map[int]int)
-	var nonNilMap2 map[int]uint = make(map[int]uint)
-
-	matcher := Equals(nilMap1)
-	ExpectEq("map[]", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Correct type.
-		equalsTestCase{nilMap1, true, false, ""},
-		equalsTestCase{nilMap2, true, false, ""},
-		equalsTestCase{nilMap3, true, false, ""},
-		equalsTestCase{nonNilMap1, false, false, ""},
-		equalsTestCase{nonNilMap2, false, false, ""},
-
-		// Other types.
-		equalsTestCase{0, false, true, "which is not a map"},
-		equalsTestCase{bool(false), false, true, "which is not a map"},
-		equalsTestCase{int(0), false, true, "which is not a map"},
-		equalsTestCase{int8(0), false, true, "which is not a map"},
-		equalsTestCase{int16(0), false, true, "which is not a map"},
-		equalsTestCase{int32(0), false, true, "which is not a map"},
-		equalsTestCase{int64(0), false, true, "which is not a map"},
-		equalsTestCase{uint(0), false, true, "which is not a map"},
-		equalsTestCase{uint8(0), false, true, "which is not a map"},
-		equalsTestCase{uint16(0), false, true, "which is not a map"},
-		equalsTestCase{uint32(0), false, true, "which is not a map"},
-		equalsTestCase{uint64(0), false, true, "which is not a map"},
-		equalsTestCase{true, false, true, "which is not a map"},
-		equalsTestCase{[...]int{}, false, true, "which is not a map"},
-		equalsTestCase{func() {}, false, true, "which is not a map"},
-		equalsTestCase{&someInt, false, true, "which is not a map"},
-		equalsTestCase{[]int{}, false, true, "which is not a map"},
-		equalsTestCase{"taco", false, true, "which is not a map"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not a map"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) NonNilMap() {
-	var nilMap1 map[int]int
-	var nilMap2 map[int]uint
-	var nonNilMap1 map[int]int = make(map[int]int)
-	var nonNilMap2 map[int]int = make(map[int]int)
-	var nonNilMap3 map[int]uint = make(map[int]uint)
-
-	matcher := Equals(nonNilMap1)
-	ExpectEq("map[]", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Correct type.
-		equalsTestCase{nonNilMap1, true, false, ""},
-		equalsTestCase{nonNilMap2, false, false, ""},
-		equalsTestCase{nonNilMap3, false, false, ""},
-		equalsTestCase{nilMap1, false, false, ""},
-		equalsTestCase{nilMap2, false, false, ""},
-
-		// Other types.
-		equalsTestCase{0, false, true, "which is not a map"},
-		equalsTestCase{bool(false), false, true, "which is not a map"},
-		equalsTestCase{int(0), false, true, "which is not a map"},
-		equalsTestCase{int8(0), false, true, "which is not a map"},
-		equalsTestCase{int16(0), false, true, "which is not a map"},
-		equalsTestCase{int32(0), false, true, "which is not a map"},
-		equalsTestCase{int64(0), false, true, "which is not a map"},
-		equalsTestCase{uint(0), false, true, "which is not a map"},
-		equalsTestCase{uint8(0), false, true, "which is not a map"},
-		equalsTestCase{uint16(0), false, true, "which is not a map"},
-		equalsTestCase{uint32(0), false, true, "which is not a map"},
-		equalsTestCase{uint64(0), false, true, "which is not a map"},
-		equalsTestCase{true, false, true, "which is not a map"},
-		equalsTestCase{[...]int{}, false, true, "which is not a map"},
-		equalsTestCase{func() {}, false, true, "which is not a map"},
-		equalsTestCase{&someInt, false, true, "which is not a map"},
-		equalsTestCase{[]int{}, false, true, "which is not a map"},
-		equalsTestCase{"taco", false, true, "which is not a map"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not a map"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// Pointers
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NilPointer() {
-	var someInt int = 17
-	var someUint uint = 17
-
-	var nilInt1 *int
-	var nilInt2 *int
-	var nilUint *uint
-	var nonNilInt *int = &someInt
-	var nonNilUint *uint = &someUint
-
-	matcher := Equals(nilInt1)
-	ExpectEq("<nil>", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Correct type.
-		equalsTestCase{nilInt1, true, false, ""},
-		equalsTestCase{nilInt2, true, false, ""},
-		equalsTestCase{nonNilInt, false, false, ""},
-
-		// Incorrect type.
-		equalsTestCase{nilUint, false, true, "which is not a *int"},
-		equalsTestCase{nonNilUint, false, true, "which is not a *int"},
-
-		// Other types.
-		equalsTestCase{0, false, true, "which is not a *int"},
-		equalsTestCase{bool(false), false, true, "which is not a *int"},
-		equalsTestCase{int(0), false, true, "which is not a *int"},
-		equalsTestCase{int8(0), false, true, "which is not a *int"},
-		equalsTestCase{int16(0), false, true, "which is not a *int"},
-		equalsTestCase{int32(0), false, true, "which is not a *int"},
-		equalsTestCase{int64(0), false, true, "which is not a *int"},
-		equalsTestCase{uint(0), false, true, "which is not a *int"},
-		equalsTestCase{uint8(0), false, true, "which is not a *int"},
-		equalsTestCase{uint16(0), false, true, "which is not a *int"},
-		equalsTestCase{uint32(0), false, true, "which is not a *int"},
-		equalsTestCase{uint64(0), false, true, "which is not a *int"},
-		equalsTestCase{true, false, true, "which is not a *int"},
-		equalsTestCase{[...]int{}, false, true, "which is not a *int"},
-		equalsTestCase{func() {}, false, true, "which is not a *int"},
-		equalsTestCase{map[int]int{}, false, true, "which is not a *int"},
-		equalsTestCase{[]int{}, false, true, "which is not a *int"},
-		equalsTestCase{"taco", false, true, "which is not a *int"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not a *int"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) NonNilPointer() {
-	var someInt int = 17
-	var someOtherInt int = 17
-	var someUint uint = 17
-
-	var nilInt *int
-	var nilUint *uint
-	var nonNilInt1 *int = &someInt
-	var nonNilInt2 *int = &someOtherInt
-	var nonNilUint *uint = &someUint
-
-	matcher := Equals(nonNilInt1)
-	ExpectEq(fmt.Sprintf("%v", nonNilInt1), matcher.Description())
-
-	cases := []equalsTestCase{
-		// Correct type.
-		equalsTestCase{nonNilInt1, true, false, ""},
-		equalsTestCase{nonNilInt2, false, false, ""},
-		equalsTestCase{nilInt, false, false, ""},
-
-		// Incorrect type.
-		equalsTestCase{nilUint, false, true, "which is not a *int"},
-		equalsTestCase{nonNilUint, false, true, "which is not a *int"},
-
-		// Other types.
-		equalsTestCase{0, false, true, "which is not a *int"},
-		equalsTestCase{bool(false), false, true, "which is not a *int"},
-		equalsTestCase{int(0), false, true, "which is not a *int"},
-		equalsTestCase{int8(0), false, true, "which is not a *int"},
-		equalsTestCase{int16(0), false, true, "which is not a *int"},
-		equalsTestCase{int32(0), false, true, "which is not a *int"},
-		equalsTestCase{int64(0), false, true, "which is not a *int"},
-		equalsTestCase{uint(0), false, true, "which is not a *int"},
-		equalsTestCase{uint8(0), false, true, "which is not a *int"},
-		equalsTestCase{uint16(0), false, true, "which is not a *int"},
-		equalsTestCase{uint32(0), false, true, "which is not a *int"},
-		equalsTestCase{uint64(0), false, true, "which is not a *int"},
-		equalsTestCase{true, false, true, "which is not a *int"},
-		equalsTestCase{[...]int{}, false, true, "which is not a *int"},
-		equalsTestCase{func() {}, false, true, "which is not a *int"},
-		equalsTestCase{map[int]int{}, false, true, "which is not a *int"},
-		equalsTestCase{[]int{}, false, true, "which is not a *int"},
-		equalsTestCase{"taco", false, true, "which is not a *int"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not a *int"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// Slices
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NilSlice() {
-	var nilInt1 []int
-	var nilInt2 []int
-	var nilUint []uint
-
-	var nonNilInt []int = make([]int, 0)
-	var nonNilUint []uint = make([]uint, 0)
-
-	matcher := Equals(nilInt1)
-	ExpectEq("[]", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Correct type.
-		equalsTestCase{nilInt1, true, false, ""},
-		equalsTestCase{nilInt2, true, false, ""},
-		equalsTestCase{nonNilInt, false, false, ""},
-
-		// Incorrect type.
-		equalsTestCase{nilUint, false, true, "which is not a []int"},
-		equalsTestCase{nonNilUint, false, true, "which is not a []int"},
-
-		// Other types.
-		equalsTestCase{0, false, true, "which is not a []int"},
-		equalsTestCase{bool(false), false, true, "which is not a []int"},
-		equalsTestCase{int(0), false, true, "which is not a []int"},
-		equalsTestCase{int8(0), false, true, "which is not a []int"},
-		equalsTestCase{int16(0), false, true, "which is not a []int"},
-		equalsTestCase{int32(0), false, true, "which is not a []int"},
-		equalsTestCase{int64(0), false, true, "which is not a []int"},
-		equalsTestCase{uint(0), false, true, "which is not a []int"},
-		equalsTestCase{uint8(0), false, true, "which is not a []int"},
-		equalsTestCase{uint16(0), false, true, "which is not a []int"},
-		equalsTestCase{uint32(0), false, true, "which is not a []int"},
-		equalsTestCase{uint64(0), false, true, "which is not a []int"},
-		equalsTestCase{true, false, true, "which is not a []int"},
-		equalsTestCase{[...]int{}, false, true, "which is not a []int"},
-		equalsTestCase{func() {}, false, true, "which is not a []int"},
-		equalsTestCase{map[int]int{}, false, true, "which is not a []int"},
-		equalsTestCase{"taco", false, true, "which is not a []int"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not a []int"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) NonNilSlice() {
-	nonNil := make([]int, 0)
-	f := func() { Equals(nonNil) }
-	ExpectThat(f, Panics(HasSubstr("non-nil slice")))
-}
-
-////////////////////////////////////////////////////////////////////////
-// string
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) String() {
-	partial := "taco"
-	expected := fmt.Sprintf("%s%d", partial, 1)
-
-	matcher := Equals(expected)
-	ExpectEq("taco1", matcher.Description())
-
-	type stringAlias string
-
-	cases := []equalsTestCase{
-		// Correct types.
-		equalsTestCase{"taco1", true, false, ""},
-		equalsTestCase{"taco" + "1", true, false, ""},
-		equalsTestCase{expected, true, false, ""},
-		equalsTestCase{stringAlias("taco1"), true, false, ""},
-
-		equalsTestCase{"", false, false, ""},
-		equalsTestCase{"taco", false, false, ""},
-		equalsTestCase{"taco1\x00", false, false, ""},
-		equalsTestCase{"taco2", false, false, ""},
-		equalsTestCase{stringAlias("taco2"), false, false, ""},
-
-		// Other types.
-		equalsTestCase{0, false, true, "which is not a string"},
-		equalsTestCase{bool(false), false, true, "which is not a string"},
-		equalsTestCase{int(0), false, true, "which is not a string"},
-		equalsTestCase{int8(0), false, true, "which is not a string"},
-		equalsTestCase{int16(0), false, true, "which is not a string"},
-		equalsTestCase{int32(0), false, true, "which is not a string"},
-		equalsTestCase{int64(0), false, true, "which is not a string"},
-		equalsTestCase{uint(0), false, true, "which is not a string"},
-		equalsTestCase{uint8(0), false, true, "which is not a string"},
-		equalsTestCase{uint16(0), false, true, "which is not a string"},
-		equalsTestCase{uint32(0), false, true, "which is not a string"},
-		equalsTestCase{uint64(0), false, true, "which is not a string"},
-		equalsTestCase{true, false, true, "which is not a string"},
-		equalsTestCase{[...]int{}, false, true, "which is not a string"},
-		equalsTestCase{func() {}, false, true, "which is not a string"},
-		equalsTestCase{map[int]int{}, false, true, "which is not a string"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not a string"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) StringAlias() {
-	type stringAlias string
-
-	matcher := Equals(stringAlias("taco"))
-	ExpectEq("taco", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Correct types.
-		equalsTestCase{stringAlias("taco"), true, false, ""},
-		equalsTestCase{"taco", true, false, ""},
-
-		equalsTestCase{"burrito", false, false, ""},
-		equalsTestCase{stringAlias("burrito"), false, false, ""},
-
-		// Other types.
-		equalsTestCase{0, false, true, "which is not a string"},
-		equalsTestCase{bool(false), false, true, "which is not a string"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// struct
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) Struct() {
-	type someStruct struct{ foo uint }
-	f := func() { Equals(someStruct{17}) }
-	ExpectThat(f, Panics(HasSubstr("unsupported kind struct")))
-}
-
-////////////////////////////////////////////////////////////////////////
-// unsafe.Pointer
-////////////////////////////////////////////////////////////////////////
-
-func (t *EqualsTest) NilUnsafePointer() {
-	someInt := int(17)
-
-	var nilPtr1 unsafe.Pointer
-	var nilPtr2 unsafe.Pointer
-	var nonNilPtr unsafe.Pointer = unsafe.Pointer(&someInt)
-
-	matcher := Equals(nilPtr1)
-	ExpectEq("<nil>", matcher.Description())
-
-	cases := []equalsTestCase{
-		// Correct type.
-		equalsTestCase{nilPtr1, true, false, ""},
-		equalsTestCase{nilPtr2, true, false, ""},
-		equalsTestCase{nonNilPtr, false, false, ""},
-
-		// Other types.
-		equalsTestCase{0, false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{bool(false), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{int(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{int8(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{int16(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{int32(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{int64(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{uint(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{uint8(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{uint16(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{uint32(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{uint64(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{uintptr(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{true, false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{[...]int{}, false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{make(chan int), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{func() {}, false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{map[int]int{}, false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{&someInt, false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{[]int{}, false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{"taco", false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not a unsafe.Pointer"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *EqualsTest) NonNilUnsafePointer() {
-	someInt := int(17)
-	someOtherInt := int(17)
-
-	var nilPtr unsafe.Pointer
-	var nonNilPtr1 unsafe.Pointer = unsafe.Pointer(&someInt)
-	var nonNilPtr2 unsafe.Pointer = unsafe.Pointer(&someOtherInt)
-
-	matcher := Equals(nonNilPtr1)
-	ExpectEq(fmt.Sprintf("%v", nonNilPtr1), matcher.Description())
-
-	cases := []equalsTestCase{
-		// Correct type.
-		equalsTestCase{nonNilPtr1, true, false, ""},
-		equalsTestCase{nonNilPtr2, false, false, ""},
-		equalsTestCase{nilPtr, false, false, ""},
-
-		// Other types.
-		equalsTestCase{0, false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{bool(false), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{int(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{int8(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{int16(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{int32(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{int64(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{uint(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{uint8(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{uint16(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{uint32(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{uint64(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{uintptr(0), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{true, false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{[...]int{}, false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{make(chan int), false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{func() {}, false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{map[int]int{}, false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{&someInt, false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{[]int{}, false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{"taco", false, true, "which is not a unsafe.Pointer"},
-		equalsTestCase{equalsTestCase{}, false, true, "which is not a unsafe.Pointer"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}

+ 0 - 51
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/error.go

@@ -1,51 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-// Error returns a matcher that matches non-nil values implementing the
-// built-in error interface for whom the return value of Error() matches the
-// supplied matcher.
-//
-// For example:
-//
-//     err := errors.New("taco burrito")
-//
-//     Error(Equals("taco burrito"))  // matches err
-//     Error(HasSubstr("taco"))       // matches err
-//     Error(HasSubstr("enchilada"))  // doesn't match err
-//
-func Error(m Matcher) Matcher {
-	return &errorMatcher{m}
-}
-
-type errorMatcher struct {
-	wrappedMatcher Matcher
-}
-
-func (m *errorMatcher) Description() string {
-	return "error " + m.wrappedMatcher.Description()
-}
-
-func (m *errorMatcher) Matches(c interface{}) error {
-	// Make sure that c is an error.
-	e, ok := c.(error)
-	if !ok {
-		return NewFatalError("which is not an error")
-	}
-
-	// Pass on the error text to the wrapped matcher.
-	return m.wrappedMatcher.Matches(e.Error())
-}

+ 0 - 92
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/error_test.go

@@ -1,92 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	"errors"
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type ErrorTest struct {
-	matcherCalled     bool
-	suppliedCandidate interface{}
-	wrappedError      error
-
-	matcher Matcher
-}
-
-func init() { RegisterTestSuite(&ErrorTest{}) }
-
-func (t *ErrorTest) SetUp(i *TestInfo) {
-	wrapped := &fakeMatcher{
-		func(c interface{}) error {
-			t.matcherCalled = true
-			t.suppliedCandidate = c
-			return t.wrappedError
-		},
-		"is foo",
-	}
-
-	t.matcher = Error(wrapped)
-}
-
-func isFatal(err error) bool {
-	_, isFatal := err.(*FatalError)
-	return isFatal
-}
-
-////////////////////////////////////////////////////////////////////////
-// Tests
-////////////////////////////////////////////////////////////////////////
-
-func (t *ErrorTest) Description() {
-	ExpectThat(t.matcher.Description(), Equals("error is foo"))
-}
-
-func (t *ErrorTest) CandidateIsNil() {
-	err := t.matcher.Matches(nil)
-
-	ExpectThat(t.matcherCalled, Equals(false))
-	ExpectThat(err.Error(), Equals("which is not an error"))
-	ExpectTrue(isFatal(err))
-}
-
-func (t *ErrorTest) CandidateIsString() {
-	err := t.matcher.Matches("taco")
-
-	ExpectThat(t.matcherCalled, Equals(false))
-	ExpectThat(err.Error(), Equals("which is not an error"))
-	ExpectTrue(isFatal(err))
-}
-
-func (t *ErrorTest) CallsWrappedMatcher() {
-	candidate := errors.New("taco")
-	t.matcher.Matches(candidate)
-
-	ExpectThat(t.matcherCalled, Equals(true))
-	ExpectThat(t.suppliedCandidate, Equals("taco"))
-}
-
-func (t *ErrorTest) ReturnsWrappedMatcherResult() {
-	t.wrappedError = errors.New("burrito")
-	err := t.matcher.Matches(errors.New(""))
-	ExpectThat(err, Equals(t.wrappedError))
-}

+ 0 - 39
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/greater_or_equal.go

@@ -1,39 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"fmt"
-	"reflect"
-)
-
-// GreaterOrEqual returns a matcher that matches integer, floating point, or
-// strings values v such that v >= x. Comparison is not defined between numeric
-// and string types, but is defined between all integer and floating point
-// types.
-//
-// x must itself be an integer, floating point, or string type; otherwise,
-// GreaterOrEqual will panic.
-func GreaterOrEqual(x interface{}) Matcher {
-	desc := fmt.Sprintf("greater than or equal to %v", x)
-
-	// Special case: make it clear that strings are strings.
-	if reflect.TypeOf(x).Kind() == reflect.String {
-		desc = fmt.Sprintf("greater than or equal to \"%s\"", x)
-	}
-
-	return transformDescription(Not(LessThan(x)), desc)
-}

+ 0 - 1059
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/greater_or_equal_test.go

@@ -1,1059 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	"math"
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type GreaterOrEqualTest struct {
-}
-
-func init() { RegisterTestSuite(&GreaterOrEqualTest{}) }
-
-type geTestCase struct {
-	candidate      interface{}
-	expectedResult bool
-	shouldBeFatal  bool
-	expectedError  string
-}
-
-func (t *GreaterOrEqualTest) checkTestCases(matcher Matcher, cases []geTestCase) {
-	for i, c := range cases {
-		err := matcher.Matches(c.candidate)
-
-		ExpectThat(
-			(err == nil),
-			Equals(c.expectedResult),
-			"Case %d (candidate %v)",
-			i,
-			c.candidate)
-
-		if err == nil {
-			continue
-		}
-
-		_, isFatal := err.(*FatalError)
-		ExpectEq(
-			c.shouldBeFatal,
-			isFatal,
-			"Case %d (candidate %v)",
-			i,
-			c.candidate)
-
-		ExpectThat(
-			err,
-			Error(Equals(c.expectedError)),
-			"Case %d (candidate %v)",
-			i,
-			c.candidate)
-	}
-}
-
-////////////////////////////////////////////////////////////////////////
-// Integer literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *GreaterOrEqualTest) IntegerCandidateBadTypes() {
-	matcher := GreaterOrEqual(int(-150))
-
-	cases := []geTestCase{
-		geTestCase{true, false, true, "which is not comparable"},
-		geTestCase{uintptr(17), false, true, "which is not comparable"},
-		geTestCase{complex64(-151), false, true, "which is not comparable"},
-		geTestCase{complex128(-151), false, true, "which is not comparable"},
-		geTestCase{[...]int{-151}, false, true, "which is not comparable"},
-		geTestCase{make(chan int), false, true, "which is not comparable"},
-		geTestCase{func() {}, false, true, "which is not comparable"},
-		geTestCase{map[int]int{}, false, true, "which is not comparable"},
-		geTestCase{&geTestCase{}, false, true, "which is not comparable"},
-		geTestCase{make([]int, 0), false, true, "which is not comparable"},
-		geTestCase{"-151", false, true, "which is not comparable"},
-		geTestCase{geTestCase{}, false, true, "which is not comparable"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterOrEqualTest) FloatCandidateBadTypes() {
-	matcher := GreaterOrEqual(float32(-150))
-
-	cases := []geTestCase{
-		geTestCase{true, false, true, "which is not comparable"},
-		geTestCase{uintptr(17), false, true, "which is not comparable"},
-		geTestCase{complex64(-151), false, true, "which is not comparable"},
-		geTestCase{complex128(-151), false, true, "which is not comparable"},
-		geTestCase{[...]int{-151}, false, true, "which is not comparable"},
-		geTestCase{make(chan int), false, true, "which is not comparable"},
-		geTestCase{func() {}, false, true, "which is not comparable"},
-		geTestCase{map[int]int{}, false, true, "which is not comparable"},
-		geTestCase{&geTestCase{}, false, true, "which is not comparable"},
-		geTestCase{make([]int, 0), false, true, "which is not comparable"},
-		geTestCase{"-151", false, true, "which is not comparable"},
-		geTestCase{geTestCase{}, false, true, "which is not comparable"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterOrEqualTest) StringCandidateBadTypes() {
-	matcher := GreaterOrEqual("17")
-
-	cases := []geTestCase{
-		geTestCase{true, false, true, "which is not comparable"},
-		geTestCase{int(0), false, true, "which is not comparable"},
-		geTestCase{int8(0), false, true, "which is not comparable"},
-		geTestCase{int16(0), false, true, "which is not comparable"},
-		geTestCase{int32(0), false, true, "which is not comparable"},
-		geTestCase{int64(0), false, true, "which is not comparable"},
-		geTestCase{uint(0), false, true, "which is not comparable"},
-		geTestCase{uint8(0), false, true, "which is not comparable"},
-		geTestCase{uint16(0), false, true, "which is not comparable"},
-		geTestCase{uint32(0), false, true, "which is not comparable"},
-		geTestCase{uint64(0), false, true, "which is not comparable"},
-		geTestCase{uintptr(17), false, true, "which is not comparable"},
-		geTestCase{float32(0), false, true, "which is not comparable"},
-		geTestCase{float64(0), false, true, "which is not comparable"},
-		geTestCase{complex64(-151), false, true, "which is not comparable"},
-		geTestCase{complex128(-151), false, true, "which is not comparable"},
-		geTestCase{[...]int{-151}, false, true, "which is not comparable"},
-		geTestCase{make(chan int), false, true, "which is not comparable"},
-		geTestCase{func() {}, false, true, "which is not comparable"},
-		geTestCase{map[int]int{}, false, true, "which is not comparable"},
-		geTestCase{&geTestCase{}, false, true, "which is not comparable"},
-		geTestCase{make([]int, 0), false, true, "which is not comparable"},
-		geTestCase{geTestCase{}, false, true, "which is not comparable"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterOrEqualTest) BadArgument() {
-	panicked := false
-
-	defer func() {
-		ExpectThat(panicked, Equals(true))
-	}()
-
-	defer func() {
-		if r := recover(); r != nil {
-			panicked = true
-		}
-	}()
-
-	GreaterOrEqual(complex128(0))
-}
-
-////////////////////////////////////////////////////////////////////////
-// Integer literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *GreaterOrEqualTest) NegativeIntegerLiteral() {
-	matcher := GreaterOrEqual(-150)
-	desc := matcher.Description()
-	expectedDesc := "greater than or equal to -150"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []geTestCase{
-		// Signed integers.
-		geTestCase{-(1 << 30), false, false, ""},
-		geTestCase{-151, false, false, ""},
-		geTestCase{-150, true, false, ""},
-		geTestCase{0, true, false, ""},
-		geTestCase{17, true, false, ""},
-
-		geTestCase{int(-(1 << 30)), false, false, ""},
-		geTestCase{int(-151), false, false, ""},
-		geTestCase{int(-150), true, false, ""},
-		geTestCase{int(0), true, false, ""},
-		geTestCase{int(17), true, false, ""},
-
-		geTestCase{int8(-127), true, false, ""},
-		geTestCase{int8(0), true, false, ""},
-		geTestCase{int8(17), true, false, ""},
-
-		geTestCase{int16(-(1 << 14)), false, false, ""},
-		geTestCase{int16(-151), false, false, ""},
-		geTestCase{int16(-150), true, false, ""},
-		geTestCase{int16(0), true, false, ""},
-		geTestCase{int16(17), true, false, ""},
-
-		geTestCase{int32(-(1 << 30)), false, false, ""},
-		geTestCase{int32(-151), false, false, ""},
-		geTestCase{int32(-150), true, false, ""},
-		geTestCase{int32(0), true, false, ""},
-		geTestCase{int32(17), true, false, ""},
-
-		geTestCase{int64(-(1 << 30)), false, false, ""},
-		geTestCase{int64(-151), false, false, ""},
-		geTestCase{int64(-150), true, false, ""},
-		geTestCase{int64(0), true, false, ""},
-		geTestCase{int64(17), true, false, ""},
-
-		// Unsigned integers.
-		geTestCase{uint((1 << 32) - 151), true, false, ""},
-		geTestCase{uint(0), true, false, ""},
-		geTestCase{uint(17), true, false, ""},
-
-		geTestCase{uint8(0), true, false, ""},
-		geTestCase{uint8(17), true, false, ""},
-		geTestCase{uint8(253), true, false, ""},
-
-		geTestCase{uint16((1 << 16) - 151), true, false, ""},
-		geTestCase{uint16(0), true, false, ""},
-		geTestCase{uint16(17), true, false, ""},
-
-		geTestCase{uint32((1 << 32) - 151), true, false, ""},
-		geTestCase{uint32(0), true, false, ""},
-		geTestCase{uint32(17), true, false, ""},
-
-		geTestCase{uint64((1 << 64) - 151), true, false, ""},
-		geTestCase{uint64(0), true, false, ""},
-		geTestCase{uint64(17), true, false, ""},
-
-		// Floating point.
-		geTestCase{float32(-(1 << 30)), false, false, ""},
-		geTestCase{float32(-151), false, false, ""},
-		geTestCase{float32(-150.1), false, false, ""},
-		geTestCase{float32(-150), true, false, ""},
-		geTestCase{float32(-149.9), true, false, ""},
-		geTestCase{float32(0), true, false, ""},
-		geTestCase{float32(17), true, false, ""},
-		geTestCase{float32(160), true, false, ""},
-
-		geTestCase{float64(-(1 << 30)), false, false, ""},
-		geTestCase{float64(-151), false, false, ""},
-		geTestCase{float64(-150.1), false, false, ""},
-		geTestCase{float64(-150), true, false, ""},
-		geTestCase{float64(-149.9), true, false, ""},
-		geTestCase{float64(0), true, false, ""},
-		geTestCase{float64(17), true, false, ""},
-		geTestCase{float64(160), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterOrEqualTest) ZeroIntegerLiteral() {
-	matcher := GreaterOrEqual(0)
-	desc := matcher.Description()
-	expectedDesc := "greater than or equal to 0"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []geTestCase{
-		// Signed integers.
-		geTestCase{-(1 << 30), false, false, ""},
-		geTestCase{-1, false, false, ""},
-		geTestCase{0, true, false, ""},
-		geTestCase{1, true, false, ""},
-		geTestCase{17, true, false, ""},
-		geTestCase{(1 << 30), true, false, ""},
-
-		geTestCase{int(-(1 << 30)), false, false, ""},
-		geTestCase{int(-1), false, false, ""},
-		geTestCase{int(0), true, false, ""},
-		geTestCase{int(1), true, false, ""},
-		geTestCase{int(17), true, false, ""},
-
-		geTestCase{int8(-1), false, false, ""},
-		geTestCase{int8(0), true, false, ""},
-		geTestCase{int8(1), true, false, ""},
-
-		geTestCase{int16(-(1 << 14)), false, false, ""},
-		geTestCase{int16(-1), false, false, ""},
-		geTestCase{int16(0), true, false, ""},
-		geTestCase{int16(1), true, false, ""},
-		geTestCase{int16(17), true, false, ""},
-
-		geTestCase{int32(-(1 << 30)), false, false, ""},
-		geTestCase{int32(-1), false, false, ""},
-		geTestCase{int32(0), true, false, ""},
-		geTestCase{int32(1), true, false, ""},
-		geTestCase{int32(17), true, false, ""},
-
-		geTestCase{int64(-(1 << 30)), false, false, ""},
-		geTestCase{int64(-1), false, false, ""},
-		geTestCase{int64(0), true, false, ""},
-		geTestCase{int64(1), true, false, ""},
-		geTestCase{int64(17), true, false, ""},
-
-		// Unsigned integers.
-		geTestCase{uint((1 << 32) - 1), true, false, ""},
-		geTestCase{uint(0), true, false, ""},
-		geTestCase{uint(17), true, false, ""},
-
-		geTestCase{uint8(0), true, false, ""},
-		geTestCase{uint8(17), true, false, ""},
-		geTestCase{uint8(253), true, false, ""},
-
-		geTestCase{uint16((1 << 16) - 1), true, false, ""},
-		geTestCase{uint16(0), true, false, ""},
-		geTestCase{uint16(17), true, false, ""},
-
-		geTestCase{uint32((1 << 32) - 1), true, false, ""},
-		geTestCase{uint32(0), true, false, ""},
-		geTestCase{uint32(17), true, false, ""},
-
-		geTestCase{uint64((1 << 64) - 1), true, false, ""},
-		geTestCase{uint64(0), true, false, ""},
-		geTestCase{uint64(17), true, false, ""},
-
-		// Floating point.
-		geTestCase{float32(-(1 << 30)), false, false, ""},
-		geTestCase{float32(-1), false, false, ""},
-		geTestCase{float32(-0.1), false, false, ""},
-		geTestCase{float32(-0.0), true, false, ""},
-		geTestCase{float32(0), true, false, ""},
-		geTestCase{float32(0.1), true, false, ""},
-		geTestCase{float32(17), true, false, ""},
-		geTestCase{float32(160), true, false, ""},
-
-		geTestCase{float64(-(1 << 30)), false, false, ""},
-		geTestCase{float64(-1), false, false, ""},
-		geTestCase{float64(-0.1), false, false, ""},
-		geTestCase{float64(-0), true, false, ""},
-		geTestCase{float64(0), true, false, ""},
-		geTestCase{float64(17), true, false, ""},
-		geTestCase{float64(160), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterOrEqualTest) PositiveIntegerLiteral() {
-	matcher := GreaterOrEqual(150)
-	desc := matcher.Description()
-	expectedDesc := "greater than or equal to 150"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []geTestCase{
-		// Signed integers.
-		geTestCase{-1, false, false, ""},
-		geTestCase{149, false, false, ""},
-		geTestCase{150, true, false, ""},
-		geTestCase{151, true, false, ""},
-
-		geTestCase{int(-1), false, false, ""},
-		geTestCase{int(149), false, false, ""},
-		geTestCase{int(150), true, false, ""},
-		geTestCase{int(151), true, false, ""},
-
-		geTestCase{int8(-1), false, false, ""},
-		geTestCase{int8(0), false, false, ""},
-		geTestCase{int8(17), false, false, ""},
-		geTestCase{int8(127), false, false, ""},
-
-		geTestCase{int16(-1), false, false, ""},
-		geTestCase{int16(149), false, false, ""},
-		geTestCase{int16(150), true, false, ""},
-		geTestCase{int16(151), true, false, ""},
-
-		geTestCase{int32(-1), false, false, ""},
-		geTestCase{int32(149), false, false, ""},
-		geTestCase{int32(150), true, false, ""},
-		geTestCase{int32(151), true, false, ""},
-
-		geTestCase{int64(-1), false, false, ""},
-		geTestCase{int64(149), false, false, ""},
-		geTestCase{int64(150), true, false, ""},
-		geTestCase{int64(151), true, false, ""},
-
-		// Unsigned integers.
-		geTestCase{uint(0), false, false, ""},
-		geTestCase{uint(149), false, false, ""},
-		geTestCase{uint(150), true, false, ""},
-		geTestCase{uint(151), true, false, ""},
-
-		geTestCase{uint8(0), false, false, ""},
-		geTestCase{uint8(127), false, false, ""},
-
-		geTestCase{uint16(0), false, false, ""},
-		geTestCase{uint16(149), false, false, ""},
-		geTestCase{uint16(150), true, false, ""},
-		geTestCase{uint16(151), true, false, ""},
-
-		geTestCase{uint32(0), false, false, ""},
-		geTestCase{uint32(149), false, false, ""},
-		geTestCase{uint32(150), true, false, ""},
-		geTestCase{uint32(151), true, false, ""},
-
-		geTestCase{uint64(0), false, false, ""},
-		geTestCase{uint64(149), false, false, ""},
-		geTestCase{uint64(150), true, false, ""},
-		geTestCase{uint64(151), true, false, ""},
-
-		// Floating point.
-		geTestCase{float32(-1), false, false, ""},
-		geTestCase{float32(149), false, false, ""},
-		geTestCase{float32(149.9), false, false, ""},
-		geTestCase{float32(150), true, false, ""},
-		geTestCase{float32(150.1), true, false, ""},
-		geTestCase{float32(151), true, false, ""},
-
-		geTestCase{float64(-1), false, false, ""},
-		geTestCase{float64(149), false, false, ""},
-		geTestCase{float64(149.9), false, false, ""},
-		geTestCase{float64(150), true, false, ""},
-		geTestCase{float64(150.1), true, false, ""},
-		geTestCase{float64(151), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// Float literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *GreaterOrEqualTest) NegativeFloatLiteral() {
-	matcher := GreaterOrEqual(-150.1)
-	desc := matcher.Description()
-	expectedDesc := "greater than or equal to -150.1"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []geTestCase{
-		// Signed integers.
-		geTestCase{-(1 << 30), false, false, ""},
-		geTestCase{-151, false, false, ""},
-		geTestCase{-150, true, false, ""},
-		geTestCase{0, true, false, ""},
-		geTestCase{17, true, false, ""},
-
-		geTestCase{int(-(1 << 30)), false, false, ""},
-		geTestCase{int(-151), false, false, ""},
-		geTestCase{int(-150), true, false, ""},
-		geTestCase{int(0), true, false, ""},
-		geTestCase{int(17), true, false, ""},
-
-		geTestCase{int8(-127), true, false, ""},
-		geTestCase{int8(0), true, false, ""},
-		geTestCase{int8(17), true, false, ""},
-
-		geTestCase{int16(-(1 << 14)), false, false, ""},
-		geTestCase{int16(-151), false, false, ""},
-		geTestCase{int16(-150), true, false, ""},
-		geTestCase{int16(0), true, false, ""},
-		geTestCase{int16(17), true, false, ""},
-
-		geTestCase{int32(-(1 << 30)), false, false, ""},
-		geTestCase{int32(-151), false, false, ""},
-		geTestCase{int32(-150), true, false, ""},
-		geTestCase{int32(0), true, false, ""},
-		geTestCase{int32(17), true, false, ""},
-
-		geTestCase{int64(-(1 << 30)), false, false, ""},
-		geTestCase{int64(-151), false, false, ""},
-		geTestCase{int64(-150), true, false, ""},
-		geTestCase{int64(0), true, false, ""},
-		geTestCase{int64(17), true, false, ""},
-
-		// Unsigned integers.
-		geTestCase{uint((1 << 32) - 151), true, false, ""},
-		geTestCase{uint(0), true, false, ""},
-		geTestCase{uint(17), true, false, ""},
-
-		geTestCase{uint8(0), true, false, ""},
-		geTestCase{uint8(17), true, false, ""},
-		geTestCase{uint8(253), true, false, ""},
-
-		geTestCase{uint16((1 << 16) - 151), true, false, ""},
-		geTestCase{uint16(0), true, false, ""},
-		geTestCase{uint16(17), true, false, ""},
-
-		geTestCase{uint32((1 << 32) - 151), true, false, ""},
-		geTestCase{uint32(0), true, false, ""},
-		geTestCase{uint32(17), true, false, ""},
-
-		geTestCase{uint64((1 << 64) - 151), true, false, ""},
-		geTestCase{uint64(0), true, false, ""},
-		geTestCase{uint64(17), true, false, ""},
-
-		// Floating point.
-		geTestCase{float32(-(1 << 30)), false, false, ""},
-		geTestCase{float32(-151), false, false, ""},
-		geTestCase{float32(-150.2), false, false, ""},
-		geTestCase{float32(-150.1), true, false, ""},
-		geTestCase{float32(-150), true, false, ""},
-		geTestCase{float32(0), true, false, ""},
-		geTestCase{float32(17), true, false, ""},
-		geTestCase{float32(160), true, false, ""},
-
-		geTestCase{float64(-(1 << 30)), false, false, ""},
-		geTestCase{float64(-151), false, false, ""},
-		geTestCase{float64(-150.2), false, false, ""},
-		geTestCase{float64(-150.1), true, false, ""},
-		geTestCase{float64(-150), true, false, ""},
-		geTestCase{float64(0), true, false, ""},
-		geTestCase{float64(17), true, false, ""},
-		geTestCase{float64(160), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterOrEqualTest) PositiveFloatLiteral() {
-	matcher := GreaterOrEqual(149.9)
-	desc := matcher.Description()
-	expectedDesc := "greater than or equal to 149.9"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []geTestCase{
-		// Signed integers.
-		geTestCase{-1, false, false, ""},
-		geTestCase{149, false, false, ""},
-		geTestCase{150, true, false, ""},
-		geTestCase{151, true, false, ""},
-
-		geTestCase{int(-1), false, false, ""},
-		geTestCase{int(149), false, false, ""},
-		geTestCase{int(150), true, false, ""},
-		geTestCase{int(151), true, false, ""},
-
-		geTestCase{int8(-1), false, false, ""},
-		geTestCase{int8(0), false, false, ""},
-		geTestCase{int8(17), false, false, ""},
-		geTestCase{int8(127), false, false, ""},
-
-		geTestCase{int16(-1), false, false, ""},
-		geTestCase{int16(149), false, false, ""},
-		geTestCase{int16(150), true, false, ""},
-		geTestCase{int16(151), true, false, ""},
-
-		geTestCase{int32(-1), false, false, ""},
-		geTestCase{int32(149), false, false, ""},
-		geTestCase{int32(150), true, false, ""},
-		geTestCase{int32(151), true, false, ""},
-
-		geTestCase{int64(-1), false, false, ""},
-		geTestCase{int64(149), false, false, ""},
-		geTestCase{int64(150), true, false, ""},
-		geTestCase{int64(151), true, false, ""},
-
-		// Unsigned integers.
-		geTestCase{uint(0), false, false, ""},
-		geTestCase{uint(149), false, false, ""},
-		geTestCase{uint(150), true, false, ""},
-		geTestCase{uint(151), true, false, ""},
-
-		geTestCase{uint8(0), false, false, ""},
-		geTestCase{uint8(127), false, false, ""},
-
-		geTestCase{uint16(0), false, false, ""},
-		geTestCase{uint16(149), false, false, ""},
-		geTestCase{uint16(150), true, false, ""},
-		geTestCase{uint16(151), true, false, ""},
-
-		geTestCase{uint32(0), false, false, ""},
-		geTestCase{uint32(149), false, false, ""},
-		geTestCase{uint32(150), true, false, ""},
-		geTestCase{uint32(151), true, false, ""},
-
-		geTestCase{uint64(0), false, false, ""},
-		geTestCase{uint64(149), false, false, ""},
-		geTestCase{uint64(150), true, false, ""},
-		geTestCase{uint64(151), true, false, ""},
-
-		// Floating point.
-		geTestCase{float32(-1), false, false, ""},
-		geTestCase{float32(149), false, false, ""},
-		geTestCase{float32(149.8), false, false, ""},
-		geTestCase{float32(149.9), true, false, ""},
-		geTestCase{float32(150), true, false, ""},
-		geTestCase{float32(151), true, false, ""},
-
-		geTestCase{float64(-1), false, false, ""},
-		geTestCase{float64(149), false, false, ""},
-		geTestCase{float64(149.8), false, false, ""},
-		geTestCase{float64(149.9), true, false, ""},
-		geTestCase{float64(150), true, false, ""},
-		geTestCase{float64(151), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// Subtle cases
-////////////////////////////////////////////////////////////////////////
-
-func (t *GreaterOrEqualTest) Int64NotExactlyRepresentableBySinglePrecision() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := GreaterOrEqual(int64(kTwoTo25 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "greater than or equal to 33554433"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []geTestCase{
-		// Signed integers.
-		geTestCase{-1, false, false, ""},
-		geTestCase{kTwoTo25 + 0, false, false, ""},
-		geTestCase{kTwoTo25 + 1, true, false, ""},
-		geTestCase{kTwoTo25 + 2, true, false, ""},
-
-		geTestCase{int(-1), false, false, ""},
-		geTestCase{int(kTwoTo25 + 0), false, false, ""},
-		geTestCase{int(kTwoTo25 + 1), true, false, ""},
-		geTestCase{int(kTwoTo25 + 2), true, false, ""},
-
-		geTestCase{int8(-1), false, false, ""},
-		geTestCase{int8(127), false, false, ""},
-
-		geTestCase{int16(-1), false, false, ""},
-		geTestCase{int16(0), false, false, ""},
-		geTestCase{int16(32767), false, false, ""},
-
-		geTestCase{int32(-1), false, false, ""},
-		geTestCase{int32(kTwoTo25 + 0), false, false, ""},
-		geTestCase{int32(kTwoTo25 + 1), true, false, ""},
-		geTestCase{int32(kTwoTo25 + 2), true, false, ""},
-
-		geTestCase{int64(-1), false, false, ""},
-		geTestCase{int64(kTwoTo25 + 0), false, false, ""},
-		geTestCase{int64(kTwoTo25 + 1), true, false, ""},
-		geTestCase{int64(kTwoTo25 + 2), true, false, ""},
-
-		// Unsigned integers.
-		geTestCase{uint(0), false, false, ""},
-		geTestCase{uint(kTwoTo25 + 0), false, false, ""},
-		geTestCase{uint(kTwoTo25 + 1), true, false, ""},
-		geTestCase{uint(kTwoTo25 + 2), true, false, ""},
-
-		geTestCase{uint8(0), false, false, ""},
-		geTestCase{uint8(255), false, false, ""},
-
-		geTestCase{uint16(0), false, false, ""},
-		geTestCase{uint16(65535), false, false, ""},
-
-		geTestCase{uint32(0), false, false, ""},
-		geTestCase{uint32(kTwoTo25 + 0), false, false, ""},
-		geTestCase{uint32(kTwoTo25 + 1), true, false, ""},
-		geTestCase{uint32(kTwoTo25 + 2), true, false, ""},
-
-		geTestCase{uint64(0), false, false, ""},
-		geTestCase{uint64(kTwoTo25 + 0), false, false, ""},
-		geTestCase{uint64(kTwoTo25 + 1), true, false, ""},
-		geTestCase{uint64(kTwoTo25 + 2), true, false, ""},
-
-		// Floating point.
-		geTestCase{float32(-1), false, false, ""},
-		geTestCase{float32(kTwoTo25 - 2), false, false, ""},
-		geTestCase{float32(kTwoTo25 - 1), true, false, ""},
-		geTestCase{float32(kTwoTo25 + 0), true, false, ""},
-		geTestCase{float32(kTwoTo25 + 1), true, false, ""},
-		geTestCase{float32(kTwoTo25 + 2), true, false, ""},
-		geTestCase{float32(kTwoTo25 + 3), true, false, ""},
-
-		geTestCase{float64(-1), false, false, ""},
-		geTestCase{float64(kTwoTo25 - 2), false, false, ""},
-		geTestCase{float64(kTwoTo25 - 1), false, false, ""},
-		geTestCase{float64(kTwoTo25 + 0), false, false, ""},
-		geTestCase{float64(kTwoTo25 + 1), true, false, ""},
-		geTestCase{float64(kTwoTo25 + 2), true, false, ""},
-		geTestCase{float64(kTwoTo25 + 3), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterOrEqualTest) Int64NotExactlyRepresentableByDoublePrecision() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := GreaterOrEqual(int64(kTwoTo54 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "greater than or equal to 18014398509481985"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []geTestCase{
-		// Signed integers.
-		geTestCase{-1, false, false, ""},
-		geTestCase{1 << 30, false, false, ""},
-
-		geTestCase{int(-1), false, false, ""},
-		geTestCase{int(math.MaxInt32), false, false, ""},
-
-		geTestCase{int8(-1), false, false, ""},
-		geTestCase{int8(127), false, false, ""},
-
-		geTestCase{int16(-1), false, false, ""},
-		geTestCase{int16(0), false, false, ""},
-		geTestCase{int16(32767), false, false, ""},
-
-		geTestCase{int32(-1), false, false, ""},
-		geTestCase{int32(math.MaxInt32), false, false, ""},
-
-		geTestCase{int64(-1), false, false, ""},
-		geTestCase{int64(kTwoTo54 - 1), false, false, ""},
-		geTestCase{int64(kTwoTo54 + 0), false, false, ""},
-		geTestCase{int64(kTwoTo54 + 1), true, false, ""},
-		geTestCase{int64(kTwoTo54 + 2), true, false, ""},
-
-		// Unsigned integers.
-		geTestCase{uint(0), false, false, ""},
-		geTestCase{uint(math.MaxUint32), false, false, ""},
-
-		geTestCase{uint8(0), false, false, ""},
-		geTestCase{uint8(255), false, false, ""},
-
-		geTestCase{uint16(0), false, false, ""},
-		geTestCase{uint16(65535), false, false, ""},
-
-		geTestCase{uint32(0), false, false, ""},
-		geTestCase{uint32(math.MaxUint32), false, false, ""},
-
-		geTestCase{uint64(0), false, false, ""},
-		geTestCase{uint64(kTwoTo54 - 1), false, false, ""},
-		geTestCase{uint64(kTwoTo54 + 0), false, false, ""},
-		geTestCase{uint64(kTwoTo54 + 1), true, false, ""},
-		geTestCase{uint64(kTwoTo54 + 2), true, false, ""},
-
-		// Floating point.
-		geTestCase{float64(-1), false, false, ""},
-		geTestCase{float64(kTwoTo54 - 2), false, false, ""},
-		geTestCase{float64(kTwoTo54 - 1), true, false, ""},
-		geTestCase{float64(kTwoTo54 + 0), true, false, ""},
-		geTestCase{float64(kTwoTo54 + 1), true, false, ""},
-		geTestCase{float64(kTwoTo54 + 2), true, false, ""},
-		geTestCase{float64(kTwoTo54 + 3), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterOrEqualTest) Uint64NotExactlyRepresentableBySinglePrecision() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := GreaterOrEqual(uint64(kTwoTo25 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "greater than or equal to 33554433"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []geTestCase{
-		// Signed integers.
-		geTestCase{-1, false, false, ""},
-		geTestCase{kTwoTo25 + 0, false, false, ""},
-		geTestCase{kTwoTo25 + 1, true, false, ""},
-		geTestCase{kTwoTo25 + 2, true, false, ""},
-
-		geTestCase{int(-1), false, false, ""},
-		geTestCase{int(kTwoTo25 + 0), false, false, ""},
-		geTestCase{int(kTwoTo25 + 1), true, false, ""},
-		geTestCase{int(kTwoTo25 + 2), true, false, ""},
-
-		geTestCase{int8(-1), false, false, ""},
-		geTestCase{int8(127), false, false, ""},
-
-		geTestCase{int16(-1), false, false, ""},
-		geTestCase{int16(0), false, false, ""},
-		geTestCase{int16(32767), false, false, ""},
-
-		geTestCase{int32(-1), false, false, ""},
-		geTestCase{int32(kTwoTo25 + 0), false, false, ""},
-		geTestCase{int32(kTwoTo25 + 1), true, false, ""},
-		geTestCase{int32(kTwoTo25 + 2), true, false, ""},
-
-		geTestCase{int64(-1), false, false, ""},
-		geTestCase{int64(kTwoTo25 + 0), false, false, ""},
-		geTestCase{int64(kTwoTo25 + 1), true, false, ""},
-		geTestCase{int64(kTwoTo25 + 2), true, false, ""},
-
-		// Unsigned integers.
-		geTestCase{uint(0), false, false, ""},
-		geTestCase{uint(kTwoTo25 + 0), false, false, ""},
-		geTestCase{uint(kTwoTo25 + 1), true, false, ""},
-		geTestCase{uint(kTwoTo25 + 2), true, false, ""},
-
-		geTestCase{uint8(0), false, false, ""},
-		geTestCase{uint8(255), false, false, ""},
-
-		geTestCase{uint16(0), false, false, ""},
-		geTestCase{uint16(65535), false, false, ""},
-
-		geTestCase{uint32(0), false, false, ""},
-		geTestCase{uint32(kTwoTo25 + 0), false, false, ""},
-		geTestCase{uint32(kTwoTo25 + 1), true, false, ""},
-		geTestCase{uint32(kTwoTo25 + 2), true, false, ""},
-
-		geTestCase{uint64(0), false, false, ""},
-		geTestCase{uint64(kTwoTo25 + 0), false, false, ""},
-		geTestCase{uint64(kTwoTo25 + 1), true, false, ""},
-		geTestCase{uint64(kTwoTo25 + 2), true, false, ""},
-
-		// Floating point.
-		geTestCase{float32(-1), false, false, ""},
-		geTestCase{float32(kTwoTo25 - 2), false, false, ""},
-		geTestCase{float32(kTwoTo25 - 1), true, false, ""},
-		geTestCase{float32(kTwoTo25 + 0), true, false, ""},
-		geTestCase{float32(kTwoTo25 + 1), true, false, ""},
-		geTestCase{float32(kTwoTo25 + 2), true, false, ""},
-		geTestCase{float32(kTwoTo25 + 3), true, false, ""},
-
-		geTestCase{float64(-1), false, false, ""},
-		geTestCase{float64(kTwoTo25 - 2), false, false, ""},
-		geTestCase{float64(kTwoTo25 - 1), false, false, ""},
-		geTestCase{float64(kTwoTo25 + 0), false, false, ""},
-		geTestCase{float64(kTwoTo25 + 1), true, false, ""},
-		geTestCase{float64(kTwoTo25 + 2), true, false, ""},
-		geTestCase{float64(kTwoTo25 + 3), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterOrEqualTest) Uint64NotExactlyRepresentableByDoublePrecision() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := GreaterOrEqual(uint64(kTwoTo54 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "greater than or equal to 18014398509481985"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []geTestCase{
-		// Signed integers.
-		geTestCase{-1, false, false, ""},
-		geTestCase{1 << 30, false, false, ""},
-
-		geTestCase{int(-1), false, false, ""},
-		geTestCase{int(math.MaxInt32), false, false, ""},
-
-		geTestCase{int8(-1), false, false, ""},
-		geTestCase{int8(127), false, false, ""},
-
-		geTestCase{int16(-1), false, false, ""},
-		geTestCase{int16(0), false, false, ""},
-		geTestCase{int16(32767), false, false, ""},
-
-		geTestCase{int32(-1), false, false, ""},
-		geTestCase{int32(math.MaxInt32), false, false, ""},
-
-		geTestCase{int64(-1), false, false, ""},
-		geTestCase{int64(kTwoTo54 - 1), false, false, ""},
-		geTestCase{int64(kTwoTo54 + 0), false, false, ""},
-		geTestCase{int64(kTwoTo54 + 1), true, false, ""},
-		geTestCase{int64(kTwoTo54 + 2), true, false, ""},
-
-		// Unsigned integers.
-		geTestCase{uint(0), false, false, ""},
-		geTestCase{uint(math.MaxUint32), false, false, ""},
-
-		geTestCase{uint8(0), false, false, ""},
-		geTestCase{uint8(255), false, false, ""},
-
-		geTestCase{uint16(0), false, false, ""},
-		geTestCase{uint16(65535), false, false, ""},
-
-		geTestCase{uint32(0), false, false, ""},
-		geTestCase{uint32(math.MaxUint32), false, false, ""},
-
-		geTestCase{uint64(0), false, false, ""},
-		geTestCase{uint64(kTwoTo54 - 1), false, false, ""},
-		geTestCase{uint64(kTwoTo54 + 0), false, false, ""},
-		geTestCase{uint64(kTwoTo54 + 1), true, false, ""},
-		geTestCase{uint64(kTwoTo54 + 2), true, false, ""},
-
-		// Floating point.
-		geTestCase{float64(-1), false, false, ""},
-		geTestCase{float64(kTwoTo54 - 2), false, false, ""},
-		geTestCase{float64(kTwoTo54 - 1), true, false, ""},
-		geTestCase{float64(kTwoTo54 + 0), true, false, ""},
-		geTestCase{float64(kTwoTo54 + 1), true, false, ""},
-		geTestCase{float64(kTwoTo54 + 2), true, false, ""},
-		geTestCase{float64(kTwoTo54 + 3), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterOrEqualTest) Float32AboveExactIntegerRange() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := GreaterOrEqual(float32(kTwoTo25 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "greater than or equal to 3.3554432e+07"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []geTestCase{
-		// Signed integers.
-		geTestCase{int64(-1), false, false, ""},
-		geTestCase{int64(kTwoTo25 - 2), false, false, ""},
-		geTestCase{int64(kTwoTo25 - 1), true, false, ""},
-		geTestCase{int64(kTwoTo25 + 0), true, false, ""},
-		geTestCase{int64(kTwoTo25 + 1), true, false, ""},
-		geTestCase{int64(kTwoTo25 + 2), true, false, ""},
-		geTestCase{int64(kTwoTo25 + 3), true, false, ""},
-
-		// Unsigned integers.
-		geTestCase{uint64(0), false, false, ""},
-		geTestCase{uint64(kTwoTo25 - 2), false, false, ""},
-		geTestCase{uint64(kTwoTo25 - 1), true, false, ""},
-		geTestCase{uint64(kTwoTo25 + 0), true, false, ""},
-		geTestCase{uint64(kTwoTo25 + 1), true, false, ""},
-		geTestCase{uint64(kTwoTo25 + 2), true, false, ""},
-		geTestCase{uint64(kTwoTo25 + 3), true, false, ""},
-
-		// Floating point.
-		geTestCase{float32(-1), false, false, ""},
-		geTestCase{float32(kTwoTo25 - 2), false, false, ""},
-		geTestCase{float32(kTwoTo25 - 1), true, false, ""},
-		geTestCase{float32(kTwoTo25 + 0), true, false, ""},
-		geTestCase{float32(kTwoTo25 + 1), true, false, ""},
-		geTestCase{float32(kTwoTo25 + 2), true, false, ""},
-		geTestCase{float32(kTwoTo25 + 3), true, false, ""},
-
-		geTestCase{float64(-1), false, false, ""},
-		geTestCase{float64(kTwoTo25 - 2), false, false, ""},
-		geTestCase{float64(kTwoTo25 - 1), true, false, ""},
-		geTestCase{float64(kTwoTo25 + 0), true, false, ""},
-		geTestCase{float64(kTwoTo25 + 1), true, false, ""},
-		geTestCase{float64(kTwoTo25 + 2), true, false, ""},
-		geTestCase{float64(kTwoTo25 + 3), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterOrEqualTest) Float64AboveExactIntegerRange() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := GreaterOrEqual(float64(kTwoTo54 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "greater than or equal to 1.8014398509481984e+16"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []geTestCase{
-		// Signed integers.
-		geTestCase{int64(-1), false, false, ""},
-		geTestCase{int64(kTwoTo54 - 2), false, false, ""},
-		geTestCase{int64(kTwoTo54 - 1), true, false, ""},
-		geTestCase{int64(kTwoTo54 + 0), true, false, ""},
-		geTestCase{int64(kTwoTo54 + 1), true, false, ""},
-		geTestCase{int64(kTwoTo54 + 2), true, false, ""},
-		geTestCase{int64(kTwoTo54 + 3), true, false, ""},
-
-		// Unsigned integers.
-		geTestCase{uint64(0), false, false, ""},
-		geTestCase{uint64(kTwoTo54 - 2), false, false, ""},
-		geTestCase{uint64(kTwoTo54 - 1), true, false, ""},
-		geTestCase{uint64(kTwoTo54 + 0), true, false, ""},
-		geTestCase{uint64(kTwoTo54 + 1), true, false, ""},
-		geTestCase{uint64(kTwoTo54 + 2), true, false, ""},
-		geTestCase{uint64(kTwoTo54 + 3), true, false, ""},
-
-		// Floating point.
-		geTestCase{float64(-1), false, false, ""},
-		geTestCase{float64(kTwoTo54 - 2), false, false, ""},
-		geTestCase{float64(kTwoTo54 - 1), true, false, ""},
-		geTestCase{float64(kTwoTo54 + 0), true, false, ""},
-		geTestCase{float64(kTwoTo54 + 1), true, false, ""},
-		geTestCase{float64(kTwoTo54 + 2), true, false, ""},
-		geTestCase{float64(kTwoTo54 + 3), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// String literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *GreaterOrEqualTest) EmptyString() {
-	matcher := GreaterOrEqual("")
-	desc := matcher.Description()
-	expectedDesc := "greater than or equal to \"\""
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []geTestCase{
-		geTestCase{"", true, false, ""},
-		geTestCase{"\x00", true, false, ""},
-		geTestCase{"a", true, false, ""},
-		geTestCase{"foo", true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterOrEqualTest) SingleNullByte() {
-	matcher := GreaterOrEqual("\x00")
-	desc := matcher.Description()
-	expectedDesc := "greater than or equal to \"\x00\""
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []geTestCase{
-		geTestCase{"", false, false, ""},
-		geTestCase{"\x00", true, false, ""},
-		geTestCase{"a", true, false, ""},
-		geTestCase{"foo", true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterOrEqualTest) LongerString() {
-	matcher := GreaterOrEqual("foo\x00")
-	desc := matcher.Description()
-	expectedDesc := "greater than or equal to \"foo\x00\""
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []geTestCase{
-		geTestCase{"", false, false, ""},
-		geTestCase{"\x00", false, false, ""},
-		geTestCase{"bar", false, false, ""},
-		geTestCase{"foo", false, false, ""},
-		geTestCase{"foo\x00", true, false, ""},
-		geTestCase{"fooa", true, false, ""},
-		geTestCase{"qux", true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}

+ 0 - 39
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/greater_than.go

@@ -1,39 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"fmt"
-	"reflect"
-)
-
-// GreaterThan returns a matcher that matches integer, floating point, or
-// strings values v such that v > x. Comparison is not defined between numeric
-// and string types, but is defined between all integer and floating point
-// types.
-//
-// x must itself be an integer, floating point, or string type; otherwise,
-// GreaterThan will panic.
-func GreaterThan(x interface{}) Matcher {
-	desc := fmt.Sprintf("greater than %v", x)
-
-	// Special case: make it clear that strings are strings.
-	if reflect.TypeOf(x).Kind() == reflect.String {
-		desc = fmt.Sprintf("greater than \"%s\"", x)
-	}
-
-	return transformDescription(Not(LessOrEqual(x)), desc)
-}

+ 0 - 1079
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/greater_than_test.go

@@ -1,1079 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	"math"
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type GreaterThanTest struct {
-}
-
-func init() { RegisterTestSuite(&GreaterThanTest{}) }
-
-type gtTestCase struct {
-	candidate      interface{}
-	expectedResult bool
-	shouldBeFatal  bool
-	expectedError  string
-}
-
-func (t *GreaterThanTest) checkTestCases(matcher Matcher, cases []gtTestCase) {
-	for i, c := range cases {
-		err := matcher.Matches(c.candidate)
-
-		ExpectThat(
-			(err == nil),
-			Equals(c.expectedResult),
-			"Case %d (candidate %v)",
-			i,
-			c.candidate)
-
-		if err == nil {
-			continue
-		}
-
-		_, isFatal := err.(*FatalError)
-		ExpectEq(
-			c.shouldBeFatal,
-			isFatal,
-			"Case %d (candidate %v)",
-			i,
-			c.candidate)
-
-		ExpectThat(
-			err,
-			Error(Equals(c.expectedError)),
-			"Case %d (candidate %v)",
-			i,
-			c.candidate)
-	}
-}
-
-////////////////////////////////////////////////////////////////////////
-// Integer literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *GreaterThanTest) IntegerCandidateBadTypes() {
-	matcher := GreaterThan(int(-150))
-
-	cases := []gtTestCase{
-		gtTestCase{true, false, true, "which is not comparable"},
-		gtTestCase{uintptr(17), false, true, "which is not comparable"},
-		gtTestCase{complex64(-151), false, true, "which is not comparable"},
-		gtTestCase{complex128(-151), false, true, "which is not comparable"},
-		gtTestCase{[...]int{-151}, false, true, "which is not comparable"},
-		gtTestCase{make(chan int), false, true, "which is not comparable"},
-		gtTestCase{func() {}, false, true, "which is not comparable"},
-		gtTestCase{map[int]int{}, false, true, "which is not comparable"},
-		gtTestCase{&gtTestCase{}, false, true, "which is not comparable"},
-		gtTestCase{make([]int, 0), false, true, "which is not comparable"},
-		gtTestCase{"-151", false, true, "which is not comparable"},
-		gtTestCase{gtTestCase{}, false, true, "which is not comparable"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterThanTest) FloatCandidateBadTypes() {
-	matcher := GreaterThan(float32(-150))
-
-	cases := []gtTestCase{
-		gtTestCase{true, false, true, "which is not comparable"},
-		gtTestCase{uintptr(17), false, true, "which is not comparable"},
-		gtTestCase{complex64(-151), false, true, "which is not comparable"},
-		gtTestCase{complex128(-151), false, true, "which is not comparable"},
-		gtTestCase{[...]int{-151}, false, true, "which is not comparable"},
-		gtTestCase{make(chan int), false, true, "which is not comparable"},
-		gtTestCase{func() {}, false, true, "which is not comparable"},
-		gtTestCase{map[int]int{}, false, true, "which is not comparable"},
-		gtTestCase{&gtTestCase{}, false, true, "which is not comparable"},
-		gtTestCase{make([]int, 0), false, true, "which is not comparable"},
-		gtTestCase{"-151", false, true, "which is not comparable"},
-		gtTestCase{gtTestCase{}, false, true, "which is not comparable"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterThanTest) StringCandidateBadTypes() {
-	matcher := GreaterThan("17")
-
-	cases := []gtTestCase{
-		gtTestCase{true, false, true, "which is not comparable"},
-		gtTestCase{int(0), false, true, "which is not comparable"},
-		gtTestCase{int8(0), false, true, "which is not comparable"},
-		gtTestCase{int16(0), false, true, "which is not comparable"},
-		gtTestCase{int32(0), false, true, "which is not comparable"},
-		gtTestCase{int64(0), false, true, "which is not comparable"},
-		gtTestCase{uint(0), false, true, "which is not comparable"},
-		gtTestCase{uint8(0), false, true, "which is not comparable"},
-		gtTestCase{uint16(0), false, true, "which is not comparable"},
-		gtTestCase{uint32(0), false, true, "which is not comparable"},
-		gtTestCase{uint64(0), false, true, "which is not comparable"},
-		gtTestCase{uintptr(17), false, true, "which is not comparable"},
-		gtTestCase{float32(0), false, true, "which is not comparable"},
-		gtTestCase{float64(0), false, true, "which is not comparable"},
-		gtTestCase{complex64(-151), false, true, "which is not comparable"},
-		gtTestCase{complex128(-151), false, true, "which is not comparable"},
-		gtTestCase{[...]int{-151}, false, true, "which is not comparable"},
-		gtTestCase{make(chan int), false, true, "which is not comparable"},
-		gtTestCase{func() {}, false, true, "which is not comparable"},
-		gtTestCase{map[int]int{}, false, true, "which is not comparable"},
-		gtTestCase{&gtTestCase{}, false, true, "which is not comparable"},
-		gtTestCase{make([]int, 0), false, true, "which is not comparable"},
-		gtTestCase{gtTestCase{}, false, true, "which is not comparable"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterThanTest) BadArgument() {
-	panicked := false
-
-	defer func() {
-		ExpectThat(panicked, Equals(true))
-	}()
-
-	defer func() {
-		if r := recover(); r != nil {
-			panicked = true
-		}
-	}()
-
-	GreaterThan(complex128(0))
-}
-
-////////////////////////////////////////////////////////////////////////
-// Integer literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *GreaterThanTest) NegativeIntegerLiteral() {
-	matcher := GreaterThan(-150)
-	desc := matcher.Description()
-	expectedDesc := "greater than -150"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []gtTestCase{
-		// Signed integers.
-		gtTestCase{-(1 << 30), false, false, ""},
-		gtTestCase{-151, false, false, ""},
-		gtTestCase{-150, false, false, ""},
-		gtTestCase{-149, true, false, ""},
-		gtTestCase{0, true, false, ""},
-		gtTestCase{17, true, false, ""},
-
-		gtTestCase{int(-(1 << 30)), false, false, ""},
-		gtTestCase{int(-151), false, false, ""},
-		gtTestCase{int(-150), false, false, ""},
-		gtTestCase{int(-149), true, false, ""},
-		gtTestCase{int(0), true, false, ""},
-		gtTestCase{int(17), true, false, ""},
-
-		gtTestCase{int8(-127), true, false, ""},
-		gtTestCase{int8(0), true, false, ""},
-		gtTestCase{int8(17), true, false, ""},
-
-		gtTestCase{int16(-(1 << 14)), false, false, ""},
-		gtTestCase{int16(-151), false, false, ""},
-		gtTestCase{int16(-150), false, false, ""},
-		gtTestCase{int16(-149), true, false, ""},
-		gtTestCase{int16(0), true, false, ""},
-		gtTestCase{int16(17), true, false, ""},
-
-		gtTestCase{int32(-(1 << 30)), false, false, ""},
-		gtTestCase{int32(-151), false, false, ""},
-		gtTestCase{int32(-150), false, false, ""},
-		gtTestCase{int32(-149), true, false, ""},
-		gtTestCase{int32(0), true, false, ""},
-		gtTestCase{int32(17), true, false, ""},
-
-		gtTestCase{int64(-(1 << 30)), false, false, ""},
-		gtTestCase{int64(-151), false, false, ""},
-		gtTestCase{int64(-150), false, false, ""},
-		gtTestCase{int64(-149), true, false, ""},
-		gtTestCase{int64(0), true, false, ""},
-		gtTestCase{int64(17), true, false, ""},
-
-		// Unsigned integers.
-		gtTestCase{uint((1 << 32) - 151), true, false, ""},
-		gtTestCase{uint(0), true, false, ""},
-		gtTestCase{uint(17), true, false, ""},
-
-		gtTestCase{uint8(0), true, false, ""},
-		gtTestCase{uint8(17), true, false, ""},
-		gtTestCase{uint8(253), true, false, ""},
-
-		gtTestCase{uint16((1 << 16) - 151), true, false, ""},
-		gtTestCase{uint16(0), true, false, ""},
-		gtTestCase{uint16(17), true, false, ""},
-
-		gtTestCase{uint32((1 << 32) - 151), true, false, ""},
-		gtTestCase{uint32(0), true, false, ""},
-		gtTestCase{uint32(17), true, false, ""},
-
-		gtTestCase{uint64((1 << 64) - 151), true, false, ""},
-		gtTestCase{uint64(0), true, false, ""},
-		gtTestCase{uint64(17), true, false, ""},
-
-		// Floating point.
-		gtTestCase{float32(-(1 << 30)), false, false, ""},
-		gtTestCase{float32(-151), false, false, ""},
-		gtTestCase{float32(-150.1), false, false, ""},
-		gtTestCase{float32(-150), false, false, ""},
-		gtTestCase{float32(-149.9), true, false, ""},
-		gtTestCase{float32(0), true, false, ""},
-		gtTestCase{float32(17), true, false, ""},
-		gtTestCase{float32(160), true, false, ""},
-
-		gtTestCase{float64(-(1 << 30)), false, false, ""},
-		gtTestCase{float64(-151), false, false, ""},
-		gtTestCase{float64(-150.1), false, false, ""},
-		gtTestCase{float64(-150), false, false, ""},
-		gtTestCase{float64(-149.9), true, false, ""},
-		gtTestCase{float64(0), true, false, ""},
-		gtTestCase{float64(17), true, false, ""},
-		gtTestCase{float64(160), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterThanTest) ZeroIntegerLiteral() {
-	matcher := GreaterThan(0)
-	desc := matcher.Description()
-	expectedDesc := "greater than 0"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []gtTestCase{
-		// Signed integers.
-		gtTestCase{-(1 << 30), false, false, ""},
-		gtTestCase{-1, false, false, ""},
-		gtTestCase{0, false, false, ""},
-		gtTestCase{1, true, false, ""},
-		gtTestCase{17, true, false, ""},
-		gtTestCase{(1 << 30), true, false, ""},
-
-		gtTestCase{int(-(1 << 30)), false, false, ""},
-		gtTestCase{int(-1), false, false, ""},
-		gtTestCase{int(0), false, false, ""},
-		gtTestCase{int(1), true, false, ""},
-		gtTestCase{int(17), true, false, ""},
-
-		gtTestCase{int8(-1), false, false, ""},
-		gtTestCase{int8(0), false, false, ""},
-		gtTestCase{int8(1), true, false, ""},
-
-		gtTestCase{int16(-(1 << 14)), false, false, ""},
-		gtTestCase{int16(-1), false, false, ""},
-		gtTestCase{int16(0), false, false, ""},
-		gtTestCase{int16(1), true, false, ""},
-		gtTestCase{int16(17), true, false, ""},
-
-		gtTestCase{int32(-(1 << 30)), false, false, ""},
-		gtTestCase{int32(-1), false, false, ""},
-		gtTestCase{int32(0), false, false, ""},
-		gtTestCase{int32(1), true, false, ""},
-		gtTestCase{int32(17), true, false, ""},
-
-		gtTestCase{int64(-(1 << 30)), false, false, ""},
-		gtTestCase{int64(-1), false, false, ""},
-		gtTestCase{int64(0), false, false, ""},
-		gtTestCase{int64(1), true, false, ""},
-		gtTestCase{int64(17), true, false, ""},
-
-		// Unsigned integers.
-		gtTestCase{uint((1 << 32) - 1), true, false, ""},
-		gtTestCase{uint(0), false, false, ""},
-		gtTestCase{uint(1), true, false, ""},
-		gtTestCase{uint(17), true, false, ""},
-
-		gtTestCase{uint8(0), false, false, ""},
-		gtTestCase{uint8(1), true, false, ""},
-		gtTestCase{uint8(17), true, false, ""},
-		gtTestCase{uint8(253), true, false, ""},
-
-		gtTestCase{uint16((1 << 16) - 1), true, false, ""},
-		gtTestCase{uint16(0), false, false, ""},
-		gtTestCase{uint16(1), true, false, ""},
-		gtTestCase{uint16(17), true, false, ""},
-
-		gtTestCase{uint32((1 << 32) - 1), true, false, ""},
-		gtTestCase{uint32(0), false, false, ""},
-		gtTestCase{uint32(1), true, false, ""},
-		gtTestCase{uint32(17), true, false, ""},
-
-		gtTestCase{uint64((1 << 64) - 1), true, false, ""},
-		gtTestCase{uint64(0), false, false, ""},
-		gtTestCase{uint64(1), true, false, ""},
-		gtTestCase{uint64(17), true, false, ""},
-
-		// Floating point.
-		gtTestCase{float32(-(1 << 30)), false, false, ""},
-		gtTestCase{float32(-1), false, false, ""},
-		gtTestCase{float32(-0.1), false, false, ""},
-		gtTestCase{float32(-0.0), false, false, ""},
-		gtTestCase{float32(0), false, false, ""},
-		gtTestCase{float32(0.1), true, false, ""},
-		gtTestCase{float32(17), true, false, ""},
-		gtTestCase{float32(160), true, false, ""},
-
-		gtTestCase{float64(-(1 << 30)), false, false, ""},
-		gtTestCase{float64(-1), false, false, ""},
-		gtTestCase{float64(-0.1), false, false, ""},
-		gtTestCase{float64(-0), false, false, ""},
-		gtTestCase{float64(0), false, false, ""},
-		gtTestCase{float64(0.1), true, false, ""},
-		gtTestCase{float64(17), true, false, ""},
-		gtTestCase{float64(160), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterThanTest) PositiveIntegerLiteral() {
-	matcher := GreaterThan(150)
-	desc := matcher.Description()
-	expectedDesc := "greater than 150"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []gtTestCase{
-		// Signed integers.
-		gtTestCase{-1, false, false, ""},
-		gtTestCase{149, false, false, ""},
-		gtTestCase{150, false, false, ""},
-		gtTestCase{151, true, false, ""},
-
-		gtTestCase{int(-1), false, false, ""},
-		gtTestCase{int(149), false, false, ""},
-		gtTestCase{int(150), false, false, ""},
-		gtTestCase{int(151), true, false, ""},
-
-		gtTestCase{int8(-1), false, false, ""},
-		gtTestCase{int8(0), false, false, ""},
-		gtTestCase{int8(17), false, false, ""},
-		gtTestCase{int8(127), false, false, ""},
-
-		gtTestCase{int16(-1), false, false, ""},
-		gtTestCase{int16(149), false, false, ""},
-		gtTestCase{int16(150), false, false, ""},
-		gtTestCase{int16(151), true, false, ""},
-
-		gtTestCase{int32(-1), false, false, ""},
-		gtTestCase{int32(149), false, false, ""},
-		gtTestCase{int32(150), false, false, ""},
-		gtTestCase{int32(151), true, false, ""},
-
-		gtTestCase{int64(-1), false, false, ""},
-		gtTestCase{int64(149), false, false, ""},
-		gtTestCase{int64(150), false, false, ""},
-		gtTestCase{int64(151), true, false, ""},
-
-		// Unsigned integers.
-		gtTestCase{uint(0), false, false, ""},
-		gtTestCase{uint(149), false, false, ""},
-		gtTestCase{uint(150), false, false, ""},
-		gtTestCase{uint(151), true, false, ""},
-
-		gtTestCase{uint8(0), false, false, ""},
-		gtTestCase{uint8(127), false, false, ""},
-
-		gtTestCase{uint16(0), false, false, ""},
-		gtTestCase{uint16(149), false, false, ""},
-		gtTestCase{uint16(150), false, false, ""},
-		gtTestCase{uint16(151), true, false, ""},
-
-		gtTestCase{uint32(0), false, false, ""},
-		gtTestCase{uint32(149), false, false, ""},
-		gtTestCase{uint32(150), false, false, ""},
-		gtTestCase{uint32(151), true, false, ""},
-
-		gtTestCase{uint64(0), false, false, ""},
-		gtTestCase{uint64(149), false, false, ""},
-		gtTestCase{uint64(150), false, false, ""},
-		gtTestCase{uint64(151), true, false, ""},
-
-		// Floating point.
-		gtTestCase{float32(-1), false, false, ""},
-		gtTestCase{float32(149), false, false, ""},
-		gtTestCase{float32(149.9), false, false, ""},
-		gtTestCase{float32(150), false, false, ""},
-		gtTestCase{float32(150.1), true, false, ""},
-		gtTestCase{float32(151), true, false, ""},
-
-		gtTestCase{float64(-1), false, false, ""},
-		gtTestCase{float64(149), false, false, ""},
-		gtTestCase{float64(149.9), false, false, ""},
-		gtTestCase{float64(150), false, false, ""},
-		gtTestCase{float64(150.1), true, false, ""},
-		gtTestCase{float64(151), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// Float literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *GreaterThanTest) NegativeFloatLiteral() {
-	matcher := GreaterThan(-150.1)
-	desc := matcher.Description()
-	expectedDesc := "greater than -150.1"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []gtTestCase{
-		// Signed integers.
-		gtTestCase{-(1 << 30), false, false, ""},
-		gtTestCase{-151, false, false, ""},
-		gtTestCase{-150.1, false, false, ""},
-		gtTestCase{-150, true, false, ""},
-		gtTestCase{-149, true, false, ""},
-		gtTestCase{0, true, false, ""},
-		gtTestCase{17, true, false, ""},
-
-		gtTestCase{int(-(1 << 30)), false, false, ""},
-		gtTestCase{int(-151), false, false, ""},
-		gtTestCase{int(-150), true, false, ""},
-		gtTestCase{int(-149), true, false, ""},
-		gtTestCase{int(0), true, false, ""},
-		gtTestCase{int(17), true, false, ""},
-
-		gtTestCase{int8(-127), true, false, ""},
-		gtTestCase{int8(0), true, false, ""},
-		gtTestCase{int8(17), true, false, ""},
-
-		gtTestCase{int16(-(1 << 14)), false, false, ""},
-		gtTestCase{int16(-151), false, false, ""},
-		gtTestCase{int16(-150), true, false, ""},
-		gtTestCase{int16(-149), true, false, ""},
-		gtTestCase{int16(0), true, false, ""},
-		gtTestCase{int16(17), true, false, ""},
-
-		gtTestCase{int32(-(1 << 30)), false, false, ""},
-		gtTestCase{int32(-151), false, false, ""},
-		gtTestCase{int32(-150), true, false, ""},
-		gtTestCase{int32(-149), true, false, ""},
-		gtTestCase{int32(0), true, false, ""},
-		gtTestCase{int32(17), true, false, ""},
-
-		gtTestCase{int64(-(1 << 30)), false, false, ""},
-		gtTestCase{int64(-151), false, false, ""},
-		gtTestCase{int64(-150), true, false, ""},
-		gtTestCase{int64(-149), true, false, ""},
-		gtTestCase{int64(0), true, false, ""},
-		gtTestCase{int64(17), true, false, ""},
-
-		// Unsigned integers.
-		gtTestCase{uint((1 << 32) - 151), true, false, ""},
-		gtTestCase{uint(0), true, false, ""},
-		gtTestCase{uint(17), true, false, ""},
-
-		gtTestCase{uint8(0), true, false, ""},
-		gtTestCase{uint8(17), true, false, ""},
-		gtTestCase{uint8(253), true, false, ""},
-
-		gtTestCase{uint16((1 << 16) - 151), true, false, ""},
-		gtTestCase{uint16(0), true, false, ""},
-		gtTestCase{uint16(17), true, false, ""},
-
-		gtTestCase{uint32((1 << 32) - 151), true, false, ""},
-		gtTestCase{uint32(0), true, false, ""},
-		gtTestCase{uint32(17), true, false, ""},
-
-		gtTestCase{uint64((1 << 64) - 151), true, false, ""},
-		gtTestCase{uint64(0), true, false, ""},
-		gtTestCase{uint64(17), true, false, ""},
-
-		// Floating point.
-		gtTestCase{float32(-(1 << 30)), false, false, ""},
-		gtTestCase{float32(-151), false, false, ""},
-		gtTestCase{float32(-150.2), false, false, ""},
-		gtTestCase{float32(-150.1), false, false, ""},
-		gtTestCase{float32(-150), true, false, ""},
-		gtTestCase{float32(0), true, false, ""},
-		gtTestCase{float32(17), true, false, ""},
-		gtTestCase{float32(160), true, false, ""},
-
-		gtTestCase{float64(-(1 << 30)), false, false, ""},
-		gtTestCase{float64(-151), false, false, ""},
-		gtTestCase{float64(-150.2), false, false, ""},
-		gtTestCase{float64(-150.1), false, false, ""},
-		gtTestCase{float64(-150), true, false, ""},
-		gtTestCase{float64(0), true, false, ""},
-		gtTestCase{float64(17), true, false, ""},
-		gtTestCase{float64(160), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterThanTest) PositiveFloatLiteral() {
-	matcher := GreaterThan(149.9)
-	desc := matcher.Description()
-	expectedDesc := "greater than 149.9"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []gtTestCase{
-		// Signed integers.
-		gtTestCase{-1, false, false, ""},
-		gtTestCase{149, false, false, ""},
-		gtTestCase{149.9, false, false, ""},
-		gtTestCase{150, true, false, ""},
-		gtTestCase{151, true, false, ""},
-
-		gtTestCase{int(-1), false, false, ""},
-		gtTestCase{int(149), false, false, ""},
-		gtTestCase{int(150), true, false, ""},
-		gtTestCase{int(151), true, false, ""},
-
-		gtTestCase{int8(-1), false, false, ""},
-		gtTestCase{int8(0), false, false, ""},
-		gtTestCase{int8(17), false, false, ""},
-		gtTestCase{int8(127), false, false, ""},
-
-		gtTestCase{int16(-1), false, false, ""},
-		gtTestCase{int16(149), false, false, ""},
-		gtTestCase{int16(150), true, false, ""},
-		gtTestCase{int16(151), true, false, ""},
-
-		gtTestCase{int32(-1), false, false, ""},
-		gtTestCase{int32(149), false, false, ""},
-		gtTestCase{int32(150), true, false, ""},
-		gtTestCase{int32(151), true, false, ""},
-
-		gtTestCase{int64(-1), false, false, ""},
-		gtTestCase{int64(149), false, false, ""},
-		gtTestCase{int64(150), true, false, ""},
-		gtTestCase{int64(151), true, false, ""},
-
-		// Unsigned integers.
-		gtTestCase{uint(0), false, false, ""},
-		gtTestCase{uint(149), false, false, ""},
-		gtTestCase{uint(150), true, false, ""},
-		gtTestCase{uint(151), true, false, ""},
-
-		gtTestCase{uint8(0), false, false, ""},
-		gtTestCase{uint8(127), false, false, ""},
-
-		gtTestCase{uint16(0), false, false, ""},
-		gtTestCase{uint16(149), false, false, ""},
-		gtTestCase{uint16(150), true, false, ""},
-		gtTestCase{uint16(151), true, false, ""},
-
-		gtTestCase{uint32(0), false, false, ""},
-		gtTestCase{uint32(149), false, false, ""},
-		gtTestCase{uint32(150), true, false, ""},
-		gtTestCase{uint32(151), true, false, ""},
-
-		gtTestCase{uint64(0), false, false, ""},
-		gtTestCase{uint64(149), false, false, ""},
-		gtTestCase{uint64(150), true, false, ""},
-		gtTestCase{uint64(151), true, false, ""},
-
-		// Floating point.
-		gtTestCase{float32(-1), false, false, ""},
-		gtTestCase{float32(149), false, false, ""},
-		gtTestCase{float32(149.8), false, false, ""},
-		gtTestCase{float32(149.9), false, false, ""},
-		gtTestCase{float32(150), true, false, ""},
-		gtTestCase{float32(151), true, false, ""},
-
-		gtTestCase{float64(-1), false, false, ""},
-		gtTestCase{float64(149), false, false, ""},
-		gtTestCase{float64(149.8), false, false, ""},
-		gtTestCase{float64(149.9), false, false, ""},
-		gtTestCase{float64(150), true, false, ""},
-		gtTestCase{float64(151), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// Subtle cases
-////////////////////////////////////////////////////////////////////////
-
-func (t *GreaterThanTest) Int64NotExactlyRepresentableBySinglePrecision() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := GreaterThan(int64(kTwoTo25 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "greater than 33554433"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []gtTestCase{
-		// Signed integers.
-		gtTestCase{-1, false, false, ""},
-		gtTestCase{kTwoTo25 + 0, false, false, ""},
-		gtTestCase{kTwoTo25 + 1, false, false, ""},
-		gtTestCase{kTwoTo25 + 2, true, false, ""},
-
-		gtTestCase{int(-1), false, false, ""},
-		gtTestCase{int(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{int(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{int(kTwoTo25 + 2), true, false, ""},
-
-		gtTestCase{int8(-1), false, false, ""},
-		gtTestCase{int8(127), false, false, ""},
-
-		gtTestCase{int16(-1), false, false, ""},
-		gtTestCase{int16(0), false, false, ""},
-		gtTestCase{int16(32767), false, false, ""},
-
-		gtTestCase{int32(-1), false, false, ""},
-		gtTestCase{int32(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{int32(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{int32(kTwoTo25 + 2), true, false, ""},
-
-		gtTestCase{int64(-1), false, false, ""},
-		gtTestCase{int64(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{int64(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{int64(kTwoTo25 + 2), true, false, ""},
-
-		// Unsigned integers.
-		gtTestCase{uint(0), false, false, ""},
-		gtTestCase{uint(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{uint(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{uint(kTwoTo25 + 2), true, false, ""},
-
-		gtTestCase{uint8(0), false, false, ""},
-		gtTestCase{uint8(255), false, false, ""},
-
-		gtTestCase{uint16(0), false, false, ""},
-		gtTestCase{uint16(65535), false, false, ""},
-
-		gtTestCase{uint32(0), false, false, ""},
-		gtTestCase{uint32(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{uint32(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{uint32(kTwoTo25 + 2), true, false, ""},
-
-		gtTestCase{uint64(0), false, false, ""},
-		gtTestCase{uint64(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{uint64(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{uint64(kTwoTo25 + 2), true, false, ""},
-
-		// Floating point.
-		gtTestCase{float32(-1), false, false, ""},
-		gtTestCase{float32(kTwoTo25 - 2), false, false, ""},
-		gtTestCase{float32(kTwoTo25 - 1), false, false, ""},
-		gtTestCase{float32(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{float32(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{float32(kTwoTo25 + 2), false, false, ""},
-		gtTestCase{float32(kTwoTo25 + 3), true, false, ""},
-
-		gtTestCase{float64(-1), false, false, ""},
-		gtTestCase{float64(kTwoTo25 - 2), false, false, ""},
-		gtTestCase{float64(kTwoTo25 - 1), false, false, ""},
-		gtTestCase{float64(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{float64(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{float64(kTwoTo25 + 2), true, false, ""},
-		gtTestCase{float64(kTwoTo25 + 3), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterThanTest) Int64NotExactlyRepresentableByDoublePrecision() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := GreaterThan(int64(kTwoTo54 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "greater than 18014398509481985"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []gtTestCase{
-		// Signed integers.
-		gtTestCase{-1, false, false, ""},
-		gtTestCase{1 << 30, false, false, ""},
-
-		gtTestCase{int(-1), false, false, ""},
-		gtTestCase{int(math.MaxInt32), false, false, ""},
-
-		gtTestCase{int8(-1), false, false, ""},
-		gtTestCase{int8(127), false, false, ""},
-
-		gtTestCase{int16(-1), false, false, ""},
-		gtTestCase{int16(0), false, false, ""},
-		gtTestCase{int16(32767), false, false, ""},
-
-		gtTestCase{int32(-1), false, false, ""},
-		gtTestCase{int32(math.MaxInt32), false, false, ""},
-
-		gtTestCase{int64(-1), false, false, ""},
-		gtTestCase{int64(kTwoTo54 - 1), false, false, ""},
-		gtTestCase{int64(kTwoTo54 + 0), false, false, ""},
-		gtTestCase{int64(kTwoTo54 + 1), false, false, ""},
-		gtTestCase{int64(kTwoTo54 + 2), true, false, ""},
-
-		// Unsigned integers.
-		gtTestCase{uint(0), false, false, ""},
-		gtTestCase{uint(math.MaxUint32), false, false, ""},
-
-		gtTestCase{uint8(0), false, false, ""},
-		gtTestCase{uint8(255), false, false, ""},
-
-		gtTestCase{uint16(0), false, false, ""},
-		gtTestCase{uint16(65535), false, false, ""},
-
-		gtTestCase{uint32(0), false, false, ""},
-		gtTestCase{uint32(math.MaxUint32), false, false, ""},
-
-		gtTestCase{uint64(0), false, false, ""},
-		gtTestCase{uint64(kTwoTo54 - 1), false, false, ""},
-		gtTestCase{uint64(kTwoTo54 + 0), false, false, ""},
-		gtTestCase{uint64(kTwoTo54 + 1), false, false, ""},
-		gtTestCase{uint64(kTwoTo54 + 2), true, false, ""},
-
-		// Floating point.
-		gtTestCase{float64(-1), false, false, ""},
-		gtTestCase{float64(kTwoTo54 - 2), false, false, ""},
-		gtTestCase{float64(kTwoTo54 - 1), false, false, ""},
-		gtTestCase{float64(kTwoTo54 + 0), false, false, ""},
-		gtTestCase{float64(kTwoTo54 + 1), false, false, ""},
-		gtTestCase{float64(kTwoTo54 + 2), false, false, ""},
-		gtTestCase{float64(kTwoTo54 + 3), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterThanTest) Uint64NotExactlyRepresentableBySinglePrecision() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := GreaterThan(uint64(kTwoTo25 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "greater than 33554433"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []gtTestCase{
-		// Signed integers.
-		gtTestCase{-1, false, false, ""},
-		gtTestCase{kTwoTo25 + 0, false, false, ""},
-		gtTestCase{kTwoTo25 + 1, false, false, ""},
-		gtTestCase{kTwoTo25 + 2, true, false, ""},
-
-		gtTestCase{int(-1), false, false, ""},
-		gtTestCase{int(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{int(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{int(kTwoTo25 + 2), true, false, ""},
-
-		gtTestCase{int8(-1), false, false, ""},
-		gtTestCase{int8(127), false, false, ""},
-
-		gtTestCase{int16(-1), false, false, ""},
-		gtTestCase{int16(0), false, false, ""},
-		gtTestCase{int16(32767), false, false, ""},
-
-		gtTestCase{int32(-1), false, false, ""},
-		gtTestCase{int32(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{int32(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{int32(kTwoTo25 + 2), true, false, ""},
-
-		gtTestCase{int64(-1), false, false, ""},
-		gtTestCase{int64(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{int64(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{int64(kTwoTo25 + 2), true, false, ""},
-
-		// Unsigned integers.
-		gtTestCase{uint(0), false, false, ""},
-		gtTestCase{uint(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{uint(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{uint(kTwoTo25 + 2), true, false, ""},
-
-		gtTestCase{uint8(0), false, false, ""},
-		gtTestCase{uint8(255), false, false, ""},
-
-		gtTestCase{uint16(0), false, false, ""},
-		gtTestCase{uint16(65535), false, false, ""},
-
-		gtTestCase{uint32(0), false, false, ""},
-		gtTestCase{uint32(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{uint32(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{uint32(kTwoTo25 + 2), true, false, ""},
-
-		gtTestCase{uint64(0), false, false, ""},
-		gtTestCase{uint64(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{uint64(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{uint64(kTwoTo25 + 2), true, false, ""},
-
-		// Floating point.
-		gtTestCase{float32(-1), false, false, ""},
-		gtTestCase{float32(kTwoTo25 - 2), false, false, ""},
-		gtTestCase{float32(kTwoTo25 - 1), false, false, ""},
-		gtTestCase{float32(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{float32(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{float32(kTwoTo25 + 2), false, false, ""},
-		gtTestCase{float32(kTwoTo25 + 3), true, false, ""},
-
-		gtTestCase{float64(-1), false, false, ""},
-		gtTestCase{float64(kTwoTo25 - 2), false, false, ""},
-		gtTestCase{float64(kTwoTo25 - 1), false, false, ""},
-		gtTestCase{float64(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{float64(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{float64(kTwoTo25 + 2), true, false, ""},
-		gtTestCase{float64(kTwoTo25 + 3), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterThanTest) Uint64NotExactlyRepresentableByDoublePrecision() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := GreaterThan(uint64(kTwoTo54 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "greater than 18014398509481985"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []gtTestCase{
-		// Signed integers.
-		gtTestCase{-1, false, false, ""},
-		gtTestCase{1 << 30, false, false, ""},
-
-		gtTestCase{int(-1), false, false, ""},
-		gtTestCase{int(math.MaxInt32), false, false, ""},
-
-		gtTestCase{int8(-1), false, false, ""},
-		gtTestCase{int8(127), false, false, ""},
-
-		gtTestCase{int16(-1), false, false, ""},
-		gtTestCase{int16(0), false, false, ""},
-		gtTestCase{int16(32767), false, false, ""},
-
-		gtTestCase{int32(-1), false, false, ""},
-		gtTestCase{int32(math.MaxInt32), false, false, ""},
-
-		gtTestCase{int64(-1), false, false, ""},
-		gtTestCase{int64(kTwoTo54 - 1), false, false, ""},
-		gtTestCase{int64(kTwoTo54 + 0), false, false, ""},
-		gtTestCase{int64(kTwoTo54 + 1), false, false, ""},
-		gtTestCase{int64(kTwoTo54 + 2), true, false, ""},
-
-		// Unsigned integers.
-		gtTestCase{uint(0), false, false, ""},
-		gtTestCase{uint(math.MaxUint32), false, false, ""},
-
-		gtTestCase{uint8(0), false, false, ""},
-		gtTestCase{uint8(255), false, false, ""},
-
-		gtTestCase{uint16(0), false, false, ""},
-		gtTestCase{uint16(65535), false, false, ""},
-
-		gtTestCase{uint32(0), false, false, ""},
-		gtTestCase{uint32(math.MaxUint32), false, false, ""},
-
-		gtTestCase{uint64(0), false, false, ""},
-		gtTestCase{uint64(kTwoTo54 - 1), false, false, ""},
-		gtTestCase{uint64(kTwoTo54 + 0), false, false, ""},
-		gtTestCase{uint64(kTwoTo54 + 1), false, false, ""},
-		gtTestCase{uint64(kTwoTo54 + 2), true, false, ""},
-
-		// Floating point.
-		gtTestCase{float64(-1), false, false, ""},
-		gtTestCase{float64(kTwoTo54 - 2), false, false, ""},
-		gtTestCase{float64(kTwoTo54 - 1), false, false, ""},
-		gtTestCase{float64(kTwoTo54 + 0), false, false, ""},
-		gtTestCase{float64(kTwoTo54 + 1), false, false, ""},
-		gtTestCase{float64(kTwoTo54 + 2), false, false, ""},
-		gtTestCase{float64(kTwoTo54 + 3), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterThanTest) Float32AboveExactIntegerRange() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := GreaterThan(float32(kTwoTo25 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "greater than 3.3554432e+07"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []gtTestCase{
-		// Signed integers.
-		gtTestCase{int64(-1), false, false, ""},
-		gtTestCase{int64(kTwoTo25 - 2), false, false, ""},
-		gtTestCase{int64(kTwoTo25 - 1), false, false, ""},
-		gtTestCase{int64(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{int64(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{int64(kTwoTo25 + 2), false, false, ""},
-		gtTestCase{int64(kTwoTo25 + 3), true, false, ""},
-
-		// Unsigned integers.
-		gtTestCase{uint64(0), false, false, ""},
-		gtTestCase{uint64(kTwoTo25 - 2), false, false, ""},
-		gtTestCase{uint64(kTwoTo25 - 1), false, false, ""},
-		gtTestCase{uint64(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{uint64(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{uint64(kTwoTo25 + 2), false, false, ""},
-		gtTestCase{uint64(kTwoTo25 + 3), true, false, ""},
-
-		// Floating point.
-		gtTestCase{float32(-1), false, false, ""},
-		gtTestCase{float32(kTwoTo25 - 2), false, false, ""},
-		gtTestCase{float32(kTwoTo25 - 1), false, false, ""},
-		gtTestCase{float32(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{float32(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{float32(kTwoTo25 + 2), false, false, ""},
-		gtTestCase{float32(kTwoTo25 + 3), true, false, ""},
-
-		gtTestCase{float64(-1), false, false, ""},
-		gtTestCase{float64(kTwoTo25 - 2), false, false, ""},
-		gtTestCase{float64(kTwoTo25 - 1), false, false, ""},
-		gtTestCase{float64(kTwoTo25 + 0), false, false, ""},
-		gtTestCase{float64(kTwoTo25 + 1), false, false, ""},
-		gtTestCase{float64(kTwoTo25 + 2), false, false, ""},
-		gtTestCase{float64(kTwoTo25 + 3), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterThanTest) Float64AboveExactIntegerRange() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := GreaterThan(float64(kTwoTo54 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "greater than 1.8014398509481984e+16"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []gtTestCase{
-		// Signed integers.
-		gtTestCase{int64(-1), false, false, ""},
-		gtTestCase{int64(kTwoTo54 - 2), false, false, ""},
-		gtTestCase{int64(kTwoTo54 - 1), false, false, ""},
-		gtTestCase{int64(kTwoTo54 + 0), false, false, ""},
-		gtTestCase{int64(kTwoTo54 + 1), false, false, ""},
-		gtTestCase{int64(kTwoTo54 + 2), false, false, ""},
-		gtTestCase{int64(kTwoTo54 + 3), true, false, ""},
-
-		// Unsigned integers.
-		gtTestCase{uint64(0), false, false, ""},
-		gtTestCase{uint64(kTwoTo54 - 2), false, false, ""},
-		gtTestCase{uint64(kTwoTo54 - 1), false, false, ""},
-		gtTestCase{uint64(kTwoTo54 + 0), false, false, ""},
-		gtTestCase{uint64(kTwoTo54 + 1), false, false, ""},
-		gtTestCase{uint64(kTwoTo54 + 2), false, false, ""},
-		gtTestCase{uint64(kTwoTo54 + 3), true, false, ""},
-
-		// Floating point.
-		gtTestCase{float64(-1), false, false, ""},
-		gtTestCase{float64(kTwoTo54 - 2), false, false, ""},
-		gtTestCase{float64(kTwoTo54 - 1), false, false, ""},
-		gtTestCase{float64(kTwoTo54 + 0), false, false, ""},
-		gtTestCase{float64(kTwoTo54 + 1), false, false, ""},
-		gtTestCase{float64(kTwoTo54 + 2), false, false, ""},
-		gtTestCase{float64(kTwoTo54 + 3), true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// String literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *GreaterThanTest) EmptyString() {
-	matcher := GreaterThan("")
-	desc := matcher.Description()
-	expectedDesc := "greater than \"\""
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []gtTestCase{
-		gtTestCase{"", false, false, ""},
-		gtTestCase{"\x00", true, false, ""},
-		gtTestCase{"a", true, false, ""},
-		gtTestCase{"foo", true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterThanTest) SingleNullByte() {
-	matcher := GreaterThan("\x00")
-	desc := matcher.Description()
-	expectedDesc := "greater than \"\x00\""
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []gtTestCase{
-		gtTestCase{"", false, false, ""},
-		gtTestCase{"\x00", false, false, ""},
-		gtTestCase{"\x00\x00", true, false, ""},
-		gtTestCase{"a", true, false, ""},
-		gtTestCase{"foo", true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *GreaterThanTest) LongerString() {
-	matcher := GreaterThan("foo\x00")
-	desc := matcher.Description()
-	expectedDesc := "greater than \"foo\x00\""
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []gtTestCase{
-		gtTestCase{"", false, false, ""},
-		gtTestCase{"\x00", false, false, ""},
-		gtTestCase{"bar", false, false, ""},
-		gtTestCase{"foo", false, false, ""},
-		gtTestCase{"foo\x00", false, false, ""},
-		gtTestCase{"foo\x00\x00", true, false, ""},
-		gtTestCase{"fooa", true, false, ""},
-		gtTestCase{"qux", true, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}

+ 0 - 52
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/has_substr.go

@@ -1,52 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"errors"
-	"fmt"
-	"reflect"
-	"strings"
-)
-
-// HasSubstr returns a matcher that matches strings containing s as a
-// substring.
-func HasSubstr(s string) Matcher {
-	return &hasSubstrMatcher{s}
-}
-
-type hasSubstrMatcher struct {
-	needle string
-}
-
-func (m *hasSubstrMatcher) Description() string {
-	return fmt.Sprintf("has substring \"%s\"", m.needle)
-}
-
-func (m *hasSubstrMatcher) Matches(c interface{}) error {
-	v := reflect.ValueOf(c)
-	if v.Kind() != reflect.String {
-		return NewFatalError("which is not a string")
-	}
-
-	// Perform the substring search.
-	haystack := v.String()
-	if strings.Contains(haystack, m.needle) {
-		return nil
-	}
-
-	return errors.New("")
-}

+ 0 - 92
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/has_substr_test.go

@@ -1,92 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type HasSubstrTest struct {
-}
-
-func init() { RegisterTestSuite(&HasSubstrTest{}) }
-
-////////////////////////////////////////////////////////////////////////
-// Tests
-////////////////////////////////////////////////////////////////////////
-
-func (t *HasSubstrTest) Description() {
-	matcher := HasSubstr("taco")
-	ExpectThat(matcher.Description(), Equals("has substring \"taco\""))
-}
-
-func (t *HasSubstrTest) CandidateIsNil() {
-	matcher := HasSubstr("")
-	err := matcher.Matches(nil)
-
-	ExpectThat(err, Error(Equals("which is not a string")))
-	ExpectTrue(isFatal(err))
-}
-
-func (t *HasSubstrTest) CandidateIsInteger() {
-	matcher := HasSubstr("")
-	err := matcher.Matches(17)
-
-	ExpectThat(err, Error(Equals("which is not a string")))
-	ExpectTrue(isFatal(err))
-}
-
-func (t *HasSubstrTest) CandidateIsByteSlice() {
-	matcher := HasSubstr("")
-	err := matcher.Matches([]byte{17})
-
-	ExpectThat(err, Error(Equals("which is not a string")))
-	ExpectTrue(isFatal(err))
-}
-
-func (t *HasSubstrTest) CandidateDoesntHaveSubstring() {
-	matcher := HasSubstr("taco")
-	err := matcher.Matches("tac")
-
-	ExpectThat(err, Error(Equals("")))
-	ExpectFalse(isFatal(err))
-}
-
-func (t *HasSubstrTest) CandidateEqualsArg() {
-	matcher := HasSubstr("taco")
-	err := matcher.Matches("taco")
-
-	ExpectThat(err, Equals(nil))
-}
-
-func (t *HasSubstrTest) CandidateHasProperSubstring() {
-	matcher := HasSubstr("taco")
-	err := matcher.Matches("burritos and tacos")
-
-	ExpectThat(err, Equals(nil))
-}
-
-func (t *HasSubstrTest) EmptyStringIsAlwaysSubString() {
-	matcher := HasSubstr("")
-	err := matcher.Matches("asdf")
-
-	ExpectThat(err, Equals(nil))
-}

+ 0 - 134
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/identical_to.go

@@ -1,134 +0,0 @@
-// Copyright 2012 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"errors"
-	"fmt"
-	"reflect"
-)
-
-// Is the type comparable according to the definition here?
-//
-//     http://weekly.golang.org/doc/go_spec.html#Comparison_operators
-//
-func isComparable(t reflect.Type) bool {
-	switch t.Kind() {
-	case reflect.Array:
-		return isComparable(t.Elem())
-
-	case reflect.Struct:
-		for i := 0; i < t.NumField(); i++ {
-			if !isComparable(t.Field(i).Type) {
-				return false
-			}
-		}
-
-		return true
-
-	case reflect.Slice, reflect.Map, reflect.Func:
-		return false
-	}
-
-	return true
-}
-
-// Should the supplied type be allowed as an argument to IdenticalTo?
-func isLegalForIdenticalTo(t reflect.Type) (bool, error) {
-	// Allow the zero type.
-	if t == nil {
-		return true, nil
-	}
-
-	// Reference types are always okay; we compare pointers.
-	switch t.Kind() {
-	case reflect.Slice, reflect.Map, reflect.Func, reflect.Chan:
-		return true, nil
-	}
-
-	// Reject other non-comparable types.
-	if !isComparable(t) {
-		return false, errors.New(fmt.Sprintf("%v is not comparable", t))
-	}
-
-	return true, nil
-}
-
-// IdenticalTo(x) returns a matcher that matches values v with type identical
-// to x such that:
-//
-//  1. If v and x are of a reference type (slice, map, function, channel), then
-//     they are either both nil or are references to the same object.
-//
-//  2. Otherwise, if v and x are not of a reference type but have a valid type,
-//     then v == x.
-//
-// If v and x are both the invalid type (which results from the predeclared nil
-// value, or from nil interface variables), then the matcher is satisfied.
-//
-// This function will panic if x is of a value type that is not comparable. For
-// example, x cannot be an array of functions.
-func IdenticalTo(x interface{}) Matcher {
-	t := reflect.TypeOf(x)
-
-	// Reject illegal arguments.
-	if ok, err := isLegalForIdenticalTo(t); !ok {
-		panic("IdenticalTo: " + err.Error())
-	}
-
-	return &identicalToMatcher{x}
-}
-
-type identicalToMatcher struct {
-	x interface{}
-}
-
-func (m *identicalToMatcher) Description() string {
-	t := reflect.TypeOf(m.x)
-	return fmt.Sprintf("identical to <%v> %v", t, m.x)
-}
-
-func (m *identicalToMatcher) Matches(c interface{}) error {
-	// Make sure the candidate's type is correct.
-	t := reflect.TypeOf(m.x)
-	if ct := reflect.TypeOf(c); t != ct {
-		return NewFatalError(fmt.Sprintf("which is of type %v", ct))
-	}
-
-	// Special case: two values of the invalid type are always identical.
-	if t == nil {
-		return nil
-	}
-
-	// Handle reference types.
-	switch t.Kind() {
-	case reflect.Slice, reflect.Map, reflect.Func, reflect.Chan:
-		xv := reflect.ValueOf(m.x)
-		cv := reflect.ValueOf(c)
-		if xv.Pointer() == cv.Pointer() {
-			return nil
-		}
-
-		return errors.New("which is not an identical reference")
-	}
-
-	// Are the values equal?
-	if m.x == c {
-		return nil
-	}
-
-	return errors.New("")
-}

+ 0 - 849
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/identical_to_test.go

@@ -1,849 +0,0 @@
-// Copyright 2012 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	"fmt"
-	"io"
-	"unsafe"
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type IdenticalToTest struct {
-}
-
-func init() { RegisterTestSuite(&IdenticalToTest{}) }
-
-////////////////////////////////////////////////////////////////////////
-// Tests
-////////////////////////////////////////////////////////////////////////
-
-func (t *IdenticalToTest) TypesNotIdentical() {
-	var m Matcher
-	var err error
-
-	type intAlias int
-
-	// Type alias expected value
-	m = IdenticalTo(intAlias(17))
-	err = m.Matches(int(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int")))
-
-	// Type alias candidate
-	m = IdenticalTo(int(17))
-	err = m.Matches(intAlias(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.intAlias")))
-
-	// int and uint
-	m = IdenticalTo(int(17))
-	err = m.Matches(uint(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type uint")))
-}
-
-func (t *IdenticalToTest) PredeclaredNilIdentifier() {
-	var m Matcher
-	var err error
-
-	// Nil literal
-	m = IdenticalTo(nil)
-	err = m.Matches(nil)
-	ExpectEq(nil, err)
-
-	// Zero interface var (which is the same as above since IdenticalTo takes an
-	// interface{} as an arg)
-	var nilReader io.Reader
-	var nilWriter io.Writer
-
-	m = IdenticalTo(nilReader)
-	err = m.Matches(nilWriter)
-	ExpectEq(nil, err)
-
-	// Typed nil value.
-	m = IdenticalTo(nil)
-	err = m.Matches((chan int)(nil))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type chan int")))
-
-	// Non-nil value.
-	m = IdenticalTo(nil)
-	err = m.Matches("taco")
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type string")))
-}
-
-func (t *IdenticalToTest) Slices() {
-	var m Matcher
-	var err error
-
-	// Nil expected value
-	m = IdenticalTo(([]int)(nil))
-	ExpectEq("identical to <[]int> []", m.Description())
-
-	err = m.Matches(([]int)(nil))
-	ExpectEq(nil, err)
-
-	err = m.Matches([]int{})
-	ExpectThat(err, Error(Equals("which is not an identical reference")))
-
-	// Non-nil expected value
-	o1 := make([]int, 1)
-	o2 := make([]int, 1)
-	m = IdenticalTo(o1)
-	ExpectEq(fmt.Sprintf("identical to <[]int> %v", o1), m.Description())
-
-	err = m.Matches(o1)
-	ExpectEq(nil, err)
-
-	err = m.Matches(o2)
-	ExpectThat(err, Error(Equals("which is not an identical reference")))
-}
-
-func (t *IdenticalToTest) Maps() {
-	var m Matcher
-	var err error
-
-	// Nil expected value
-	m = IdenticalTo((map[int]int)(nil))
-	ExpectEq("identical to <map[int]int> map[]", m.Description())
-
-	err = m.Matches((map[int]int)(nil))
-	ExpectEq(nil, err)
-
-	err = m.Matches(map[int]int{})
-	ExpectThat(err, Error(Equals("which is not an identical reference")))
-
-	// Non-nil expected value
-	o1 := map[int]int{}
-	o2 := map[int]int{}
-	m = IdenticalTo(o1)
-	ExpectEq(fmt.Sprintf("identical to <map[int]int> %v", o1), m.Description())
-
-	err = m.Matches(o1)
-	ExpectEq(nil, err)
-
-	err = m.Matches(o2)
-	ExpectThat(err, Error(Equals("which is not an identical reference")))
-}
-
-func (t *IdenticalToTest) Functions() {
-	var m Matcher
-	var err error
-
-	// Nil expected value
-	m = IdenticalTo((func())(nil))
-	ExpectEq("identical to <func()> <nil>", m.Description())
-
-	err = m.Matches((func())(nil))
-	ExpectEq(nil, err)
-
-	err = m.Matches(func() {})
-	ExpectThat(err, Error(Equals("which is not an identical reference")))
-
-	// Non-nil expected value
-	o1 := func() {}
-	o2 := func() {}
-	m = IdenticalTo(o1)
-	ExpectEq(fmt.Sprintf("identical to <func()> %v", o1), m.Description())
-
-	err = m.Matches(o1)
-	ExpectEq(nil, err)
-
-	err = m.Matches(o2)
-	ExpectThat(err, Error(Equals("which is not an identical reference")))
-}
-
-func (t *IdenticalToTest) Channels() {
-	var m Matcher
-	var err error
-
-	// Nil expected value
-	m = IdenticalTo((chan int)(nil))
-	ExpectEq("identical to <chan int> <nil>", m.Description())
-
-	err = m.Matches((chan int)(nil))
-	ExpectEq(nil, err)
-
-	err = m.Matches(make(chan int))
-	ExpectThat(err, Error(Equals("which is not an identical reference")))
-
-	// Non-nil expected value
-	o1 := make(chan int)
-	o2 := make(chan int)
-	m = IdenticalTo(o1)
-	ExpectEq(fmt.Sprintf("identical to <chan int> %v", o1), m.Description())
-
-	err = m.Matches(o1)
-	ExpectEq(nil, err)
-
-	err = m.Matches(o2)
-	ExpectThat(err, Error(Equals("which is not an identical reference")))
-}
-
-func (t *IdenticalToTest) Bools() {
-	var m Matcher
-	var err error
-
-	// false
-	m = IdenticalTo(false)
-	ExpectEq("identical to <bool> false", m.Description())
-
-	err = m.Matches(false)
-	ExpectEq(nil, err)
-
-	err = m.Matches(true)
-	ExpectThat(err, Error(Equals("")))
-
-	// true
-	m = IdenticalTo(true)
-	ExpectEq("identical to <bool> true", m.Description())
-
-	err = m.Matches(false)
-	ExpectThat(err, Error(Equals("")))
-
-	err = m.Matches(true)
-	ExpectEq(nil, err)
-}
-
-func (t *IdenticalToTest) Ints() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo(int(17))
-	ExpectEq("identical to <int> 17", m.Description())
-
-	// Identical value
-	err = m.Matches(int(17))
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType int
-	err = m.Matches(myType(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) Int8s() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo(int8(17))
-	ExpectEq("identical to <int8> 17", m.Description())
-
-	// Identical value
-	err = m.Matches(int8(17))
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType int8
-	err = m.Matches(myType(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) Int16s() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo(int16(17))
-	ExpectEq("identical to <int16> 17", m.Description())
-
-	// Identical value
-	err = m.Matches(int16(17))
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType int16
-	err = m.Matches(myType(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) Int32s() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo(int32(17))
-	ExpectEq("identical to <int32> 17", m.Description())
-
-	// Identical value
-	err = m.Matches(int32(17))
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType int32
-	err = m.Matches(myType(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int16(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int16")))
-}
-
-func (t *IdenticalToTest) Int64s() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo(int64(17))
-	ExpectEq("identical to <int64> 17", m.Description())
-
-	// Identical value
-	err = m.Matches(int64(17))
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType int64
-	err = m.Matches(myType(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) Uints() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo(uint(17))
-	ExpectEq("identical to <uint> 17", m.Description())
-
-	// Identical value
-	err = m.Matches(uint(17))
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType uint
-	err = m.Matches(myType(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) Uint8s() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo(uint8(17))
-	ExpectEq("identical to <uint8> 17", m.Description())
-
-	// Identical value
-	err = m.Matches(uint8(17))
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType uint8
-	err = m.Matches(myType(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) Uint16s() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo(uint16(17))
-	ExpectEq("identical to <uint16> 17", m.Description())
-
-	// Identical value
-	err = m.Matches(uint16(17))
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType uint16
-	err = m.Matches(myType(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) Uint32s() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo(uint32(17))
-	ExpectEq("identical to <uint32> 17", m.Description())
-
-	// Identical value
-	err = m.Matches(uint32(17))
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType uint32
-	err = m.Matches(myType(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) Uint64s() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo(uint64(17))
-	ExpectEq("identical to <uint64> 17", m.Description())
-
-	// Identical value
-	err = m.Matches(uint64(17))
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType uint64
-	err = m.Matches(myType(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) Uintptrs() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo(uintptr(17))
-	ExpectEq("identical to <uintptr> 17", m.Description())
-
-	// Identical value
-	err = m.Matches(uintptr(17))
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType uintptr
-	err = m.Matches(myType(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) Float32s() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo(float32(17))
-	ExpectEq("identical to <float32> 17", m.Description())
-
-	// Identical value
-	err = m.Matches(float32(17))
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType float32
-	err = m.Matches(myType(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) Float64s() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo(float64(17))
-	ExpectEq("identical to <float64> 17", m.Description())
-
-	// Identical value
-	err = m.Matches(float64(17))
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType float64
-	err = m.Matches(myType(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) Complex64s() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo(complex64(17))
-	ExpectEq("identical to <complex64> (17+0i)", m.Description())
-
-	// Identical value
-	err = m.Matches(complex64(17))
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType complex64
-	err = m.Matches(myType(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) Complex128s() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo(complex128(17))
-	ExpectEq("identical to <complex128> (17+0i)", m.Description())
-
-	// Identical value
-	err = m.Matches(complex128(17))
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType complex128
-	err = m.Matches(myType(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) EmptyComparableArrays() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo([0]int{})
-	ExpectEq("identical to <[0]int> []", m.Description())
-
-	// Identical value
-	err = m.Matches([0]int{})
-	ExpectEq(nil, err)
-
-	// Length too long
-	err = m.Matches([1]int{17})
-	ExpectThat(err, Error(Equals("which is of type [1]int")))
-
-	// Element type alias
-	type myType int
-	err = m.Matches([0]myType{})
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type [0]oglematchers_test.myType")))
-
-	// Completely wrong element type
-	err = m.Matches([0]int32{})
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type [0]int32")))
-}
-
-func (t *IdenticalToTest) NonEmptyComparableArrays() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo([2]int{17, 19})
-	ExpectEq("identical to <[2]int> [17 19]", m.Description())
-
-	// Identical value
-	err = m.Matches([2]int{17, 19})
-	ExpectEq(nil, err)
-
-	// Length too short
-	err = m.Matches([1]int{17})
-	ExpectThat(err, Error(Equals("which is of type [1]int")))
-
-	// Length too long
-	err = m.Matches([3]int{17, 19, 23})
-	ExpectThat(err, Error(Equals("which is of type [3]int")))
-
-	// First element different
-	err = m.Matches([2]int{13, 19})
-	ExpectThat(err, Error(Equals("")))
-
-	// Second element different
-	err = m.Matches([2]int{17, 23})
-	ExpectThat(err, Error(Equals("")))
-
-	// Element type alias
-	type myType int
-	err = m.Matches([2]myType{17, 19})
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type [2]oglematchers_test.myType")))
-
-	// Completely wrong element type
-	err = m.Matches([2]int32{17, 19})
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type [2]int32")))
-}
-
-func (t *IdenticalToTest) NonEmptyArraysOfComparableArrays() {
-	var m Matcher
-	var err error
-
-	x := [2][2]int{
-		[2]int{17, 19},
-		[2]int{23, 29},
-	}
-	m = IdenticalTo(x)
-	ExpectEq("identical to <[2][2]int> [[17 19] [23 29]]", m.Description())
-
-	// Identical value
-	err = m.Matches([2][2]int{[2]int{17, 19}, [2]int{23, 29}})
-	ExpectEq(nil, err)
-
-	// Outer length too short
-	err = m.Matches([1][2]int{[2]int{17, 19}})
-	ExpectThat(err, Error(Equals("which is of type [1][2]int")))
-
-	// Inner length too short
-	err = m.Matches([2][1]int{[1]int{17}, [1]int{23}})
-	ExpectThat(err, Error(Equals("which is of type [2][1]int")))
-
-	// First element different
-	err = m.Matches([2][2]int{[2]int{13, 19}, [2]int{23, 29}})
-	ExpectThat(err, Error(Equals("")))
-
-	// Element type alias
-	type myType int
-	err = m.Matches([2][2]myType{[2]myType{17, 19}, [2]myType{23, 29}})
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type [2][2]oglematchers_test.myType")))
-}
-
-func (t *IdenticalToTest) NonComparableArrays() {
-	x := [0]func(){}
-	f := func() { IdenticalTo(x) }
-	ExpectThat(f, Panics(HasSubstr("is not comparable")))
-}
-
-func (t *IdenticalToTest) ArraysOfNonComparableArrays() {
-	x := [0][0]func(){}
-	f := func() { IdenticalTo(x) }
-	ExpectThat(f, Panics(HasSubstr("is not comparable")))
-}
-
-func (t *IdenticalToTest) Strings() {
-	var m Matcher
-	var err error
-
-	m = IdenticalTo("taco")
-	ExpectEq("identical to <string> taco", m.Description())
-
-	// Identical value
-	err = m.Matches("ta" + "co")
-	ExpectEq(nil, err)
-
-	// Type alias
-	type myType string
-	err = m.Matches(myType("taco"))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) ComparableStructs() {
-	var m Matcher
-	var err error
-
-	type subStruct struct {
-		i int
-	}
-
-	type myStruct struct {
-		u uint
-		s subStruct
-	}
-
-	x := myStruct{17, subStruct{19}}
-	m = IdenticalTo(x)
-	ExpectEq("identical to <oglematchers_test.myStruct> {17 {19}}", m.Description())
-
-	// Identical value
-	err = m.Matches(myStruct{17, subStruct{19}})
-	ExpectEq(nil, err)
-
-	// Wrong outer field
-	err = m.Matches(myStruct{13, subStruct{19}})
-	ExpectThat(err, Error(Equals("")))
-
-	// Wrong inner field
-	err = m.Matches(myStruct{17, subStruct{23}})
-	ExpectThat(err, Error(Equals("")))
-
-	// Type alias
-	type myType myStruct
-	err = m.Matches(myType{17, subStruct{19}})
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) NonComparableStructs() {
-	type subStruct struct {
-		s []int
-	}
-
-	type myStruct struct {
-		u uint
-		s subStruct
-	}
-
-	x := myStruct{17, subStruct{[]int{19}}}
-	f := func() { IdenticalTo(x) }
-	ExpectThat(f, Panics(AllOf(HasSubstr("IdenticalTo"), HasSubstr("comparable"))))
-}
-
-func (t *IdenticalToTest) NilUnsafePointer() {
-	var m Matcher
-	var err error
-
-	x := unsafe.Pointer(nil)
-	m = IdenticalTo(x)
-	ExpectEq(fmt.Sprintf("identical to <unsafe.Pointer> %v", x), m.Description())
-
-	// Identical value
-	err = m.Matches(unsafe.Pointer(nil))
-	ExpectEq(nil, err)
-
-	// Wrong value
-	j := 17
-	err = m.Matches(unsafe.Pointer(&j))
-	ExpectThat(err, Error(Equals("")))
-
-	// Type alias
-	type myType unsafe.Pointer
-	err = m.Matches(myType(unsafe.Pointer(nil)))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) NonNilUnsafePointer() {
-	var m Matcher
-	var err error
-
-	i := 17
-	x := unsafe.Pointer(&i)
-	m = IdenticalTo(x)
-	ExpectEq(fmt.Sprintf("identical to <unsafe.Pointer> %v", x), m.Description())
-
-	// Identical value
-	err = m.Matches(unsafe.Pointer(&i))
-	ExpectEq(nil, err)
-
-	// Nil value
-	err = m.Matches(unsafe.Pointer(nil))
-	ExpectThat(err, Error(Equals("")))
-
-	// Wrong value
-	j := 17
-	err = m.Matches(unsafe.Pointer(&j))
-	ExpectThat(err, Error(Equals("")))
-
-	// Type alias
-	type myType unsafe.Pointer
-	err = m.Matches(myType(unsafe.Pointer(&i)))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type oglematchers_test.myType")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}
-
-func (t *IdenticalToTest) IntAlias() {
-	var m Matcher
-	var err error
-
-	type intAlias int
-
-	m = IdenticalTo(intAlias(17))
-	ExpectEq("identical to <oglematchers_test.intAlias> 17", m.Description())
-
-	// Identical value
-	err = m.Matches(intAlias(17))
-	ExpectEq(nil, err)
-
-	// Int
-	err = m.Matches(int(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int")))
-
-	// Completely wrong type
-	err = m.Matches(int32(17))
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("which is of type int32")))
-}

+ 0 - 41
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/less_or_equal.go

@@ -1,41 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"fmt"
-	"reflect"
-)
-
-// LessOrEqual returns a matcher that matches integer, floating point, or
-// strings values v such that v <= x. Comparison is not defined between numeric
-// and string types, but is defined between all integer and floating point
-// types.
-//
-// x must itself be an integer, floating point, or string type; otherwise,
-// LessOrEqual will panic.
-func LessOrEqual(x interface{}) Matcher {
-	desc := fmt.Sprintf("less than or equal to %v", x)
-
-	// Special case: make it clear that strings are strings.
-	if reflect.TypeOf(x).Kind() == reflect.String {
-		desc = fmt.Sprintf("less than or equal to \"%s\"", x)
-	}
-
-	// Put LessThan last so that its error messages will be used in the event of
-	// failure.
-	return transformDescription(AnyOf(Equals(x), LessThan(x)), desc)
-}

+ 0 - 1079
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/less_or_equal_test.go

@@ -1,1079 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	"math"
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type LessOrEqualTest struct {
-}
-
-func init() { RegisterTestSuite(&LessOrEqualTest{}) }
-
-type leTestCase struct {
-	candidate      interface{}
-	expectedResult bool
-	shouldBeFatal  bool
-	expectedError  string
-}
-
-func (t *LessOrEqualTest) checkTestCases(matcher Matcher, cases []leTestCase) {
-	for i, c := range cases {
-		err := matcher.Matches(c.candidate)
-
-		ExpectThat(
-			(err == nil),
-			Equals(c.expectedResult),
-			"Case %d (candidate %v)",
-			i,
-			c.candidate)
-
-		if err == nil {
-			continue
-		}
-
-		_, isFatal := err.(*FatalError)
-		ExpectEq(
-			c.shouldBeFatal,
-			isFatal,
-			"Case %d (candidate %v)",
-			i,
-			c.candidate)
-
-		ExpectThat(
-			err,
-			Error(Equals(c.expectedError)),
-			"Case %d (candidate %v)",
-			i,
-			c.candidate)
-	}
-}
-
-////////////////////////////////////////////////////////////////////////
-// Integer literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *LessOrEqualTest) IntegerCandidateBadTypes() {
-	matcher := LessOrEqual(int(-150))
-
-	cases := []leTestCase{
-		leTestCase{true, false, true, "which is not comparable"},
-		leTestCase{uintptr(17), false, true, "which is not comparable"},
-		leTestCase{complex64(-151), false, true, "which is not comparable"},
-		leTestCase{complex128(-151), false, true, "which is not comparable"},
-		leTestCase{[...]int{-151}, false, true, "which is not comparable"},
-		leTestCase{make(chan int), false, true, "which is not comparable"},
-		leTestCase{func() {}, false, true, "which is not comparable"},
-		leTestCase{map[int]int{}, false, true, "which is not comparable"},
-		leTestCase{&leTestCase{}, false, true, "which is not comparable"},
-		leTestCase{make([]int, 0), false, true, "which is not comparable"},
-		leTestCase{"-151", false, true, "which is not comparable"},
-		leTestCase{leTestCase{}, false, true, "which is not comparable"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessOrEqualTest) FloatCandidateBadTypes() {
-	matcher := LessOrEqual(float32(-150))
-
-	cases := []leTestCase{
-		leTestCase{true, false, true, "which is not comparable"},
-		leTestCase{uintptr(17), false, true, "which is not comparable"},
-		leTestCase{complex64(-151), false, true, "which is not comparable"},
-		leTestCase{complex128(-151), false, true, "which is not comparable"},
-		leTestCase{[...]int{-151}, false, true, "which is not comparable"},
-		leTestCase{make(chan int), false, true, "which is not comparable"},
-		leTestCase{func() {}, false, true, "which is not comparable"},
-		leTestCase{map[int]int{}, false, true, "which is not comparable"},
-		leTestCase{&leTestCase{}, false, true, "which is not comparable"},
-		leTestCase{make([]int, 0), false, true, "which is not comparable"},
-		leTestCase{"-151", false, true, "which is not comparable"},
-		leTestCase{leTestCase{}, false, true, "which is not comparable"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessOrEqualTest) StringCandidateBadTypes() {
-	matcher := LessOrEqual("17")
-
-	cases := []leTestCase{
-		leTestCase{true, false, true, "which is not comparable"},
-		leTestCase{int(0), false, true, "which is not comparable"},
-		leTestCase{int8(0), false, true, "which is not comparable"},
-		leTestCase{int16(0), false, true, "which is not comparable"},
-		leTestCase{int32(0), false, true, "which is not comparable"},
-		leTestCase{int64(0), false, true, "which is not comparable"},
-		leTestCase{uint(0), false, true, "which is not comparable"},
-		leTestCase{uint8(0), false, true, "which is not comparable"},
-		leTestCase{uint16(0), false, true, "which is not comparable"},
-		leTestCase{uint32(0), false, true, "which is not comparable"},
-		leTestCase{uint64(0), false, true, "which is not comparable"},
-		leTestCase{uintptr(17), false, true, "which is not comparable"},
-		leTestCase{float32(0), false, true, "which is not comparable"},
-		leTestCase{float64(0), false, true, "which is not comparable"},
-		leTestCase{complex64(-151), false, true, "which is not comparable"},
-		leTestCase{complex128(-151), false, true, "which is not comparable"},
-		leTestCase{[...]int{-151}, false, true, "which is not comparable"},
-		leTestCase{make(chan int), false, true, "which is not comparable"},
-		leTestCase{func() {}, false, true, "which is not comparable"},
-		leTestCase{map[int]int{}, false, true, "which is not comparable"},
-		leTestCase{&leTestCase{}, false, true, "which is not comparable"},
-		leTestCase{make([]int, 0), false, true, "which is not comparable"},
-		leTestCase{leTestCase{}, false, true, "which is not comparable"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessOrEqualTest) BadArgument() {
-	panicked := false
-
-	defer func() {
-		ExpectThat(panicked, Equals(true))
-	}()
-
-	defer func() {
-		if r := recover(); r != nil {
-			panicked = true
-		}
-	}()
-
-	LessOrEqual(complex128(0))
-}
-
-////////////////////////////////////////////////////////////////////////
-// Integer literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *LessOrEqualTest) NegativeIntegerLiteral() {
-	matcher := LessOrEqual(-150)
-	desc := matcher.Description()
-	expectedDesc := "less than or equal to -150"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []leTestCase{
-		// Signed integers.
-		leTestCase{-(1 << 30), true, false, ""},
-		leTestCase{-151, true, false, ""},
-		leTestCase{-150, true, false, ""},
-		leTestCase{-149, false, false, ""},
-		leTestCase{0, false, false, ""},
-		leTestCase{17, false, false, ""},
-
-		leTestCase{int(-(1 << 30)), true, false, ""},
-		leTestCase{int(-151), true, false, ""},
-		leTestCase{int(-150), true, false, ""},
-		leTestCase{int(-149), false, false, ""},
-		leTestCase{int(0), false, false, ""},
-		leTestCase{int(17), false, false, ""},
-
-		leTestCase{int8(-127), false, false, ""},
-		leTestCase{int8(0), false, false, ""},
-		leTestCase{int8(17), false, false, ""},
-
-		leTestCase{int16(-(1 << 14)), true, false, ""},
-		leTestCase{int16(-151), true, false, ""},
-		leTestCase{int16(-150), true, false, ""},
-		leTestCase{int16(-149), false, false, ""},
-		leTestCase{int16(0), false, false, ""},
-		leTestCase{int16(17), false, false, ""},
-
-		leTestCase{int32(-(1 << 30)), true, false, ""},
-		leTestCase{int32(-151), true, false, ""},
-		leTestCase{int32(-150), true, false, ""},
-		leTestCase{int32(-149), false, false, ""},
-		leTestCase{int32(0), false, false, ""},
-		leTestCase{int32(17), false, false, ""},
-
-		leTestCase{int64(-(1 << 30)), true, false, ""},
-		leTestCase{int64(-151), true, false, ""},
-		leTestCase{int64(-150), true, false, ""},
-		leTestCase{int64(-149), false, false, ""},
-		leTestCase{int64(0), false, false, ""},
-		leTestCase{int64(17), false, false, ""},
-
-		// Unsigned integers.
-		leTestCase{uint((1 << 32) - 151), false, false, ""},
-		leTestCase{uint(0), false, false, ""},
-		leTestCase{uint(17), false, false, ""},
-
-		leTestCase{uint8(0), false, false, ""},
-		leTestCase{uint8(17), false, false, ""},
-		leTestCase{uint8(253), false, false, ""},
-
-		leTestCase{uint16((1 << 16) - 151), false, false, ""},
-		leTestCase{uint16(0), false, false, ""},
-		leTestCase{uint16(17), false, false, ""},
-
-		leTestCase{uint32((1 << 32) - 151), false, false, ""},
-		leTestCase{uint32(0), false, false, ""},
-		leTestCase{uint32(17), false, false, ""},
-
-		leTestCase{uint64((1 << 64) - 151), false, false, ""},
-		leTestCase{uint64(0), false, false, ""},
-		leTestCase{uint64(17), false, false, ""},
-
-		// Floating point.
-		leTestCase{float32(-(1 << 30)), true, false, ""},
-		leTestCase{float32(-151), true, false, ""},
-		leTestCase{float32(-150.1), true, false, ""},
-		leTestCase{float32(-150), true, false, ""},
-		leTestCase{float32(-149.9), false, false, ""},
-		leTestCase{float32(0), false, false, ""},
-		leTestCase{float32(17), false, false, ""},
-		leTestCase{float32(160), false, false, ""},
-
-		leTestCase{float64(-(1 << 30)), true, false, ""},
-		leTestCase{float64(-151), true, false, ""},
-		leTestCase{float64(-150.1), true, false, ""},
-		leTestCase{float64(-150), true, false, ""},
-		leTestCase{float64(-149.9), false, false, ""},
-		leTestCase{float64(0), false, false, ""},
-		leTestCase{float64(17), false, false, ""},
-		leTestCase{float64(160), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessOrEqualTest) ZeroIntegerLiteral() {
-	matcher := LessOrEqual(0)
-	desc := matcher.Description()
-	expectedDesc := "less than or equal to 0"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []leTestCase{
-		// Signed integers.
-		leTestCase{-(1 << 30), true, false, ""},
-		leTestCase{-1, true, false, ""},
-		leTestCase{0, true, false, ""},
-		leTestCase{1, false, false, ""},
-		leTestCase{17, false, false, ""},
-		leTestCase{(1 << 30), false, false, ""},
-
-		leTestCase{int(-(1 << 30)), true, false, ""},
-		leTestCase{int(-1), true, false, ""},
-		leTestCase{int(0), true, false, ""},
-		leTestCase{int(1), false, false, ""},
-		leTestCase{int(17), false, false, ""},
-
-		leTestCase{int8(-1), true, false, ""},
-		leTestCase{int8(0), true, false, ""},
-		leTestCase{int8(1), false, false, ""},
-
-		leTestCase{int16(-(1 << 14)), true, false, ""},
-		leTestCase{int16(-1), true, false, ""},
-		leTestCase{int16(0), true, false, ""},
-		leTestCase{int16(1), false, false, ""},
-		leTestCase{int16(17), false, false, ""},
-
-		leTestCase{int32(-(1 << 30)), true, false, ""},
-		leTestCase{int32(-1), true, false, ""},
-		leTestCase{int32(0), true, false, ""},
-		leTestCase{int32(1), false, false, ""},
-		leTestCase{int32(17), false, false, ""},
-
-		leTestCase{int64(-(1 << 30)), true, false, ""},
-		leTestCase{int64(-1), true, false, ""},
-		leTestCase{int64(0), true, false, ""},
-		leTestCase{int64(1), false, false, ""},
-		leTestCase{int64(17), false, false, ""},
-
-		// Unsigned integers.
-		leTestCase{uint((1 << 32) - 1), false, false, ""},
-		leTestCase{uint(0), true, false, ""},
-		leTestCase{uint(1), false, false, ""},
-		leTestCase{uint(17), false, false, ""},
-
-		leTestCase{uint8(0), true, false, ""},
-		leTestCase{uint8(1), false, false, ""},
-		leTestCase{uint8(17), false, false, ""},
-		leTestCase{uint8(253), false, false, ""},
-
-		leTestCase{uint16((1 << 16) - 1), false, false, ""},
-		leTestCase{uint16(0), true, false, ""},
-		leTestCase{uint16(1), false, false, ""},
-		leTestCase{uint16(17), false, false, ""},
-
-		leTestCase{uint32((1 << 32) - 1), false, false, ""},
-		leTestCase{uint32(0), true, false, ""},
-		leTestCase{uint32(1), false, false, ""},
-		leTestCase{uint32(17), false, false, ""},
-
-		leTestCase{uint64((1 << 64) - 1), false, false, ""},
-		leTestCase{uint64(0), true, false, ""},
-		leTestCase{uint64(1), false, false, ""},
-		leTestCase{uint64(17), false, false, ""},
-
-		// Floating point.
-		leTestCase{float32(-(1 << 30)), true, false, ""},
-		leTestCase{float32(-1), true, false, ""},
-		leTestCase{float32(-0.1), true, false, ""},
-		leTestCase{float32(-0.0), true, false, ""},
-		leTestCase{float32(0), true, false, ""},
-		leTestCase{float32(0.1), false, false, ""},
-		leTestCase{float32(17), false, false, ""},
-		leTestCase{float32(160), false, false, ""},
-
-		leTestCase{float64(-(1 << 30)), true, false, ""},
-		leTestCase{float64(-1), true, false, ""},
-		leTestCase{float64(-0.1), true, false, ""},
-		leTestCase{float64(-0), true, false, ""},
-		leTestCase{float64(0), true, false, ""},
-		leTestCase{float64(0.1), false, false, ""},
-		leTestCase{float64(17), false, false, ""},
-		leTestCase{float64(160), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessOrEqualTest) PositiveIntegerLiteral() {
-	matcher := LessOrEqual(150)
-	desc := matcher.Description()
-	expectedDesc := "less than or equal to 150"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []leTestCase{
-		// Signed integers.
-		leTestCase{-1, true, false, ""},
-		leTestCase{149, true, false, ""},
-		leTestCase{150, true, false, ""},
-		leTestCase{151, false, false, ""},
-
-		leTestCase{int(-1), true, false, ""},
-		leTestCase{int(149), true, false, ""},
-		leTestCase{int(150), true, false, ""},
-		leTestCase{int(151), false, false, ""},
-
-		leTestCase{int8(-1), true, false, ""},
-		leTestCase{int8(0), true, false, ""},
-		leTestCase{int8(17), true, false, ""},
-		leTestCase{int8(127), true, false, ""},
-
-		leTestCase{int16(-1), true, false, ""},
-		leTestCase{int16(149), true, false, ""},
-		leTestCase{int16(150), true, false, ""},
-		leTestCase{int16(151), false, false, ""},
-
-		leTestCase{int32(-1), true, false, ""},
-		leTestCase{int32(149), true, false, ""},
-		leTestCase{int32(150), true, false, ""},
-		leTestCase{int32(151), false, false, ""},
-
-		leTestCase{int64(-1), true, false, ""},
-		leTestCase{int64(149), true, false, ""},
-		leTestCase{int64(150), true, false, ""},
-		leTestCase{int64(151), false, false, ""},
-
-		// Unsigned integers.
-		leTestCase{uint(0), true, false, ""},
-		leTestCase{uint(149), true, false, ""},
-		leTestCase{uint(150), true, false, ""},
-		leTestCase{uint(151), false, false, ""},
-
-		leTestCase{uint8(0), true, false, ""},
-		leTestCase{uint8(127), true, false, ""},
-
-		leTestCase{uint16(0), true, false, ""},
-		leTestCase{uint16(149), true, false, ""},
-		leTestCase{uint16(150), true, false, ""},
-		leTestCase{uint16(151), false, false, ""},
-
-		leTestCase{uint32(0), true, false, ""},
-		leTestCase{uint32(149), true, false, ""},
-		leTestCase{uint32(150), true, false, ""},
-		leTestCase{uint32(151), false, false, ""},
-
-		leTestCase{uint64(0), true, false, ""},
-		leTestCase{uint64(149), true, false, ""},
-		leTestCase{uint64(150), true, false, ""},
-		leTestCase{uint64(151), false, false, ""},
-
-		// Floating point.
-		leTestCase{float32(-1), true, false, ""},
-		leTestCase{float32(149), true, false, ""},
-		leTestCase{float32(149.9), true, false, ""},
-		leTestCase{float32(150), true, false, ""},
-		leTestCase{float32(150.1), false, false, ""},
-		leTestCase{float32(151), false, false, ""},
-
-		leTestCase{float64(-1), true, false, ""},
-		leTestCase{float64(149), true, false, ""},
-		leTestCase{float64(149.9), true, false, ""},
-		leTestCase{float64(150), true, false, ""},
-		leTestCase{float64(150.1), false, false, ""},
-		leTestCase{float64(151), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// Float literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *LessOrEqualTest) NegativeFloatLiteral() {
-	matcher := LessOrEqual(-150.1)
-	desc := matcher.Description()
-	expectedDesc := "less than or equal to -150.1"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []leTestCase{
-		// Signed integers.
-		leTestCase{-(1 << 30), true, false, ""},
-		leTestCase{-151, true, false, ""},
-		leTestCase{-150.1, true, false, ""},
-		leTestCase{-150, false, false, ""},
-		leTestCase{-149, false, false, ""},
-		leTestCase{0, false, false, ""},
-		leTestCase{17, false, false, ""},
-
-		leTestCase{int(-(1 << 30)), true, false, ""},
-		leTestCase{int(-151), true, false, ""},
-		leTestCase{int(-150), false, false, ""},
-		leTestCase{int(-149), false, false, ""},
-		leTestCase{int(0), false, false, ""},
-		leTestCase{int(17), false, false, ""},
-
-		leTestCase{int8(-127), false, false, ""},
-		leTestCase{int8(0), false, false, ""},
-		leTestCase{int8(17), false, false, ""},
-
-		leTestCase{int16(-(1 << 14)), true, false, ""},
-		leTestCase{int16(-151), true, false, ""},
-		leTestCase{int16(-150), false, false, ""},
-		leTestCase{int16(-149), false, false, ""},
-		leTestCase{int16(0), false, false, ""},
-		leTestCase{int16(17), false, false, ""},
-
-		leTestCase{int32(-(1 << 30)), true, false, ""},
-		leTestCase{int32(-151), true, false, ""},
-		leTestCase{int32(-150), false, false, ""},
-		leTestCase{int32(-149), false, false, ""},
-		leTestCase{int32(0), false, false, ""},
-		leTestCase{int32(17), false, false, ""},
-
-		leTestCase{int64(-(1 << 30)), true, false, ""},
-		leTestCase{int64(-151), true, false, ""},
-		leTestCase{int64(-150), false, false, ""},
-		leTestCase{int64(-149), false, false, ""},
-		leTestCase{int64(0), false, false, ""},
-		leTestCase{int64(17), false, false, ""},
-
-		// Unsigned integers.
-		leTestCase{uint((1 << 32) - 151), false, false, ""},
-		leTestCase{uint(0), false, false, ""},
-		leTestCase{uint(17), false, false, ""},
-
-		leTestCase{uint8(0), false, false, ""},
-		leTestCase{uint8(17), false, false, ""},
-		leTestCase{uint8(253), false, false, ""},
-
-		leTestCase{uint16((1 << 16) - 151), false, false, ""},
-		leTestCase{uint16(0), false, false, ""},
-		leTestCase{uint16(17), false, false, ""},
-
-		leTestCase{uint32((1 << 32) - 151), false, false, ""},
-		leTestCase{uint32(0), false, false, ""},
-		leTestCase{uint32(17), false, false, ""},
-
-		leTestCase{uint64((1 << 64) - 151), false, false, ""},
-		leTestCase{uint64(0), false, false, ""},
-		leTestCase{uint64(17), false, false, ""},
-
-		// Floating point.
-		leTestCase{float32(-(1 << 30)), true, false, ""},
-		leTestCase{float32(-151), true, false, ""},
-		leTestCase{float32(-150.2), true, false, ""},
-		leTestCase{float32(-150.1), true, false, ""},
-		leTestCase{float32(-150), false, false, ""},
-		leTestCase{float32(0), false, false, ""},
-		leTestCase{float32(17), false, false, ""},
-		leTestCase{float32(160), false, false, ""},
-
-		leTestCase{float64(-(1 << 30)), true, false, ""},
-		leTestCase{float64(-151), true, false, ""},
-		leTestCase{float64(-150.2), true, false, ""},
-		leTestCase{float64(-150.1), true, false, ""},
-		leTestCase{float64(-150), false, false, ""},
-		leTestCase{float64(0), false, false, ""},
-		leTestCase{float64(17), false, false, ""},
-		leTestCase{float64(160), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessOrEqualTest) PositiveFloatLiteral() {
-	matcher := LessOrEqual(149.9)
-	desc := matcher.Description()
-	expectedDesc := "less than or equal to 149.9"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []leTestCase{
-		// Signed integers.
-		leTestCase{-1, true, false, ""},
-		leTestCase{149, true, false, ""},
-		leTestCase{149.9, true, false, ""},
-		leTestCase{150, false, false, ""},
-		leTestCase{151, false, false, ""},
-
-		leTestCase{int(-1), true, false, ""},
-		leTestCase{int(149), true, false, ""},
-		leTestCase{int(150), false, false, ""},
-		leTestCase{int(151), false, false, ""},
-
-		leTestCase{int8(-1), true, false, ""},
-		leTestCase{int8(0), true, false, ""},
-		leTestCase{int8(17), true, false, ""},
-		leTestCase{int8(127), true, false, ""},
-
-		leTestCase{int16(-1), true, false, ""},
-		leTestCase{int16(149), true, false, ""},
-		leTestCase{int16(150), false, false, ""},
-		leTestCase{int16(151), false, false, ""},
-
-		leTestCase{int32(-1), true, false, ""},
-		leTestCase{int32(149), true, false, ""},
-		leTestCase{int32(150), false, false, ""},
-		leTestCase{int32(151), false, false, ""},
-
-		leTestCase{int64(-1), true, false, ""},
-		leTestCase{int64(149), true, false, ""},
-		leTestCase{int64(150), false, false, ""},
-		leTestCase{int64(151), false, false, ""},
-
-		// Unsigned integers.
-		leTestCase{uint(0), true, false, ""},
-		leTestCase{uint(149), true, false, ""},
-		leTestCase{uint(150), false, false, ""},
-		leTestCase{uint(151), false, false, ""},
-
-		leTestCase{uint8(0), true, false, ""},
-		leTestCase{uint8(127), true, false, ""},
-
-		leTestCase{uint16(0), true, false, ""},
-		leTestCase{uint16(149), true, false, ""},
-		leTestCase{uint16(150), false, false, ""},
-		leTestCase{uint16(151), false, false, ""},
-
-		leTestCase{uint32(0), true, false, ""},
-		leTestCase{uint32(149), true, false, ""},
-		leTestCase{uint32(150), false, false, ""},
-		leTestCase{uint32(151), false, false, ""},
-
-		leTestCase{uint64(0), true, false, ""},
-		leTestCase{uint64(149), true, false, ""},
-		leTestCase{uint64(150), false, false, ""},
-		leTestCase{uint64(151), false, false, ""},
-
-		// Floating point.
-		leTestCase{float32(-1), true, false, ""},
-		leTestCase{float32(149), true, false, ""},
-		leTestCase{float32(149.8), true, false, ""},
-		leTestCase{float32(149.9), true, false, ""},
-		leTestCase{float32(150), false, false, ""},
-		leTestCase{float32(151), false, false, ""},
-
-		leTestCase{float64(-1), true, false, ""},
-		leTestCase{float64(149), true, false, ""},
-		leTestCase{float64(149.8), true, false, ""},
-		leTestCase{float64(149.9), true, false, ""},
-		leTestCase{float64(150), false, false, ""},
-		leTestCase{float64(151), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// Subtle cases
-////////////////////////////////////////////////////////////////////////
-
-func (t *LessOrEqualTest) Int64NotExactlyRepresentableBySinglePrecision() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := LessOrEqual(int64(kTwoTo25 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "less than or equal to 33554433"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []leTestCase{
-		// Signed integers.
-		leTestCase{-1, true, false, ""},
-		leTestCase{kTwoTo25 + 0, true, false, ""},
-		leTestCase{kTwoTo25 + 1, true, false, ""},
-		leTestCase{kTwoTo25 + 2, false, false, ""},
-
-		leTestCase{int(-1), true, false, ""},
-		leTestCase{int(kTwoTo25 + 0), true, false, ""},
-		leTestCase{int(kTwoTo25 + 1), true, false, ""},
-		leTestCase{int(kTwoTo25 + 2), false, false, ""},
-
-		leTestCase{int8(-1), true, false, ""},
-		leTestCase{int8(127), true, false, ""},
-
-		leTestCase{int16(-1), true, false, ""},
-		leTestCase{int16(0), true, false, ""},
-		leTestCase{int16(32767), true, false, ""},
-
-		leTestCase{int32(-1), true, false, ""},
-		leTestCase{int32(kTwoTo25 + 0), true, false, ""},
-		leTestCase{int32(kTwoTo25 + 1), true, false, ""},
-		leTestCase{int32(kTwoTo25 + 2), false, false, ""},
-
-		leTestCase{int64(-1), true, false, ""},
-		leTestCase{int64(kTwoTo25 + 0), true, false, ""},
-		leTestCase{int64(kTwoTo25 + 1), true, false, ""},
-		leTestCase{int64(kTwoTo25 + 2), false, false, ""},
-
-		// Unsigned integers.
-		leTestCase{uint(0), true, false, ""},
-		leTestCase{uint(kTwoTo25 + 0), true, false, ""},
-		leTestCase{uint(kTwoTo25 + 1), true, false, ""},
-		leTestCase{uint(kTwoTo25 + 2), false, false, ""},
-
-		leTestCase{uint8(0), true, false, ""},
-		leTestCase{uint8(255), true, false, ""},
-
-		leTestCase{uint16(0), true, false, ""},
-		leTestCase{uint16(65535), true, false, ""},
-
-		leTestCase{uint32(0), true, false, ""},
-		leTestCase{uint32(kTwoTo25 + 0), true, false, ""},
-		leTestCase{uint32(kTwoTo25 + 1), true, false, ""},
-		leTestCase{uint32(kTwoTo25 + 2), false, false, ""},
-
-		leTestCase{uint64(0), true, false, ""},
-		leTestCase{uint64(kTwoTo25 + 0), true, false, ""},
-		leTestCase{uint64(kTwoTo25 + 1), true, false, ""},
-		leTestCase{uint64(kTwoTo25 + 2), false, false, ""},
-
-		// Floating point.
-		leTestCase{float32(-1), true, false, ""},
-		leTestCase{float32(kTwoTo25 - 2), true, false, ""},
-		leTestCase{float32(kTwoTo25 - 1), true, false, ""},
-		leTestCase{float32(kTwoTo25 + 0), true, false, ""},
-		leTestCase{float32(kTwoTo25 + 1), true, false, ""},
-		leTestCase{float32(kTwoTo25 + 2), true, false, ""},
-		leTestCase{float32(kTwoTo25 + 3), false, false, ""},
-
-		leTestCase{float64(-1), true, false, ""},
-		leTestCase{float64(kTwoTo25 - 2), true, false, ""},
-		leTestCase{float64(kTwoTo25 - 1), true, false, ""},
-		leTestCase{float64(kTwoTo25 + 0), true, false, ""},
-		leTestCase{float64(kTwoTo25 + 1), true, false, ""},
-		leTestCase{float64(kTwoTo25 + 2), false, false, ""},
-		leTestCase{float64(kTwoTo25 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessOrEqualTest) Int64NotExactlyRepresentableByDoublePrecision() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := LessOrEqual(int64(kTwoTo54 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "less than or equal to 18014398509481985"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []leTestCase{
-		// Signed integers.
-		leTestCase{-1, true, false, ""},
-		leTestCase{1 << 30, true, false, ""},
-
-		leTestCase{int(-1), true, false, ""},
-		leTestCase{int(math.MaxInt32), true, false, ""},
-
-		leTestCase{int8(-1), true, false, ""},
-		leTestCase{int8(127), true, false, ""},
-
-		leTestCase{int16(-1), true, false, ""},
-		leTestCase{int16(0), true, false, ""},
-		leTestCase{int16(32767), true, false, ""},
-
-		leTestCase{int32(-1), true, false, ""},
-		leTestCase{int32(math.MaxInt32), true, false, ""},
-
-		leTestCase{int64(-1), true, false, ""},
-		leTestCase{int64(kTwoTo54 - 1), true, false, ""},
-		leTestCase{int64(kTwoTo54 + 0), true, false, ""},
-		leTestCase{int64(kTwoTo54 + 1), true, false, ""},
-		leTestCase{int64(kTwoTo54 + 2), false, false, ""},
-
-		// Unsigned integers.
-		leTestCase{uint(0), true, false, ""},
-		leTestCase{uint(math.MaxUint32), true, false, ""},
-
-		leTestCase{uint8(0), true, false, ""},
-		leTestCase{uint8(255), true, false, ""},
-
-		leTestCase{uint16(0), true, false, ""},
-		leTestCase{uint16(65535), true, false, ""},
-
-		leTestCase{uint32(0), true, false, ""},
-		leTestCase{uint32(math.MaxUint32), true, false, ""},
-
-		leTestCase{uint64(0), true, false, ""},
-		leTestCase{uint64(kTwoTo54 - 1), true, false, ""},
-		leTestCase{uint64(kTwoTo54 + 0), true, false, ""},
-		leTestCase{uint64(kTwoTo54 + 1), true, false, ""},
-		leTestCase{uint64(kTwoTo54 + 2), false, false, ""},
-
-		// Floating point.
-		leTestCase{float64(-1), true, false, ""},
-		leTestCase{float64(kTwoTo54 - 2), true, false, ""},
-		leTestCase{float64(kTwoTo54 - 1), true, false, ""},
-		leTestCase{float64(kTwoTo54 + 0), true, false, ""},
-		leTestCase{float64(kTwoTo54 + 1), true, false, ""},
-		leTestCase{float64(kTwoTo54 + 2), true, false, ""},
-		leTestCase{float64(kTwoTo54 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessOrEqualTest) Uint64NotExactlyRepresentableBySinglePrecision() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := LessOrEqual(uint64(kTwoTo25 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "less than or equal to 33554433"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []leTestCase{
-		// Signed integers.
-		leTestCase{-1, true, false, ""},
-		leTestCase{kTwoTo25 + 0, true, false, ""},
-		leTestCase{kTwoTo25 + 1, true, false, ""},
-		leTestCase{kTwoTo25 + 2, false, false, ""},
-
-		leTestCase{int(-1), true, false, ""},
-		leTestCase{int(kTwoTo25 + 0), true, false, ""},
-		leTestCase{int(kTwoTo25 + 1), true, false, ""},
-		leTestCase{int(kTwoTo25 + 2), false, false, ""},
-
-		leTestCase{int8(-1), true, false, ""},
-		leTestCase{int8(127), true, false, ""},
-
-		leTestCase{int16(-1), true, false, ""},
-		leTestCase{int16(0), true, false, ""},
-		leTestCase{int16(32767), true, false, ""},
-
-		leTestCase{int32(-1), true, false, ""},
-		leTestCase{int32(kTwoTo25 + 0), true, false, ""},
-		leTestCase{int32(kTwoTo25 + 1), true, false, ""},
-		leTestCase{int32(kTwoTo25 + 2), false, false, ""},
-
-		leTestCase{int64(-1), true, false, ""},
-		leTestCase{int64(kTwoTo25 + 0), true, false, ""},
-		leTestCase{int64(kTwoTo25 + 1), true, false, ""},
-		leTestCase{int64(kTwoTo25 + 2), false, false, ""},
-
-		// Unsigned integers.
-		leTestCase{uint(0), true, false, ""},
-		leTestCase{uint(kTwoTo25 + 0), true, false, ""},
-		leTestCase{uint(kTwoTo25 + 1), true, false, ""},
-		leTestCase{uint(kTwoTo25 + 2), false, false, ""},
-
-		leTestCase{uint8(0), true, false, ""},
-		leTestCase{uint8(255), true, false, ""},
-
-		leTestCase{uint16(0), true, false, ""},
-		leTestCase{uint16(65535), true, false, ""},
-
-		leTestCase{uint32(0), true, false, ""},
-		leTestCase{uint32(kTwoTo25 + 0), true, false, ""},
-		leTestCase{uint32(kTwoTo25 + 1), true, false, ""},
-		leTestCase{uint32(kTwoTo25 + 2), false, false, ""},
-
-		leTestCase{uint64(0), true, false, ""},
-		leTestCase{uint64(kTwoTo25 + 0), true, false, ""},
-		leTestCase{uint64(kTwoTo25 + 1), true, false, ""},
-		leTestCase{uint64(kTwoTo25 + 2), false, false, ""},
-
-		// Floating point.
-		leTestCase{float32(-1), true, false, ""},
-		leTestCase{float32(kTwoTo25 - 2), true, false, ""},
-		leTestCase{float32(kTwoTo25 - 1), true, false, ""},
-		leTestCase{float32(kTwoTo25 + 0), true, false, ""},
-		leTestCase{float32(kTwoTo25 + 1), true, false, ""},
-		leTestCase{float32(kTwoTo25 + 2), true, false, ""},
-		leTestCase{float32(kTwoTo25 + 3), false, false, ""},
-
-		leTestCase{float64(-1), true, false, ""},
-		leTestCase{float64(kTwoTo25 - 2), true, false, ""},
-		leTestCase{float64(kTwoTo25 - 1), true, false, ""},
-		leTestCase{float64(kTwoTo25 + 0), true, false, ""},
-		leTestCase{float64(kTwoTo25 + 1), true, false, ""},
-		leTestCase{float64(kTwoTo25 + 2), false, false, ""},
-		leTestCase{float64(kTwoTo25 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessOrEqualTest) Uint64NotExactlyRepresentableByDoublePrecision() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := LessOrEqual(uint64(kTwoTo54 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "less than or equal to 18014398509481985"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []leTestCase{
-		// Signed integers.
-		leTestCase{-1, true, false, ""},
-		leTestCase{1 << 30, true, false, ""},
-
-		leTestCase{int(-1), true, false, ""},
-		leTestCase{int(math.MaxInt32), true, false, ""},
-
-		leTestCase{int8(-1), true, false, ""},
-		leTestCase{int8(127), true, false, ""},
-
-		leTestCase{int16(-1), true, false, ""},
-		leTestCase{int16(0), true, false, ""},
-		leTestCase{int16(32767), true, false, ""},
-
-		leTestCase{int32(-1), true, false, ""},
-		leTestCase{int32(math.MaxInt32), true, false, ""},
-
-		leTestCase{int64(-1), true, false, ""},
-		leTestCase{int64(kTwoTo54 - 1), true, false, ""},
-		leTestCase{int64(kTwoTo54 + 0), true, false, ""},
-		leTestCase{int64(kTwoTo54 + 1), true, false, ""},
-		leTestCase{int64(kTwoTo54 + 2), false, false, ""},
-
-		// Unsigned integers.
-		leTestCase{uint(0), true, false, ""},
-		leTestCase{uint(math.MaxUint32), true, false, ""},
-
-		leTestCase{uint8(0), true, false, ""},
-		leTestCase{uint8(255), true, false, ""},
-
-		leTestCase{uint16(0), true, false, ""},
-		leTestCase{uint16(65535), true, false, ""},
-
-		leTestCase{uint32(0), true, false, ""},
-		leTestCase{uint32(math.MaxUint32), true, false, ""},
-
-		leTestCase{uint64(0), true, false, ""},
-		leTestCase{uint64(kTwoTo54 - 1), true, false, ""},
-		leTestCase{uint64(kTwoTo54 + 0), true, false, ""},
-		leTestCase{uint64(kTwoTo54 + 1), true, false, ""},
-		leTestCase{uint64(kTwoTo54 + 2), false, false, ""},
-
-		// Floating point.
-		leTestCase{float64(-1), true, false, ""},
-		leTestCase{float64(kTwoTo54 - 2), true, false, ""},
-		leTestCase{float64(kTwoTo54 - 1), true, false, ""},
-		leTestCase{float64(kTwoTo54 + 0), true, false, ""},
-		leTestCase{float64(kTwoTo54 + 1), true, false, ""},
-		leTestCase{float64(kTwoTo54 + 2), true, false, ""},
-		leTestCase{float64(kTwoTo54 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessOrEqualTest) Float32AboveExactIntegerRange() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := LessOrEqual(float32(kTwoTo25 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "less than or equal to 3.3554432e+07"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []leTestCase{
-		// Signed integers.
-		leTestCase{int64(-1), true, false, ""},
-		leTestCase{int64(kTwoTo25 - 2), true, false, ""},
-		leTestCase{int64(kTwoTo25 - 1), true, false, ""},
-		leTestCase{int64(kTwoTo25 + 0), true, false, ""},
-		leTestCase{int64(kTwoTo25 + 1), true, false, ""},
-		leTestCase{int64(kTwoTo25 + 2), true, false, ""},
-		leTestCase{int64(kTwoTo25 + 3), false, false, ""},
-
-		// Unsigned integers.
-		leTestCase{uint64(0), true, false, ""},
-		leTestCase{uint64(kTwoTo25 - 2), true, false, ""},
-		leTestCase{uint64(kTwoTo25 - 1), true, false, ""},
-		leTestCase{uint64(kTwoTo25 + 0), true, false, ""},
-		leTestCase{uint64(kTwoTo25 + 1), true, false, ""},
-		leTestCase{uint64(kTwoTo25 + 2), true, false, ""},
-		leTestCase{uint64(kTwoTo25 + 3), false, false, ""},
-
-		// Floating point.
-		leTestCase{float32(-1), true, false, ""},
-		leTestCase{float32(kTwoTo25 - 2), true, false, ""},
-		leTestCase{float32(kTwoTo25 - 1), true, false, ""},
-		leTestCase{float32(kTwoTo25 + 0), true, false, ""},
-		leTestCase{float32(kTwoTo25 + 1), true, false, ""},
-		leTestCase{float32(kTwoTo25 + 2), true, false, ""},
-		leTestCase{float32(kTwoTo25 + 3), false, false, ""},
-
-		leTestCase{float64(-1), true, false, ""},
-		leTestCase{float64(kTwoTo25 - 2), true, false, ""},
-		leTestCase{float64(kTwoTo25 - 1), true, false, ""},
-		leTestCase{float64(kTwoTo25 + 0), true, false, ""},
-		leTestCase{float64(kTwoTo25 + 1), true, false, ""},
-		leTestCase{float64(kTwoTo25 + 2), true, false, ""},
-		leTestCase{float64(kTwoTo25 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessOrEqualTest) Float64AboveExactIntegerRange() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := LessOrEqual(float64(kTwoTo54 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "less than or equal to 1.8014398509481984e+16"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []leTestCase{
-		// Signed integers.
-		leTestCase{int64(-1), true, false, ""},
-		leTestCase{int64(kTwoTo54 - 2), true, false, ""},
-		leTestCase{int64(kTwoTo54 - 1), true, false, ""},
-		leTestCase{int64(kTwoTo54 + 0), true, false, ""},
-		leTestCase{int64(kTwoTo54 + 1), true, false, ""},
-		leTestCase{int64(kTwoTo54 + 2), true, false, ""},
-		leTestCase{int64(kTwoTo54 + 3), false, false, ""},
-
-		// Unsigned integers.
-		leTestCase{uint64(0), true, false, ""},
-		leTestCase{uint64(kTwoTo54 - 2), true, false, ""},
-		leTestCase{uint64(kTwoTo54 - 1), true, false, ""},
-		leTestCase{uint64(kTwoTo54 + 0), true, false, ""},
-		leTestCase{uint64(kTwoTo54 + 1), true, false, ""},
-		leTestCase{uint64(kTwoTo54 + 2), true, false, ""},
-		leTestCase{uint64(kTwoTo54 + 3), false, false, ""},
-
-		// Floating point.
-		leTestCase{float64(-1), true, false, ""},
-		leTestCase{float64(kTwoTo54 - 2), true, false, ""},
-		leTestCase{float64(kTwoTo54 - 1), true, false, ""},
-		leTestCase{float64(kTwoTo54 + 0), true, false, ""},
-		leTestCase{float64(kTwoTo54 + 1), true, false, ""},
-		leTestCase{float64(kTwoTo54 + 2), true, false, ""},
-		leTestCase{float64(kTwoTo54 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// String literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *LessOrEqualTest) EmptyString() {
-	matcher := LessOrEqual("")
-	desc := matcher.Description()
-	expectedDesc := "less than or equal to \"\""
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []leTestCase{
-		leTestCase{"", true, false, ""},
-		leTestCase{"\x00", false, false, ""},
-		leTestCase{"a", false, false, ""},
-		leTestCase{"foo", false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessOrEqualTest) SingleNullByte() {
-	matcher := LessOrEqual("\x00")
-	desc := matcher.Description()
-	expectedDesc := "less than or equal to \"\x00\""
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []leTestCase{
-		leTestCase{"", true, false, ""},
-		leTestCase{"\x00", true, false, ""},
-		leTestCase{"\x00\x00", false, false, ""},
-		leTestCase{"a", false, false, ""},
-		leTestCase{"foo", false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessOrEqualTest) LongerString() {
-	matcher := LessOrEqual("foo\x00")
-	desc := matcher.Description()
-	expectedDesc := "less than or equal to \"foo\x00\""
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []leTestCase{
-		leTestCase{"", true, false, ""},
-		leTestCase{"\x00", true, false, ""},
-		leTestCase{"bar", true, false, ""},
-		leTestCase{"foo", true, false, ""},
-		leTestCase{"foo\x00", true, false, ""},
-		leTestCase{"foo\x00\x00", false, false, ""},
-		leTestCase{"fooa", false, false, ""},
-		leTestCase{"qux", false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}

+ 0 - 152
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/less_than.go

@@ -1,152 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"errors"
-	"fmt"
-	"math"
-	"reflect"
-)
-
-// LessThan returns a matcher that matches integer, floating point, or strings
-// values v such that v < x. Comparison is not defined between numeric and
-// string types, but is defined between all integer and floating point types.
-//
-// x must itself be an integer, floating point, or string type; otherwise,
-// LessThan will panic.
-func LessThan(x interface{}) Matcher {
-	v := reflect.ValueOf(x)
-	kind := v.Kind()
-
-	switch {
-	case isInteger(v):
-	case isFloat(v):
-	case kind == reflect.String:
-
-	default:
-		panic(fmt.Sprintf("LessThan: unexpected kind %v", kind))
-	}
-
-	return &lessThanMatcher{v}
-}
-
-type lessThanMatcher struct {
-	limit reflect.Value
-}
-
-func (m *lessThanMatcher) Description() string {
-	// Special case: make it clear that strings are strings.
-	if m.limit.Kind() == reflect.String {
-		return fmt.Sprintf("less than \"%s\"", m.limit.String())
-	}
-
-	return fmt.Sprintf("less than %v", m.limit.Interface())
-}
-
-func compareIntegers(v1, v2 reflect.Value) (err error) {
-	err = errors.New("")
-
-	switch {
-	case isSignedInteger(v1) && isSignedInteger(v2):
-		if v1.Int() < v2.Int() {
-			err = nil
-		}
-		return
-
-	case isSignedInteger(v1) && isUnsignedInteger(v2):
-		if v1.Int() < 0 || uint64(v1.Int()) < v2.Uint() {
-			err = nil
-		}
-		return
-
-	case isUnsignedInteger(v1) && isSignedInteger(v2):
-		if v1.Uint() <= math.MaxInt64 && int64(v1.Uint()) < v2.Int() {
-			err = nil
-		}
-		return
-
-	case isUnsignedInteger(v1) && isUnsignedInteger(v2):
-		if v1.Uint() < v2.Uint() {
-			err = nil
-		}
-		return
-	}
-
-	panic(fmt.Sprintf("compareIntegers: %v %v", v1, v2))
-}
-
-func getFloat(v reflect.Value) float64 {
-	switch {
-	case isSignedInteger(v):
-		return float64(v.Int())
-
-	case isUnsignedInteger(v):
-		return float64(v.Uint())
-
-	case isFloat(v):
-		return v.Float()
-	}
-
-	panic(fmt.Sprintf("getFloat: %v", v))
-}
-
-func (m *lessThanMatcher) Matches(c interface{}) (err error) {
-	v1 := reflect.ValueOf(c)
-	v2 := m.limit
-
-	err = errors.New("")
-
-	// Handle strings as a special case.
-	if v1.Kind() == reflect.String && v2.Kind() == reflect.String {
-		if v1.String() < v2.String() {
-			err = nil
-		}
-		return
-	}
-
-	// If we get here, we require that we are dealing with integers or floats.
-	v1Legal := isInteger(v1) || isFloat(v1)
-	v2Legal := isInteger(v2) || isFloat(v2)
-	if !v1Legal || !v2Legal {
-		err = NewFatalError("which is not comparable")
-		return
-	}
-
-	// Handle the various comparison cases.
-	switch {
-	// Both integers
-	case isInteger(v1) && isInteger(v2):
-		return compareIntegers(v1, v2)
-
-	// At least one float32
-	case v1.Kind() == reflect.Float32 || v2.Kind() == reflect.Float32:
-		if float32(getFloat(v1)) < float32(getFloat(v2)) {
-			err = nil
-		}
-		return
-
-	// At least one float64
-	case v1.Kind() == reflect.Float64 || v2.Kind() == reflect.Float64:
-		if getFloat(v1) < getFloat(v2) {
-			err = nil
-		}
-		return
-	}
-
-	// We shouldn't get here.
-	panic(fmt.Sprintf("lessThanMatcher.Matches: Shouldn't get here: %v %v", v1, v2))
-}

+ 0 - 1059
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/less_than_test.go

@@ -1,1059 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	"math"
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type LessThanTest struct {
-}
-
-func init() { RegisterTestSuite(&LessThanTest{}) }
-
-type ltTestCase struct {
-	candidate      interface{}
-	expectedResult bool
-	shouldBeFatal  bool
-	expectedError  string
-}
-
-func (t *LessThanTest) checkTestCases(matcher Matcher, cases []ltTestCase) {
-	for i, c := range cases {
-		err := matcher.Matches(c.candidate)
-
-		ExpectThat(
-			(err == nil),
-			Equals(c.expectedResult),
-			"Case %d (candidate %v)",
-			i,
-			c.candidate)
-
-		if err == nil {
-			continue
-		}
-
-		_, isFatal := err.(*FatalError)
-		ExpectEq(
-			c.shouldBeFatal,
-			isFatal,
-			"Case %d (candidate %v)",
-			i,
-			c.candidate)
-
-		ExpectThat(
-			err,
-			Error(Equals(c.expectedError)),
-			"Case %d (candidate %v)",
-			i,
-			c.candidate)
-	}
-}
-
-////////////////////////////////////////////////////////////////////////
-// Integer literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *LessThanTest) IntegerCandidateBadTypes() {
-	matcher := LessThan(int(-150))
-
-	cases := []ltTestCase{
-		ltTestCase{true, false, true, "which is not comparable"},
-		ltTestCase{uintptr(17), false, true, "which is not comparable"},
-		ltTestCase{complex64(-151), false, true, "which is not comparable"},
-		ltTestCase{complex128(-151), false, true, "which is not comparable"},
-		ltTestCase{[...]int{-151}, false, true, "which is not comparable"},
-		ltTestCase{make(chan int), false, true, "which is not comparable"},
-		ltTestCase{func() {}, false, true, "which is not comparable"},
-		ltTestCase{map[int]int{}, false, true, "which is not comparable"},
-		ltTestCase{&ltTestCase{}, false, true, "which is not comparable"},
-		ltTestCase{make([]int, 0), false, true, "which is not comparable"},
-		ltTestCase{"-151", false, true, "which is not comparable"},
-		ltTestCase{ltTestCase{}, false, true, "which is not comparable"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessThanTest) FloatCandidateBadTypes() {
-	matcher := LessThan(float32(-150))
-
-	cases := []ltTestCase{
-		ltTestCase{true, false, true, "which is not comparable"},
-		ltTestCase{uintptr(17), false, true, "which is not comparable"},
-		ltTestCase{complex64(-151), false, true, "which is not comparable"},
-		ltTestCase{complex128(-151), false, true, "which is not comparable"},
-		ltTestCase{[...]int{-151}, false, true, "which is not comparable"},
-		ltTestCase{make(chan int), false, true, "which is not comparable"},
-		ltTestCase{func() {}, false, true, "which is not comparable"},
-		ltTestCase{map[int]int{}, false, true, "which is not comparable"},
-		ltTestCase{&ltTestCase{}, false, true, "which is not comparable"},
-		ltTestCase{make([]int, 0), false, true, "which is not comparable"},
-		ltTestCase{"-151", false, true, "which is not comparable"},
-		ltTestCase{ltTestCase{}, false, true, "which is not comparable"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessThanTest) StringCandidateBadTypes() {
-	matcher := LessThan("17")
-
-	cases := []ltTestCase{
-		ltTestCase{true, false, true, "which is not comparable"},
-		ltTestCase{int(0), false, true, "which is not comparable"},
-		ltTestCase{int8(0), false, true, "which is not comparable"},
-		ltTestCase{int16(0), false, true, "which is not comparable"},
-		ltTestCase{int32(0), false, true, "which is not comparable"},
-		ltTestCase{int64(0), false, true, "which is not comparable"},
-		ltTestCase{uint(0), false, true, "which is not comparable"},
-		ltTestCase{uint8(0), false, true, "which is not comparable"},
-		ltTestCase{uint16(0), false, true, "which is not comparable"},
-		ltTestCase{uint32(0), false, true, "which is not comparable"},
-		ltTestCase{uint64(0), false, true, "which is not comparable"},
-		ltTestCase{uintptr(17), false, true, "which is not comparable"},
-		ltTestCase{float32(0), false, true, "which is not comparable"},
-		ltTestCase{float64(0), false, true, "which is not comparable"},
-		ltTestCase{complex64(-151), false, true, "which is not comparable"},
-		ltTestCase{complex128(-151), false, true, "which is not comparable"},
-		ltTestCase{[...]int{-151}, false, true, "which is not comparable"},
-		ltTestCase{make(chan int), false, true, "which is not comparable"},
-		ltTestCase{func() {}, false, true, "which is not comparable"},
-		ltTestCase{map[int]int{}, false, true, "which is not comparable"},
-		ltTestCase{&ltTestCase{}, false, true, "which is not comparable"},
-		ltTestCase{make([]int, 0), false, true, "which is not comparable"},
-		ltTestCase{ltTestCase{}, false, true, "which is not comparable"},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessThanTest) BadArgument() {
-	panicked := false
-
-	defer func() {
-		ExpectThat(panicked, Equals(true))
-	}()
-
-	defer func() {
-		if r := recover(); r != nil {
-			panicked = true
-		}
-	}()
-
-	LessThan(complex128(0))
-}
-
-////////////////////////////////////////////////////////////////////////
-// Integer literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *LessThanTest) NegativeIntegerLiteral() {
-	matcher := LessThan(-150)
-	desc := matcher.Description()
-	expectedDesc := "less than -150"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []ltTestCase{
-		// Signed integers.
-		ltTestCase{-(1 << 30), true, false, ""},
-		ltTestCase{-151, true, false, ""},
-		ltTestCase{-150, false, false, ""},
-		ltTestCase{0, false, false, ""},
-		ltTestCase{17, false, false, ""},
-
-		ltTestCase{int(-(1 << 30)), true, false, ""},
-		ltTestCase{int(-151), true, false, ""},
-		ltTestCase{int(-150), false, false, ""},
-		ltTestCase{int(0), false, false, ""},
-		ltTestCase{int(17), false, false, ""},
-
-		ltTestCase{int8(-127), false, false, ""},
-		ltTestCase{int8(0), false, false, ""},
-		ltTestCase{int8(17), false, false, ""},
-
-		ltTestCase{int16(-(1 << 14)), true, false, ""},
-		ltTestCase{int16(-151), true, false, ""},
-		ltTestCase{int16(-150), false, false, ""},
-		ltTestCase{int16(0), false, false, ""},
-		ltTestCase{int16(17), false, false, ""},
-
-		ltTestCase{int32(-(1 << 30)), true, false, ""},
-		ltTestCase{int32(-151), true, false, ""},
-		ltTestCase{int32(-150), false, false, ""},
-		ltTestCase{int32(0), false, false, ""},
-		ltTestCase{int32(17), false, false, ""},
-
-		ltTestCase{int64(-(1 << 30)), true, false, ""},
-		ltTestCase{int64(-151), true, false, ""},
-		ltTestCase{int64(-150), false, false, ""},
-		ltTestCase{int64(0), false, false, ""},
-		ltTestCase{int64(17), false, false, ""},
-
-		// Unsigned integers.
-		ltTestCase{uint((1 << 32) - 151), false, false, ""},
-		ltTestCase{uint(0), false, false, ""},
-		ltTestCase{uint(17), false, false, ""},
-
-		ltTestCase{uint8(0), false, false, ""},
-		ltTestCase{uint8(17), false, false, ""},
-		ltTestCase{uint8(253), false, false, ""},
-
-		ltTestCase{uint16((1 << 16) - 151), false, false, ""},
-		ltTestCase{uint16(0), false, false, ""},
-		ltTestCase{uint16(17), false, false, ""},
-
-		ltTestCase{uint32((1 << 32) - 151), false, false, ""},
-		ltTestCase{uint32(0), false, false, ""},
-		ltTestCase{uint32(17), false, false, ""},
-
-		ltTestCase{uint64((1 << 64) - 151), false, false, ""},
-		ltTestCase{uint64(0), false, false, ""},
-		ltTestCase{uint64(17), false, false, ""},
-
-		// Floating point.
-		ltTestCase{float32(-(1 << 30)), true, false, ""},
-		ltTestCase{float32(-151), true, false, ""},
-		ltTestCase{float32(-150.1), true, false, ""},
-		ltTestCase{float32(-150), false, false, ""},
-		ltTestCase{float32(-149.9), false, false, ""},
-		ltTestCase{float32(0), false, false, ""},
-		ltTestCase{float32(17), false, false, ""},
-		ltTestCase{float32(160), false, false, ""},
-
-		ltTestCase{float64(-(1 << 30)), true, false, ""},
-		ltTestCase{float64(-151), true, false, ""},
-		ltTestCase{float64(-150.1), true, false, ""},
-		ltTestCase{float64(-150), false, false, ""},
-		ltTestCase{float64(-149.9), false, false, ""},
-		ltTestCase{float64(0), false, false, ""},
-		ltTestCase{float64(17), false, false, ""},
-		ltTestCase{float64(160), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessThanTest) ZeroIntegerLiteral() {
-	matcher := LessThan(0)
-	desc := matcher.Description()
-	expectedDesc := "less than 0"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []ltTestCase{
-		// Signed integers.
-		ltTestCase{-(1 << 30), true, false, ""},
-		ltTestCase{-1, true, false, ""},
-		ltTestCase{0, false, false, ""},
-		ltTestCase{1, false, false, ""},
-		ltTestCase{17, false, false, ""},
-		ltTestCase{(1 << 30), false, false, ""},
-
-		ltTestCase{int(-(1 << 30)), true, false, ""},
-		ltTestCase{int(-1), true, false, ""},
-		ltTestCase{int(0), false, false, ""},
-		ltTestCase{int(1), false, false, ""},
-		ltTestCase{int(17), false, false, ""},
-
-		ltTestCase{int8(-1), true, false, ""},
-		ltTestCase{int8(0), false, false, ""},
-		ltTestCase{int8(1), false, false, ""},
-
-		ltTestCase{int16(-(1 << 14)), true, false, ""},
-		ltTestCase{int16(-1), true, false, ""},
-		ltTestCase{int16(0), false, false, ""},
-		ltTestCase{int16(1), false, false, ""},
-		ltTestCase{int16(17), false, false, ""},
-
-		ltTestCase{int32(-(1 << 30)), true, false, ""},
-		ltTestCase{int32(-1), true, false, ""},
-		ltTestCase{int32(0), false, false, ""},
-		ltTestCase{int32(1), false, false, ""},
-		ltTestCase{int32(17), false, false, ""},
-
-		ltTestCase{int64(-(1 << 30)), true, false, ""},
-		ltTestCase{int64(-1), true, false, ""},
-		ltTestCase{int64(0), false, false, ""},
-		ltTestCase{int64(1), false, false, ""},
-		ltTestCase{int64(17), false, false, ""},
-
-		// Unsigned integers.
-		ltTestCase{uint((1 << 32) - 1), false, false, ""},
-		ltTestCase{uint(0), false, false, ""},
-		ltTestCase{uint(17), false, false, ""},
-
-		ltTestCase{uint8(0), false, false, ""},
-		ltTestCase{uint8(17), false, false, ""},
-		ltTestCase{uint8(253), false, false, ""},
-
-		ltTestCase{uint16((1 << 16) - 1), false, false, ""},
-		ltTestCase{uint16(0), false, false, ""},
-		ltTestCase{uint16(17), false, false, ""},
-
-		ltTestCase{uint32((1 << 32) - 1), false, false, ""},
-		ltTestCase{uint32(0), false, false, ""},
-		ltTestCase{uint32(17), false, false, ""},
-
-		ltTestCase{uint64((1 << 64) - 1), false, false, ""},
-		ltTestCase{uint64(0), false, false, ""},
-		ltTestCase{uint64(17), false, false, ""},
-
-		// Floating point.
-		ltTestCase{float32(-(1 << 30)), true, false, ""},
-		ltTestCase{float32(-1), true, false, ""},
-		ltTestCase{float32(-0.1), true, false, ""},
-		ltTestCase{float32(-0.0), false, false, ""},
-		ltTestCase{float32(0), false, false, ""},
-		ltTestCase{float32(0.1), false, false, ""},
-		ltTestCase{float32(17), false, false, ""},
-		ltTestCase{float32(160), false, false, ""},
-
-		ltTestCase{float64(-(1 << 30)), true, false, ""},
-		ltTestCase{float64(-1), true, false, ""},
-		ltTestCase{float64(-0.1), true, false, ""},
-		ltTestCase{float64(-0), false, false, ""},
-		ltTestCase{float64(0), false, false, ""},
-		ltTestCase{float64(17), false, false, ""},
-		ltTestCase{float64(160), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessThanTest) PositiveIntegerLiteral() {
-	matcher := LessThan(150)
-	desc := matcher.Description()
-	expectedDesc := "less than 150"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []ltTestCase{
-		// Signed integers.
-		ltTestCase{-1, true, false, ""},
-		ltTestCase{149, true, false, ""},
-		ltTestCase{150, false, false, ""},
-		ltTestCase{151, false, false, ""},
-
-		ltTestCase{int(-1), true, false, ""},
-		ltTestCase{int(149), true, false, ""},
-		ltTestCase{int(150), false, false, ""},
-		ltTestCase{int(151), false, false, ""},
-
-		ltTestCase{int8(-1), true, false, ""},
-		ltTestCase{int8(0), true, false, ""},
-		ltTestCase{int8(17), true, false, ""},
-		ltTestCase{int8(127), true, false, ""},
-
-		ltTestCase{int16(-1), true, false, ""},
-		ltTestCase{int16(149), true, false, ""},
-		ltTestCase{int16(150), false, false, ""},
-		ltTestCase{int16(151), false, false, ""},
-
-		ltTestCase{int32(-1), true, false, ""},
-		ltTestCase{int32(149), true, false, ""},
-		ltTestCase{int32(150), false, false, ""},
-		ltTestCase{int32(151), false, false, ""},
-
-		ltTestCase{int64(-1), true, false, ""},
-		ltTestCase{int64(149), true, false, ""},
-		ltTestCase{int64(150), false, false, ""},
-		ltTestCase{int64(151), false, false, ""},
-
-		// Unsigned integers.
-		ltTestCase{uint(0), true, false, ""},
-		ltTestCase{uint(149), true, false, ""},
-		ltTestCase{uint(150), false, false, ""},
-		ltTestCase{uint(151), false, false, ""},
-
-		ltTestCase{uint8(0), true, false, ""},
-		ltTestCase{uint8(127), true, false, ""},
-
-		ltTestCase{uint16(0), true, false, ""},
-		ltTestCase{uint16(149), true, false, ""},
-		ltTestCase{uint16(150), false, false, ""},
-		ltTestCase{uint16(151), false, false, ""},
-
-		ltTestCase{uint32(0), true, false, ""},
-		ltTestCase{uint32(149), true, false, ""},
-		ltTestCase{uint32(150), false, false, ""},
-		ltTestCase{uint32(151), false, false, ""},
-
-		ltTestCase{uint64(0), true, false, ""},
-		ltTestCase{uint64(149), true, false, ""},
-		ltTestCase{uint64(150), false, false, ""},
-		ltTestCase{uint64(151), false, false, ""},
-
-		// Floating point.
-		ltTestCase{float32(-1), true, false, ""},
-		ltTestCase{float32(149), true, false, ""},
-		ltTestCase{float32(149.9), true, false, ""},
-		ltTestCase{float32(150), false, false, ""},
-		ltTestCase{float32(150.1), false, false, ""},
-		ltTestCase{float32(151), false, false, ""},
-
-		ltTestCase{float64(-1), true, false, ""},
-		ltTestCase{float64(149), true, false, ""},
-		ltTestCase{float64(149.9), true, false, ""},
-		ltTestCase{float64(150), false, false, ""},
-		ltTestCase{float64(150.1), false, false, ""},
-		ltTestCase{float64(151), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// Float literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *LessThanTest) NegativeFloatLiteral() {
-	matcher := LessThan(-150.1)
-	desc := matcher.Description()
-	expectedDesc := "less than -150.1"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []ltTestCase{
-		// Signed integers.
-		ltTestCase{-(1 << 30), true, false, ""},
-		ltTestCase{-151, true, false, ""},
-		ltTestCase{-150, false, false, ""},
-		ltTestCase{0, false, false, ""},
-		ltTestCase{17, false, false, ""},
-
-		ltTestCase{int(-(1 << 30)), true, false, ""},
-		ltTestCase{int(-151), true, false, ""},
-		ltTestCase{int(-150), false, false, ""},
-		ltTestCase{int(0), false, false, ""},
-		ltTestCase{int(17), false, false, ""},
-
-		ltTestCase{int8(-127), false, false, ""},
-		ltTestCase{int8(0), false, false, ""},
-		ltTestCase{int8(17), false, false, ""},
-
-		ltTestCase{int16(-(1 << 14)), true, false, ""},
-		ltTestCase{int16(-151), true, false, ""},
-		ltTestCase{int16(-150), false, false, ""},
-		ltTestCase{int16(0), false, false, ""},
-		ltTestCase{int16(17), false, false, ""},
-
-		ltTestCase{int32(-(1 << 30)), true, false, ""},
-		ltTestCase{int32(-151), true, false, ""},
-		ltTestCase{int32(-150), false, false, ""},
-		ltTestCase{int32(0), false, false, ""},
-		ltTestCase{int32(17), false, false, ""},
-
-		ltTestCase{int64(-(1 << 30)), true, false, ""},
-		ltTestCase{int64(-151), true, false, ""},
-		ltTestCase{int64(-150), false, false, ""},
-		ltTestCase{int64(0), false, false, ""},
-		ltTestCase{int64(17), false, false, ""},
-
-		// Unsigned integers.
-		ltTestCase{uint((1 << 32) - 151), false, false, ""},
-		ltTestCase{uint(0), false, false, ""},
-		ltTestCase{uint(17), false, false, ""},
-
-		ltTestCase{uint8(0), false, false, ""},
-		ltTestCase{uint8(17), false, false, ""},
-		ltTestCase{uint8(253), false, false, ""},
-
-		ltTestCase{uint16((1 << 16) - 151), false, false, ""},
-		ltTestCase{uint16(0), false, false, ""},
-		ltTestCase{uint16(17), false, false, ""},
-
-		ltTestCase{uint32((1 << 32) - 151), false, false, ""},
-		ltTestCase{uint32(0), false, false, ""},
-		ltTestCase{uint32(17), false, false, ""},
-
-		ltTestCase{uint64((1 << 64) - 151), false, false, ""},
-		ltTestCase{uint64(0), false, false, ""},
-		ltTestCase{uint64(17), false, false, ""},
-
-		// Floating point.
-		ltTestCase{float32(-(1 << 30)), true, false, ""},
-		ltTestCase{float32(-151), true, false, ""},
-		ltTestCase{float32(-150.2), true, false, ""},
-		ltTestCase{float32(-150.1), false, false, ""},
-		ltTestCase{float32(-150), false, false, ""},
-		ltTestCase{float32(0), false, false, ""},
-		ltTestCase{float32(17), false, false, ""},
-		ltTestCase{float32(160), false, false, ""},
-
-		ltTestCase{float64(-(1 << 30)), true, false, ""},
-		ltTestCase{float64(-151), true, false, ""},
-		ltTestCase{float64(-150.2), true, false, ""},
-		ltTestCase{float64(-150.1), false, false, ""},
-		ltTestCase{float64(-150), false, false, ""},
-		ltTestCase{float64(0), false, false, ""},
-		ltTestCase{float64(17), false, false, ""},
-		ltTestCase{float64(160), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessThanTest) PositiveFloatLiteral() {
-	matcher := LessThan(149.9)
-	desc := matcher.Description()
-	expectedDesc := "less than 149.9"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []ltTestCase{
-		// Signed integers.
-		ltTestCase{-1, true, false, ""},
-		ltTestCase{149, true, false, ""},
-		ltTestCase{150, false, false, ""},
-		ltTestCase{151, false, false, ""},
-
-		ltTestCase{int(-1), true, false, ""},
-		ltTestCase{int(149), true, false, ""},
-		ltTestCase{int(150), false, false, ""},
-		ltTestCase{int(151), false, false, ""},
-
-		ltTestCase{int8(-1), true, false, ""},
-		ltTestCase{int8(0), true, false, ""},
-		ltTestCase{int8(17), true, false, ""},
-		ltTestCase{int8(127), true, false, ""},
-
-		ltTestCase{int16(-1), true, false, ""},
-		ltTestCase{int16(149), true, false, ""},
-		ltTestCase{int16(150), false, false, ""},
-		ltTestCase{int16(151), false, false, ""},
-
-		ltTestCase{int32(-1), true, false, ""},
-		ltTestCase{int32(149), true, false, ""},
-		ltTestCase{int32(150), false, false, ""},
-		ltTestCase{int32(151), false, false, ""},
-
-		ltTestCase{int64(-1), true, false, ""},
-		ltTestCase{int64(149), true, false, ""},
-		ltTestCase{int64(150), false, false, ""},
-		ltTestCase{int64(151), false, false, ""},
-
-		// Unsigned integers.
-		ltTestCase{uint(0), true, false, ""},
-		ltTestCase{uint(149), true, false, ""},
-		ltTestCase{uint(150), false, false, ""},
-		ltTestCase{uint(151), false, false, ""},
-
-		ltTestCase{uint8(0), true, false, ""},
-		ltTestCase{uint8(127), true, false, ""},
-
-		ltTestCase{uint16(0), true, false, ""},
-		ltTestCase{uint16(149), true, false, ""},
-		ltTestCase{uint16(150), false, false, ""},
-		ltTestCase{uint16(151), false, false, ""},
-
-		ltTestCase{uint32(0), true, false, ""},
-		ltTestCase{uint32(149), true, false, ""},
-		ltTestCase{uint32(150), false, false, ""},
-		ltTestCase{uint32(151), false, false, ""},
-
-		ltTestCase{uint64(0), true, false, ""},
-		ltTestCase{uint64(149), true, false, ""},
-		ltTestCase{uint64(150), false, false, ""},
-		ltTestCase{uint64(151), false, false, ""},
-
-		// Floating point.
-		ltTestCase{float32(-1), true, false, ""},
-		ltTestCase{float32(149), true, false, ""},
-		ltTestCase{float32(149.8), true, false, ""},
-		ltTestCase{float32(149.9), false, false, ""},
-		ltTestCase{float32(150), false, false, ""},
-		ltTestCase{float32(151), false, false, ""},
-
-		ltTestCase{float64(-1), true, false, ""},
-		ltTestCase{float64(149), true, false, ""},
-		ltTestCase{float64(149.8), true, false, ""},
-		ltTestCase{float64(149.9), false, false, ""},
-		ltTestCase{float64(150), false, false, ""},
-		ltTestCase{float64(151), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// Subtle cases
-////////////////////////////////////////////////////////////////////////
-
-func (t *LessThanTest) Int64NotExactlyRepresentableBySinglePrecision() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := LessThan(int64(kTwoTo25 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "less than 33554433"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []ltTestCase{
-		// Signed integers.
-		ltTestCase{-1, true, false, ""},
-		ltTestCase{kTwoTo25 + 0, true, false, ""},
-		ltTestCase{kTwoTo25 + 1, false, false, ""},
-		ltTestCase{kTwoTo25 + 2, false, false, ""},
-
-		ltTestCase{int(-1), true, false, ""},
-		ltTestCase{int(kTwoTo25 + 0), true, false, ""},
-		ltTestCase{int(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{int(kTwoTo25 + 2), false, false, ""},
-
-		ltTestCase{int8(-1), true, false, ""},
-		ltTestCase{int8(127), true, false, ""},
-
-		ltTestCase{int16(-1), true, false, ""},
-		ltTestCase{int16(0), true, false, ""},
-		ltTestCase{int16(32767), true, false, ""},
-
-		ltTestCase{int32(-1), true, false, ""},
-		ltTestCase{int32(kTwoTo25 + 0), true, false, ""},
-		ltTestCase{int32(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{int32(kTwoTo25 + 2), false, false, ""},
-
-		ltTestCase{int64(-1), true, false, ""},
-		ltTestCase{int64(kTwoTo25 + 0), true, false, ""},
-		ltTestCase{int64(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{int64(kTwoTo25 + 2), false, false, ""},
-
-		// Unsigned integers.
-		ltTestCase{uint(0), true, false, ""},
-		ltTestCase{uint(kTwoTo25 + 0), true, false, ""},
-		ltTestCase{uint(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{uint(kTwoTo25 + 2), false, false, ""},
-
-		ltTestCase{uint8(0), true, false, ""},
-		ltTestCase{uint8(255), true, false, ""},
-
-		ltTestCase{uint16(0), true, false, ""},
-		ltTestCase{uint16(65535), true, false, ""},
-
-		ltTestCase{uint32(0), true, false, ""},
-		ltTestCase{uint32(kTwoTo25 + 0), true, false, ""},
-		ltTestCase{uint32(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{uint32(kTwoTo25 + 2), false, false, ""},
-
-		ltTestCase{uint64(0), true, false, ""},
-		ltTestCase{uint64(kTwoTo25 + 0), true, false, ""},
-		ltTestCase{uint64(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{uint64(kTwoTo25 + 2), false, false, ""},
-
-		// Floating point.
-		ltTestCase{float32(-1), true, false, ""},
-		ltTestCase{float32(kTwoTo25 - 2), true, false, ""},
-		ltTestCase{float32(kTwoTo25 - 1), false, false, ""},
-		ltTestCase{float32(kTwoTo25 + 0), false, false, ""},
-		ltTestCase{float32(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{float32(kTwoTo25 + 2), false, false, ""},
-		ltTestCase{float32(kTwoTo25 + 3), false, false, ""},
-
-		ltTestCase{float64(-1), true, false, ""},
-		ltTestCase{float64(kTwoTo25 - 2), true, false, ""},
-		ltTestCase{float64(kTwoTo25 - 1), true, false, ""},
-		ltTestCase{float64(kTwoTo25 + 0), true, false, ""},
-		ltTestCase{float64(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{float64(kTwoTo25 + 2), false, false, ""},
-		ltTestCase{float64(kTwoTo25 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessThanTest) Int64NotExactlyRepresentableByDoublePrecision() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := LessThan(int64(kTwoTo54 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "less than 18014398509481985"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []ltTestCase{
-		// Signed integers.
-		ltTestCase{-1, true, false, ""},
-		ltTestCase{1 << 30, true, false, ""},
-
-		ltTestCase{int(-1), true, false, ""},
-		ltTestCase{int(math.MaxInt32), true, false, ""},
-
-		ltTestCase{int8(-1), true, false, ""},
-		ltTestCase{int8(127), true, false, ""},
-
-		ltTestCase{int16(-1), true, false, ""},
-		ltTestCase{int16(0), true, false, ""},
-		ltTestCase{int16(32767), true, false, ""},
-
-		ltTestCase{int32(-1), true, false, ""},
-		ltTestCase{int32(math.MaxInt32), true, false, ""},
-
-		ltTestCase{int64(-1), true, false, ""},
-		ltTestCase{int64(kTwoTo54 - 1), true, false, ""},
-		ltTestCase{int64(kTwoTo54 + 0), true, false, ""},
-		ltTestCase{int64(kTwoTo54 + 1), false, false, ""},
-		ltTestCase{int64(kTwoTo54 + 2), false, false, ""},
-
-		// Unsigned integers.
-		ltTestCase{uint(0), true, false, ""},
-		ltTestCase{uint(math.MaxUint32), true, false, ""},
-
-		ltTestCase{uint8(0), true, false, ""},
-		ltTestCase{uint8(255), true, false, ""},
-
-		ltTestCase{uint16(0), true, false, ""},
-		ltTestCase{uint16(65535), true, false, ""},
-
-		ltTestCase{uint32(0), true, false, ""},
-		ltTestCase{uint32(math.MaxUint32), true, false, ""},
-
-		ltTestCase{uint64(0), true, false, ""},
-		ltTestCase{uint64(kTwoTo54 - 1), true, false, ""},
-		ltTestCase{uint64(kTwoTo54 + 0), true, false, ""},
-		ltTestCase{uint64(kTwoTo54 + 1), false, false, ""},
-		ltTestCase{uint64(kTwoTo54 + 2), false, false, ""},
-
-		// Floating point.
-		ltTestCase{float64(-1), true, false, ""},
-		ltTestCase{float64(kTwoTo54 - 2), true, false, ""},
-		ltTestCase{float64(kTwoTo54 - 1), false, false, ""},
-		ltTestCase{float64(kTwoTo54 + 0), false, false, ""},
-		ltTestCase{float64(kTwoTo54 + 1), false, false, ""},
-		ltTestCase{float64(kTwoTo54 + 2), false, false, ""},
-		ltTestCase{float64(kTwoTo54 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessThanTest) Uint64NotExactlyRepresentableBySinglePrecision() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := LessThan(uint64(kTwoTo25 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "less than 33554433"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []ltTestCase{
-		// Signed integers.
-		ltTestCase{-1, true, false, ""},
-		ltTestCase{kTwoTo25 + 0, true, false, ""},
-		ltTestCase{kTwoTo25 + 1, false, false, ""},
-		ltTestCase{kTwoTo25 + 2, false, false, ""},
-
-		ltTestCase{int(-1), true, false, ""},
-		ltTestCase{int(kTwoTo25 + 0), true, false, ""},
-		ltTestCase{int(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{int(kTwoTo25 + 2), false, false, ""},
-
-		ltTestCase{int8(-1), true, false, ""},
-		ltTestCase{int8(127), true, false, ""},
-
-		ltTestCase{int16(-1), true, false, ""},
-		ltTestCase{int16(0), true, false, ""},
-		ltTestCase{int16(32767), true, false, ""},
-
-		ltTestCase{int32(-1), true, false, ""},
-		ltTestCase{int32(kTwoTo25 + 0), true, false, ""},
-		ltTestCase{int32(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{int32(kTwoTo25 + 2), false, false, ""},
-
-		ltTestCase{int64(-1), true, false, ""},
-		ltTestCase{int64(kTwoTo25 + 0), true, false, ""},
-		ltTestCase{int64(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{int64(kTwoTo25 + 2), false, false, ""},
-
-		// Unsigned integers.
-		ltTestCase{uint(0), true, false, ""},
-		ltTestCase{uint(kTwoTo25 + 0), true, false, ""},
-		ltTestCase{uint(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{uint(kTwoTo25 + 2), false, false, ""},
-
-		ltTestCase{uint8(0), true, false, ""},
-		ltTestCase{uint8(255), true, false, ""},
-
-		ltTestCase{uint16(0), true, false, ""},
-		ltTestCase{uint16(65535), true, false, ""},
-
-		ltTestCase{uint32(0), true, false, ""},
-		ltTestCase{uint32(kTwoTo25 + 0), true, false, ""},
-		ltTestCase{uint32(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{uint32(kTwoTo25 + 2), false, false, ""},
-
-		ltTestCase{uint64(0), true, false, ""},
-		ltTestCase{uint64(kTwoTo25 + 0), true, false, ""},
-		ltTestCase{uint64(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{uint64(kTwoTo25 + 2), false, false, ""},
-
-		// Floating point.
-		ltTestCase{float32(-1), true, false, ""},
-		ltTestCase{float32(kTwoTo25 - 2), true, false, ""},
-		ltTestCase{float32(kTwoTo25 - 1), false, false, ""},
-		ltTestCase{float32(kTwoTo25 + 0), false, false, ""},
-		ltTestCase{float32(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{float32(kTwoTo25 + 2), false, false, ""},
-		ltTestCase{float32(kTwoTo25 + 3), false, false, ""},
-
-		ltTestCase{float64(-1), true, false, ""},
-		ltTestCase{float64(kTwoTo25 - 2), true, false, ""},
-		ltTestCase{float64(kTwoTo25 - 1), true, false, ""},
-		ltTestCase{float64(kTwoTo25 + 0), true, false, ""},
-		ltTestCase{float64(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{float64(kTwoTo25 + 2), false, false, ""},
-		ltTestCase{float64(kTwoTo25 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessThanTest) Uint64NotExactlyRepresentableByDoublePrecision() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := LessThan(uint64(kTwoTo54 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "less than 18014398509481985"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []ltTestCase{
-		// Signed integers.
-		ltTestCase{-1, true, false, ""},
-		ltTestCase{1 << 30, true, false, ""},
-
-		ltTestCase{int(-1), true, false, ""},
-		ltTestCase{int(math.MaxInt32), true, false, ""},
-
-		ltTestCase{int8(-1), true, false, ""},
-		ltTestCase{int8(127), true, false, ""},
-
-		ltTestCase{int16(-1), true, false, ""},
-		ltTestCase{int16(0), true, false, ""},
-		ltTestCase{int16(32767), true, false, ""},
-
-		ltTestCase{int32(-1), true, false, ""},
-		ltTestCase{int32(math.MaxInt32), true, false, ""},
-
-		ltTestCase{int64(-1), true, false, ""},
-		ltTestCase{int64(kTwoTo54 - 1), true, false, ""},
-		ltTestCase{int64(kTwoTo54 + 0), true, false, ""},
-		ltTestCase{int64(kTwoTo54 + 1), false, false, ""},
-		ltTestCase{int64(kTwoTo54 + 2), false, false, ""},
-
-		// Unsigned integers.
-		ltTestCase{uint(0), true, false, ""},
-		ltTestCase{uint(math.MaxUint32), true, false, ""},
-
-		ltTestCase{uint8(0), true, false, ""},
-		ltTestCase{uint8(255), true, false, ""},
-
-		ltTestCase{uint16(0), true, false, ""},
-		ltTestCase{uint16(65535), true, false, ""},
-
-		ltTestCase{uint32(0), true, false, ""},
-		ltTestCase{uint32(math.MaxUint32), true, false, ""},
-
-		ltTestCase{uint64(0), true, false, ""},
-		ltTestCase{uint64(kTwoTo54 - 1), true, false, ""},
-		ltTestCase{uint64(kTwoTo54 + 0), true, false, ""},
-		ltTestCase{uint64(kTwoTo54 + 1), false, false, ""},
-		ltTestCase{uint64(kTwoTo54 + 2), false, false, ""},
-
-		// Floating point.
-		ltTestCase{float64(-1), true, false, ""},
-		ltTestCase{float64(kTwoTo54 - 2), true, false, ""},
-		ltTestCase{float64(kTwoTo54 - 1), false, false, ""},
-		ltTestCase{float64(kTwoTo54 + 0), false, false, ""},
-		ltTestCase{float64(kTwoTo54 + 1), false, false, ""},
-		ltTestCase{float64(kTwoTo54 + 2), false, false, ""},
-		ltTestCase{float64(kTwoTo54 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessThanTest) Float32AboveExactIntegerRange() {
-	// Single-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^25-1, 2^25+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo25 = 1 << 25
-	matcher := LessThan(float32(kTwoTo25 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "less than 3.3554432e+07"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []ltTestCase{
-		// Signed integers.
-		ltTestCase{int64(-1), true, false, ""},
-		ltTestCase{int64(kTwoTo25 - 2), true, false, ""},
-		ltTestCase{int64(kTwoTo25 - 1), false, false, ""},
-		ltTestCase{int64(kTwoTo25 + 0), false, false, ""},
-		ltTestCase{int64(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{int64(kTwoTo25 + 2), false, false, ""},
-		ltTestCase{int64(kTwoTo25 + 3), false, false, ""},
-
-		// Unsigned integers.
-		ltTestCase{uint64(0), true, false, ""},
-		ltTestCase{uint64(kTwoTo25 - 2), true, false, ""},
-		ltTestCase{uint64(kTwoTo25 - 1), false, false, ""},
-		ltTestCase{uint64(kTwoTo25 + 0), false, false, ""},
-		ltTestCase{uint64(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{uint64(kTwoTo25 + 2), false, false, ""},
-		ltTestCase{uint64(kTwoTo25 + 3), false, false, ""},
-
-		// Floating point.
-		ltTestCase{float32(-1), true, false, ""},
-		ltTestCase{float32(kTwoTo25 - 2), true, false, ""},
-		ltTestCase{float32(kTwoTo25 - 1), false, false, ""},
-		ltTestCase{float32(kTwoTo25 + 0), false, false, ""},
-		ltTestCase{float32(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{float32(kTwoTo25 + 2), false, false, ""},
-		ltTestCase{float32(kTwoTo25 + 3), false, false, ""},
-
-		ltTestCase{float64(-1), true, false, ""},
-		ltTestCase{float64(kTwoTo25 - 2), true, false, ""},
-		ltTestCase{float64(kTwoTo25 - 1), false, false, ""},
-		ltTestCase{float64(kTwoTo25 + 0), false, false, ""},
-		ltTestCase{float64(kTwoTo25 + 1), false, false, ""},
-		ltTestCase{float64(kTwoTo25 + 2), false, false, ""},
-		ltTestCase{float64(kTwoTo25 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessThanTest) Float64AboveExactIntegerRange() {
-	// Double-precision floats don't have enough bits to represent the integers
-	// near this one distinctly, so [2^54-1, 2^54+2] all receive the same value
-	// and should be treated as equivalent when floats are in the mix.
-	const kTwoTo54 = 1 << 54
-	matcher := LessThan(float64(kTwoTo54 + 1))
-
-	desc := matcher.Description()
-	expectedDesc := "less than 1.8014398509481984e+16"
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []ltTestCase{
-		// Signed integers.
-		ltTestCase{int64(-1), true, false, ""},
-		ltTestCase{int64(kTwoTo54 - 2), true, false, ""},
-		ltTestCase{int64(kTwoTo54 - 1), false, false, ""},
-		ltTestCase{int64(kTwoTo54 + 0), false, false, ""},
-		ltTestCase{int64(kTwoTo54 + 1), false, false, ""},
-		ltTestCase{int64(kTwoTo54 + 2), false, false, ""},
-		ltTestCase{int64(kTwoTo54 + 3), false, false, ""},
-
-		// Unsigned integers.
-		ltTestCase{uint64(0), true, false, ""},
-		ltTestCase{uint64(kTwoTo54 - 2), true, false, ""},
-		ltTestCase{uint64(kTwoTo54 - 1), false, false, ""},
-		ltTestCase{uint64(kTwoTo54 + 0), false, false, ""},
-		ltTestCase{uint64(kTwoTo54 + 1), false, false, ""},
-		ltTestCase{uint64(kTwoTo54 + 2), false, false, ""},
-		ltTestCase{uint64(kTwoTo54 + 3), false, false, ""},
-
-		// Floating point.
-		ltTestCase{float64(-1), true, false, ""},
-		ltTestCase{float64(kTwoTo54 - 2), true, false, ""},
-		ltTestCase{float64(kTwoTo54 - 1), false, false, ""},
-		ltTestCase{float64(kTwoTo54 + 0), false, false, ""},
-		ltTestCase{float64(kTwoTo54 + 1), false, false, ""},
-		ltTestCase{float64(kTwoTo54 + 2), false, false, ""},
-		ltTestCase{float64(kTwoTo54 + 3), false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-////////////////////////////////////////////////////////////////////////
-// String literals
-////////////////////////////////////////////////////////////////////////
-
-func (t *LessThanTest) EmptyString() {
-	matcher := LessThan("")
-	desc := matcher.Description()
-	expectedDesc := "less than \"\""
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []ltTestCase{
-		ltTestCase{"", false, false, ""},
-		ltTestCase{"\x00", false, false, ""},
-		ltTestCase{"a", false, false, ""},
-		ltTestCase{"foo", false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessThanTest) SingleNullByte() {
-	matcher := LessThan("\x00")
-	desc := matcher.Description()
-	expectedDesc := "less than \"\x00\""
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []ltTestCase{
-		ltTestCase{"", true, false, ""},
-		ltTestCase{"\x00", false, false, ""},
-		ltTestCase{"a", false, false, ""},
-		ltTestCase{"foo", false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}
-
-func (t *LessThanTest) LongerString() {
-	matcher := LessThan("foo\x00")
-	desc := matcher.Description()
-	expectedDesc := "less than \"foo\x00\""
-
-	ExpectThat(desc, Equals(expectedDesc))
-
-	cases := []ltTestCase{
-		ltTestCase{"", true, false, ""},
-		ltTestCase{"\x00", true, false, ""},
-		ltTestCase{"bar", true, false, ""},
-		ltTestCase{"foo", true, false, ""},
-		ltTestCase{"foo\x00", false, false, ""},
-		ltTestCase{"fooa", false, false, ""},
-		ltTestCase{"qux", false, false, ""},
-	}
-
-	t.checkTestCases(matcher, cases)
-}

+ 0 - 82
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/matcher.go

@@ -1,82 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Package oglematchers provides a set of matchers useful in a testing or
-// mocking framework. These matchers are inspired by and mostly compatible with
-// Google Test for C++ and Google JS Test.
-//
-// This package is used by github.com/smartystreets/goconvey/convey/assertions/ogletest and
-// github.com/smartystreets/goconvey/convey/assertions/oglemock, which may be more directly useful if you're not
-// writing your own testing package or defining your own matchers.
-package oglematchers
-
-// A Matcher is some predicate implicitly defining a set of values that it
-// matches. For example, GreaterThan(17) matches all numeric values greater
-// than 17, and HasSubstr("taco") matches all strings with the substring
-// "taco".
-type Matcher interface {
-	// Check whether the supplied value belongs to the the set defined by the
-	// matcher. Return a non-nil error if and only if it does not.
-	//
-	// The error describes why the value doesn't match. The error text is a
-	// relative clause that is suitable for being placed after the value. For
-	// example, a predicate that matches strings with a particular substring may,
-	// when presented with a numerical value, return the following error text:
-	//
-	//     "which is not a string"
-	//
-	// Then the failure message may look like:
-	//
-	//     Expected: has substring "taco"
-	//     Actual:   17, which is not a string
-	//
-	// If the error is self-apparent based on the description of the matcher, the
-	// error text may be empty (but the error still non-nil). For example:
-	//
-	//     Expected: 17
-	//     Actual:   19
-	//
-	// If you are implementing a new matcher, see also the documentation on
-	// FatalError.
-	Matches(candidate interface{}) error
-
-	// Description returns a string describing the property that values matching
-	// this matcher have, as a verb phrase where the subject is the value. For
-	// example, "is greather than 17" or "has substring "taco"".
-	Description() string
-}
-
-// FatalError is an implementation of the error interface that may be returned
-// from matchers, indicating the error should be propagated. Returning a
-// *FatalError indicates that the matcher doesn't process values of the
-// supplied type, or otherwise doesn't know how to handle the value.
-//
-// For example, if GreaterThan(17) returned false for the value "taco" without
-// a fatal error, then Not(GreaterThan(17)) would return true. This is
-// technically correct, but is surprising and may mask failures where the wrong
-// sort of matcher is accidentally used. Instead, GreaterThan(17) can return a
-// fatal error, which will be propagated by Not().
-type FatalError struct {
-	errorText string
-}
-
-// NewFatalError creates a FatalError struct with the supplied error text.
-func NewFatalError(s string) *FatalError {
-	return &FatalError{s}
-}
-
-func (e *FatalError) Error() string {
-	return e.errorText
-}

+ 0 - 69
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/matches_regexp.go

@@ -1,69 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"errors"
-	"fmt"
-	"reflect"
-	"regexp"
-)
-
-// MatchesRegexp returns a matcher that matches strings and byte slices whose
-// contents match the supplide regular expression. The semantics are those of
-// regexp.Match. In particular, that means the match is not implicitly anchored
-// to the ends of the string: MatchesRegexp("bar") will match "foo bar baz".
-func MatchesRegexp(pattern string) Matcher {
-	re, err := regexp.Compile(pattern)
-	if err != nil {
-		panic("MatchesRegexp: " + err.Error())
-	}
-
-	return &matchesRegexpMatcher{re}
-}
-
-type matchesRegexpMatcher struct {
-	re *regexp.Regexp
-}
-
-func (m *matchesRegexpMatcher) Description() string {
-	return fmt.Sprintf("matches regexp \"%s\"", m.re.String())
-}
-
-func (m *matchesRegexpMatcher) Matches(c interface{}) (err error) {
-	v := reflect.ValueOf(c)
-	isString := v.Kind() == reflect.String
-	isByteSlice := v.Kind() == reflect.Slice && v.Elem().Kind() == reflect.Uint8
-
-	err = errors.New("")
-
-	switch {
-	case isString:
-		if m.re.MatchString(v.String()) {
-			err = nil
-		}
-
-	case isByteSlice:
-		if m.re.Match(v.Bytes()) {
-			err = nil
-		}
-
-	default:
-		err = NewFatalError("which is not a string or []byte")
-	}
-
-	return
-}

+ 0 - 92
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/matches_regexp_test.go

@@ -1,92 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type MatchesRegexpTest struct {
-}
-
-func init() { RegisterTestSuite(&MatchesRegexpTest{}) }
-
-////////////////////////////////////////////////////////////////////////
-// Tests
-////////////////////////////////////////////////////////////////////////
-
-func (t *MatchesRegexpTest) Description() {
-	m := MatchesRegexp("foo.*bar")
-	ExpectEq("matches regexp \"foo.*bar\"", m.Description())
-}
-
-func (t *MatchesRegexpTest) InvalidRegexp() {
-	ExpectThat(
-		func() { MatchesRegexp("(foo") },
-		Panics(HasSubstr("missing closing )")))
-}
-
-func (t *MatchesRegexpTest) CandidateIsNil() {
-	m := MatchesRegexp("")
-	err := m.Matches(nil)
-
-	ExpectThat(err, Error(Equals("which is not a string or []byte")))
-	ExpectTrue(isFatal(err))
-}
-
-func (t *MatchesRegexpTest) CandidateIsInteger() {
-	m := MatchesRegexp("")
-	err := m.Matches(17)
-
-	ExpectThat(err, Error(Equals("which is not a string or []byte")))
-	ExpectTrue(isFatal(err))
-}
-
-func (t *MatchesRegexpTest) NonMatchingCandidates() {
-	m := MatchesRegexp("fo[op]\\s+x")
-	var err error
-
-	err = m.Matches("fon x")
-	ExpectThat(err, Error(Equals("")))
-	ExpectFalse(isFatal(err))
-
-	err = m.Matches("fopx")
-	ExpectThat(err, Error(Equals("")))
-	ExpectFalse(isFatal(err))
-
-	err = m.Matches("fop   ")
-	ExpectThat(err, Error(Equals("")))
-	ExpectFalse(isFatal(err))
-}
-
-func (t *MatchesRegexpTest) MatchingCandidates() {
-	m := MatchesRegexp("fo[op]\\s+x")
-	var err error
-
-	err = m.Matches("foo x")
-	ExpectEq(nil, err)
-
-	err = m.Matches("fop     x")
-	ExpectEq(nil, err)
-
-	err = m.Matches("blah blah foo x blah blah")
-	ExpectEq(nil, err)
-}

+ 0 - 53
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/not.go

@@ -1,53 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"errors"
-	"fmt"
-)
-
-// Not returns a matcher that inverts the set of values matched by the wrapped
-// matcher. It does not transform the result for values for which the wrapped
-// matcher returns a fatal error.
-func Not(m Matcher) Matcher {
-	return &notMatcher{m}
-}
-
-type notMatcher struct {
-	wrapped Matcher
-}
-
-func (m *notMatcher) Matches(c interface{}) (err error) {
-	err = m.wrapped.Matches(c)
-
-	// Did the wrapped matcher say yes?
-	if err == nil {
-		return errors.New("")
-	}
-
-	// Did the wrapped matcher return a fatal error?
-	if _, isFatal := err.(*FatalError); isFatal {
-		return err
-	}
-
-	// The wrapped matcher returned a non-fatal error.
-	return nil
-}
-
-func (m *notMatcher) Description() string {
-	return fmt.Sprintf("not(%s)", m.wrapped.Description())
-}

+ 0 - 107
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/not_test.go

@@ -1,107 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	"errors"
-	"testing"
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type fakeMatcher struct {
-	matchFunc   func(interface{}) error
-	description string
-}
-
-func (m *fakeMatcher) Matches(c interface{}) error {
-	return m.matchFunc(c)
-}
-
-func (m *fakeMatcher) Description() string {
-	return m.description
-}
-
-type NotTest struct {
-}
-
-func init()                     { RegisterTestSuite(&NotTest{}) }
-func TestOgletest(t *testing.T) { RunTests(t) }
-
-////////////////////////////////////////////////////////////////////////
-// Tests
-////////////////////////////////////////////////////////////////////////
-
-func (t *NotTest) CallsWrapped() {
-	var suppliedCandidate interface{}
-	matchFunc := func(c interface{}) error {
-		suppliedCandidate = c
-		return nil
-	}
-
-	wrapped := &fakeMatcher{matchFunc, ""}
-	matcher := Not(wrapped)
-
-	matcher.Matches(17)
-	ExpectThat(suppliedCandidate, Equals(17))
-}
-
-func (t *NotTest) WrappedReturnsTrue() {
-	matchFunc := func(c interface{}) error {
-		return nil
-	}
-
-	wrapped := &fakeMatcher{matchFunc, ""}
-	matcher := Not(wrapped)
-
-	err := matcher.Matches(0)
-	ExpectThat(err, Error(Equals("")))
-}
-
-func (t *NotTest) WrappedReturnsNonFatalError() {
-	matchFunc := func(c interface{}) error {
-		return errors.New("taco")
-	}
-
-	wrapped := &fakeMatcher{matchFunc, ""}
-	matcher := Not(wrapped)
-
-	err := matcher.Matches(0)
-	ExpectEq(nil, err)
-}
-
-func (t *NotTest) WrappedReturnsFatalError() {
-	matchFunc := func(c interface{}) error {
-		return NewFatalError("taco")
-	}
-
-	wrapped := &fakeMatcher{matchFunc, ""}
-	matcher := Not(wrapped)
-
-	err := matcher.Matches(0)
-	ExpectThat(err, Error(Equals("taco")))
-}
-
-func (t *NotTest) Description() {
-	wrapped := &fakeMatcher{nil, "taco"}
-	matcher := Not(wrapped)
-
-	ExpectEq("not(taco)", matcher.Description())
-}

+ 0 - 2
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/oglematchers.goconvey

@@ -1,2 +0,0 @@
-#ignore
--timeout=1s

+ 0 - 74
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/panics.go

@@ -1,74 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"errors"
-	"fmt"
-	"reflect"
-)
-
-// Panics matches zero-arg functions which, when invoked, panic with an error
-// that matches the supplied matcher.
-//
-// NOTE(jacobsa): This matcher cannot detect the case where the function panics
-// using panic(nil), by design of the language. See here for more info:
-//
-//     http://goo.gl/9aIQL
-//
-func Panics(m Matcher) Matcher {
-	return &panicsMatcher{m}
-}
-
-type panicsMatcher struct {
-	wrappedMatcher Matcher
-}
-
-func (m *panicsMatcher) Description() string {
-	return "panics with: " + m.wrappedMatcher.Description()
-}
-
-func (m *panicsMatcher) Matches(c interface{}) (err error) {
-	// Make sure c is a zero-arg function.
-	v := reflect.ValueOf(c)
-	if v.Kind() != reflect.Func || v.Type().NumIn() != 0 {
-		err = NewFatalError("which is not a zero-arg function")
-		return
-	}
-
-	// Call the function and check its panic error.
-	defer func() {
-		if e := recover(); e != nil {
-			err = m.wrappedMatcher.Matches(e)
-
-			// Set a clearer error message if the matcher said no.
-			if err != nil {
-				wrappedClause := ""
-				if err.Error() != "" {
-					wrappedClause = ", " + err.Error()
-				}
-
-				err = errors.New(fmt.Sprintf("which panicked with: %v%s", e, wrappedClause))
-			}
-		}
-	}()
-
-	v.Call([]reflect.Value{})
-
-	// If we get here, the function didn't panic.
-	err = errors.New("which didn't panic")
-	return
-}

+ 0 - 141
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/panics_test.go

@@ -1,141 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	"errors"
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type PanicsTest struct {
-	matcherCalled     bool
-	suppliedCandidate interface{}
-	wrappedError      error
-
-	matcher Matcher
-}
-
-func init() { RegisterTestSuite(&PanicsTest{}) }
-
-func (t *PanicsTest) SetUp(i *TestInfo) {
-	wrapped := &fakeMatcher{
-		func(c interface{}) error {
-			t.matcherCalled = true
-			t.suppliedCandidate = c
-			return t.wrappedError
-		},
-		"foo",
-	}
-
-	t.matcher = Panics(wrapped)
-}
-
-////////////////////////////////////////////////////////////////////////
-// Tests
-////////////////////////////////////////////////////////////////////////
-
-func (t *PanicsTest) Description() {
-	ExpectThat(t.matcher.Description(), Equals("panics with: foo"))
-}
-
-func (t *PanicsTest) CandidateIsNil() {
-	err := t.matcher.Matches(nil)
-
-	ExpectThat(err, Error(Equals("which is not a zero-arg function")))
-	ExpectTrue(isFatal(err))
-}
-
-func (t *PanicsTest) CandidateIsString() {
-	err := t.matcher.Matches("taco")
-
-	ExpectThat(err, Error(Equals("which is not a zero-arg function")))
-	ExpectTrue(isFatal(err))
-}
-
-func (t *PanicsTest) CandidateTakesArgs() {
-	err := t.matcher.Matches(func(i int) string { return "" })
-
-	ExpectThat(err, Error(Equals("which is not a zero-arg function")))
-	ExpectTrue(isFatal(err))
-}
-
-func (t *PanicsTest) CallsFunction() {
-	callCount := 0
-	t.matcher.Matches(func() string {
-		callCount++
-		return ""
-	})
-
-	ExpectThat(callCount, Equals(1))
-}
-
-func (t *PanicsTest) FunctionDoesntPanic() {
-	err := t.matcher.Matches(func() {})
-
-	ExpectThat(err, Error(Equals("which didn't panic")))
-	ExpectFalse(isFatal(err))
-}
-
-func (t *PanicsTest) CallsWrappedMatcher() {
-	expectedErr := 17
-	t.wrappedError = errors.New("")
-	t.matcher.Matches(func() { panic(expectedErr) })
-
-	ExpectThat(t.suppliedCandidate, Equals(expectedErr))
-}
-
-func (t *PanicsTest) WrappedReturnsTrue() {
-	err := t.matcher.Matches(func() { panic("") })
-
-	ExpectEq(nil, err)
-}
-
-func (t *PanicsTest) WrappedReturnsFatalErrorWithoutText() {
-	t.wrappedError = NewFatalError("")
-	err := t.matcher.Matches(func() { panic(17) })
-
-	ExpectThat(err, Error(Equals("which panicked with: 17")))
-	ExpectFalse(isFatal(err))
-}
-
-func (t *PanicsTest) WrappedReturnsFatalErrorWithText() {
-	t.wrappedError = NewFatalError("which blah")
-	err := t.matcher.Matches(func() { panic(17) })
-
-	ExpectThat(err, Error(Equals("which panicked with: 17, which blah")))
-	ExpectFalse(isFatal(err))
-}
-
-func (t *PanicsTest) WrappedReturnsNonFatalErrorWithoutText() {
-	t.wrappedError = errors.New("")
-	err := t.matcher.Matches(func() { panic(17) })
-
-	ExpectThat(err, Error(Equals("which panicked with: 17")))
-	ExpectFalse(isFatal(err))
-}
-
-func (t *PanicsTest) WrappedReturnsNonFatalErrorWithText() {
-	t.wrappedError = errors.New("which blah")
-	err := t.matcher.Matches(func() { panic(17) })
-
-	ExpectThat(err, Error(Equals("which panicked with: 17, which blah")))
-	ExpectFalse(isFatal(err))
-}

+ 0 - 65
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/pointee.go

@@ -1,65 +0,0 @@
-// Copyright 2012 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-import (
-	"errors"
-	"fmt"
-	"reflect"
-)
-
-// Return a matcher that matches non-nil pointers whose pointee matches the
-// wrapped matcher.
-func Pointee(m Matcher) Matcher {
-	return &pointeeMatcher{m}
-}
-
-type pointeeMatcher struct {
-	wrapped Matcher
-}
-
-func (m *pointeeMatcher) Matches(c interface{}) (err error) {
-	// Make sure the candidate is of the appropriate type.
-	cv := reflect.ValueOf(c)
-	if !cv.IsValid() || cv.Kind() != reflect.Ptr {
-		return NewFatalError("which is not a pointer")
-	}
-
-	// Make sure the candidate is non-nil.
-	if cv.IsNil() {
-		return NewFatalError("")
-	}
-
-	// Defer to the wrapped matcher. Fix up empty errors so that failure messages
-	// are more helpful than just printing a pointer for "Actual".
-	pointee := cv.Elem().Interface()
-	err = m.wrapped.Matches(pointee)
-	if err != nil && err.Error() == "" {
-		s := fmt.Sprintf("whose pointee is %v", pointee)
-
-		if _, ok := err.(*FatalError); ok {
-			err = NewFatalError(s)
-		} else {
-			err = errors.New(s)
-		}
-	}
-
-	return err
-}
-
-func (m *pointeeMatcher) Description() string {
-	return fmt.Sprintf("pointee(%s)", m.wrapped.Description())
-}

+ 0 - 153
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/pointee_test.go

@@ -1,153 +0,0 @@
-// Copyright 2012 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers_test
-
-import (
-	"errors"
-	"testing"
-	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
-	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
-)
-
-////////////////////////////////////////////////////////////////////////
-// Helpers
-////////////////////////////////////////////////////////////////////////
-
-type PointeeTest struct{}
-
-func init() { RegisterTestSuite(&PointeeTest{}) }
-
-func TestPointee(t *testing.T) { RunTests(t) }
-
-////////////////////////////////////////////////////////////////////////
-// Tests
-////////////////////////////////////////////////////////////////////////
-
-func (t *PointeeTest) Description() {
-	wrapped := &fakeMatcher{nil, "taco"}
-	matcher := Pointee(wrapped)
-
-	ExpectEq("pointee(taco)", matcher.Description())
-}
-
-func (t *PointeeTest) CandidateIsNotAPointer() {
-	matcher := Pointee(HasSubstr(""))
-	err := matcher.Matches([]byte{})
-
-	ExpectThat(err, Error(Equals("which is not a pointer")))
-	ExpectTrue(isFatal(err))
-}
-
-func (t *PointeeTest) CandidateIsANilLiteral() {
-	matcher := Pointee(HasSubstr(""))
-	err := matcher.Matches(nil)
-
-	ExpectThat(err, Error(Equals("which is not a pointer")))
-	ExpectTrue(isFatal(err))
-}
-
-func (t *PointeeTest) CandidateIsANilPointer() {
-	matcher := Pointee(HasSubstr(""))
-	err := matcher.Matches((*int)(nil))
-
-	ExpectThat(err, Error(Equals("")))
-	ExpectTrue(isFatal(err))
-}
-
-func (t *PointeeTest) CallsWrapped() {
-	var suppliedCandidate interface{}
-	matchFunc := func(c interface{}) error {
-		suppliedCandidate = c
-		return nil
-	}
-
-	wrapped := &fakeMatcher{matchFunc, ""}
-	matcher := Pointee(wrapped)
-
-	someSlice := []byte{}
-	matcher.Matches(&someSlice)
-	ExpectThat(suppliedCandidate, IdenticalTo(someSlice))
-}
-
-func (t *PointeeTest) WrappedReturnsOkay() {
-	matchFunc := func(c interface{}) error {
-		return nil
-	}
-
-	wrapped := &fakeMatcher{matchFunc, ""}
-	matcher := Pointee(wrapped)
-
-	err := matcher.Matches(new(int))
-	ExpectEq(nil, err)
-}
-
-func (t *PointeeTest) WrappedReturnsNonFatalNonEmptyError() {
-	matchFunc := func(c interface{}) error {
-		return errors.New("taco")
-	}
-
-	wrapped := &fakeMatcher{matchFunc, ""}
-	matcher := Pointee(wrapped)
-
-	i := 17
-	err := matcher.Matches(&i)
-	ExpectFalse(isFatal(err))
-	ExpectThat(err, Error(Equals("taco")))
-}
-
-func (t *PointeeTest) WrappedReturnsNonFatalEmptyError() {
-	matchFunc := func(c interface{}) error {
-		return errors.New("")
-	}
-
-	wrapped := &fakeMatcher{matchFunc, ""}
-	matcher := Pointee(wrapped)
-
-	i := 17
-	err := matcher.Matches(&i)
-	ExpectFalse(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("whose pointee")))
-	ExpectThat(err, Error(HasSubstr("17")))
-}
-
-func (t *PointeeTest) WrappedReturnsFatalNonEmptyError() {
-	matchFunc := func(c interface{}) error {
-		return NewFatalError("taco")
-	}
-
-	wrapped := &fakeMatcher{matchFunc, ""}
-	matcher := Pointee(wrapped)
-
-	i := 17
-	err := matcher.Matches(&i)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(Equals("taco")))
-}
-
-func (t *PointeeTest) WrappedReturnsFatalEmptyError() {
-	matchFunc := func(c interface{}) error {
-		return NewFatalError("")
-	}
-
-	wrapped := &fakeMatcher{matchFunc, ""}
-	matcher := Pointee(wrapped)
-
-	i := 17
-	err := matcher.Matches(&i)
-	ExpectTrue(isFatal(err))
-	ExpectThat(err, Error(HasSubstr("whose pointee")))
-	ExpectThat(err, Error(HasSubstr("17")))
-}

+ 0 - 36
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers/transform_description.go

@@ -1,36 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglematchers
-
-// transformDescription returns a matcher that is equivalent to the supplied
-// one, except that it has the supplied description instead of the one attached
-// to the existing matcher.
-func transformDescription(m Matcher, newDesc string) Matcher {
-	return &transformDescriptionMatcher{newDesc, m}
-}
-
-type transformDescriptionMatcher struct {
-	desc string
-	wrappedMatcher Matcher
-}
-
-func (m *transformDescriptionMatcher) Description() string {
-	return m.desc
-}
-
-func (m *transformDescriptionMatcher) Matches(c interface{}) error {
-	return m.wrappedMatcher.Matches(c)
-}

+ 0 - 5
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/.gitignore

@@ -1,5 +0,0 @@
-*.6
-6.out
-_obj/
-_test/
-_testmain.go

+ 0 - 202
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/LICENSE

@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.

+ 0 - 101
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/README.markdown

@@ -1,101 +0,0 @@
-`oglemock` is a mocking framework for the Go programming language with the
-following features:
-
- *  An extensive and extensible set of matchers for expressing call
-    expectations (provided by the [oglematchers][] package).
-
- *  Clean, readable output that tells you exactly what you need to know.
-
- *  Style and semantics similar to [Google Mock][googlemock] and
-    [Google JS Test][google-js-test].
-
- *  Seamless integration with the [ogletest][] unit testing framework.
-
-It can be integrated into any testing framework (including Go's `testing`
-package), but out of the box support is built in to [ogletest][] and that is the
-easiest place to use it.
-
-
-Installation
-------------
-
-First, make sure you have installed Go 1.0.2 or newer. See
-[here][golang-install] for instructions.
-
-Use the following command to install `oglemock` and its dependencies, and to
-keep them up to date:
-
-    go get -u github.com/smartystreets/goconvey/convey/assertions/oglemock
-    go get -u github.com/smartystreets/goconvey/convey/assertions/oglemock/createmock
-
-Those commands will install the `oglemock` package itself, along with the
-`createmock` tool that is used to auto-generate mock types.
-
-
-Generating and using mock types
--------------------------------
-
-Automatically generating a mock implementation of an interface is easy. If you
-want to mock interfaces `Bar` and `Baz` from package `foo`, simply run the
-following:
-
-    createmock foo Bar Baz
-
-That will print source code that can be saved to a file and used in your tests.
-For example, to create a `mock_io` package containing mock implementations of
-`io.Reader` and `io.Writer`:
-
-    mkdir mock_io
-    createmock io Reader Writer > mock_io/mock_io.go
-
-The new package will be named `mock_io`, and contain types called `MockReader`
-and `MockWriter`, which implement `io.Reader` and `io.Writer` respectively.
-
-For each generated mock type, there is a corresponding function for creating an
-instance of that type given a `Controller` object (see below). For example, to
-create a mock reader:
-
-```go
-someController := [...]  // See next section.
-someReader := mock_io.NewMockReader(someController, "Mock file reader")
-```
-
-The snippet above creates a mock `io.Reader` that reports failures to
-`someController`. The reader can subsequently have expectations set up and be
-passed to your code under test that uses an `io.Reader`.
-
-
-Getting ahold of a controller
------------------------------
-
-[oglemock.Controller][controller-ref] is used to create mock objects, and to set
-up and verify expectations for them. You can create one by calling
-`NewController` with an `ErrorReporter`, which is the basic type used to
-interface between `oglemock` and the testing framework within which it is being
-used.
-
-If you are using [ogletest][] you don't need to worry about any of this, since
-the `TestInfo` struct provided to your test's `SetUp` function already contains
-a working `Controller` that you can use to create mock object, and you can use
-the built-in `ExpectCall` function for setting expectations. (See the
-[ogletest documentation][ogletest-docs] for more info.) Otherwise, you will need
-to implement the simple [ErrorReporter interface][reporter-ref] for your test
-environment.
-
-
-Documentation
--------------
-
-For thorough documentation, including information on how to set up expectations,
-see [here][oglemock-docs].
-
-
-[controller-ref]: http://gopkgdoc.appspot.com/pkg/github.com/smartystreets/goconvey/convey/assertions/oglemock#Controller
-[reporter-ref]: http://gopkgdoc.appspot.com/pkg/github.com/smartystreets/goconvey/convey/assertions/oglemock#ErrorReporter
-[golang-install]: http://golang.org/doc/install.html
-[google-js-test]: http://code.google.com/p/google-js-test/
-[googlemock]: http://code.google.com/p/googlemock/
-[oglematchers]: https://github.com/smartystreets/goconvey/convey/assertions/oglematchers
-[oglemock-docs]: http://gopkgdoc.appspot.com/pkg/github.com/smartystreets/goconvey/convey/assertions/oglemock
-[ogletest]: https://github.com/smartystreets/goconvey/convey/assertions/oglematchers
-[ogletest-docs]: http://gopkgdoc.appspot.com/pkg/github.com/smartystreets/goconvey/convey/assertions/ogletest

+ 0 - 36
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/action.go

@@ -1,36 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglemock
-
-import (
-	"reflect"
-)
-
-// Action represents an action to be taken in response to a call to a mock
-// method.
-type Action interface {
-	// Set the signature of the function with which this action is being used.
-	// This must be called before Invoke is called.
-	SetSignature(signature reflect.Type) error
-
-	// Invoke runs the specified action, given the arguments to the mock method.
-	// It returns zero or more values that may be treated as the return values of
-	// the method. If the action doesn't return any values, it may return the nil
-	// slice.
-	//
-	// You must call SetSignature before calling Invoke.
-	Invoke(methodArgs []interface{}) []interface{}
-}

+ 0 - 480
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/controller.go

@@ -1,480 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglemock
-
-import (
-	"errors"
-	"fmt"
-	"log"
-	"math"
-	"reflect"
-	"sync"
-)
-
-// PartialExpecation is a function that should be called exactly once with
-// expected arguments or matchers in order to set up an expected method call.
-// See Controller.ExpectMethodCall below. It returns an expectation that can be
-// further modified (e.g. by calling WillOnce).
-//
-// If the arguments are of the wrong type, the function reports a fatal error
-// and returns nil.
-type PartialExpecation func(...interface{}) Expectation
-
-// Controller represents an object that implements the central logic of
-// oglemock: recording and verifying expectations, responding to mock method
-// calls, and so on.
-type Controller interface {
-	// ExpectCall expresses an expectation that the method of the given name
-	// should be called on the supplied mock object. It returns a function that
-	// should be called with the expected arguments, matchers for the arguments,
-	// or a mix of both.
-	//
-	// fileName and lineNumber should indicate the line on which the expectation
-	// was made, if known.
-	//
-	// For example:
-	//
-	//     mockWriter := [...]
-	//     controller.ExpectCall(mockWriter, "Write", "foo.go", 17)(ElementsAre(0x1))
-	//         .WillOnce(Return(1, nil))
-	//
-	// If the mock object doesn't have a method of the supplied name, the
-	// function reports a fatal error and returns nil.
-	ExpectCall(
-		o MockObject,
-		methodName string,
-		fileName string,
-		lineNumber int) PartialExpecation
-
-	// Finish causes the controller to check for any unsatisfied expectations,
-	// and report them as errors if they exist.
-	//
-	// The controller may panic if any of its methods (including this one) are
-	// called after Finish is called.
-	Finish()
-
-	// HandleMethodCall looks for a registered expectation matching the call of
-	// the given method on mock object o, invokes the appropriate action (if
-	// any), and returns the values returned by that action (if any).
-	//
-	// If the action returns nothing, the controller returns zero values. If
-	// there is no matching expectation, the controller reports an error and
-	// returns zero values.
-	//
-	// If the mock object doesn't have a method of the supplied name, the
-	// arguments are of the wrong type, or the action returns the wrong types,
-	// the function reports a fatal error.
-	//
-	// HandleMethodCall is exported for the sake of mock implementations, and
-	// should not be used directly.
-	HandleMethodCall(
-		o MockObject,
-		methodName string,
-		fileName string,
-		lineNumber int,
-		args []interface{}) []interface{}
-}
-
-// methodMap represents a map from method name to set of expectations for that
-// method.
-type methodMap map[string][]*InternalExpectation
-
-// objectMap represents a map from mock object ID to a methodMap for that object.
-type objectMap map[uintptr]methodMap
-
-// NewController sets up a fresh controller, without any expectations set, and
-// configures the controller to use the supplied error reporter.
-func NewController(reporter ErrorReporter) Controller {
-	return &controllerImpl{reporter, sync.RWMutex{}, objectMap{}}
-}
-
-type controllerImpl struct {
-	reporter ErrorReporter
-
-	mutex                sync.RWMutex
-	expectationsByObject objectMap // Protected by mutex
-}
-
-// Return the list of registered expectations for the named method of the
-// supplied object, or an empty slice if none have been registered. When this
-// method returns, it is guaranteed that c.expectationsByObject has an entry
-// for the object.
-//
-// c.mutex must be held for reading.
-func (c *controllerImpl) getExpectationsLocked(
-	o MockObject,
-	methodName string) []*InternalExpectation {
-	id := o.Oglemock_Id()
-
-	// Look up the mock object.
-	expectationsByMethod, ok := c.expectationsByObject[id]
-	if !ok {
-		expectationsByMethod = methodMap{}
-		c.expectationsByObject[id] = expectationsByMethod
-	}
-
-	result, ok := expectationsByMethod[methodName]
-	if !ok {
-		return []*InternalExpectation{}
-	}
-
-	return result
-}
-
-// Add an expectation to the list registered for the named method of the
-// supplied mock object.
-//
-// c.mutex must be held for writing.
-func (c *controllerImpl) addExpectationLocked(
-	o MockObject,
-	methodName string,
-	exp *InternalExpectation) {
-	// Get the existing list.
-	existing := c.getExpectationsLocked(o, methodName)
-
-	// Store a modified list.
-	id := o.Oglemock_Id()
-	c.expectationsByObject[id][methodName] = append(existing, exp)
-}
-
-func (c *controllerImpl) ExpectCall(
-	o MockObject,
-	methodName string,
-	fileName string,
-	lineNumber int) PartialExpecation {
-	// Find the signature for the requested method.
-	ov := reflect.ValueOf(o)
-	method := ov.MethodByName(methodName)
-	if method.Kind() == reflect.Invalid {
-		c.reporter.ReportFatalError(
-			fileName,
-			lineNumber,
-			errors.New("Unknown method: "+methodName))
-		return nil
-	}
-
-	partialAlreadyCalled := false // Protected by c.mutex
-	return func(args ...interface{}) Expectation {
-		c.mutex.Lock()
-		defer c.mutex.Unlock()
-
-		// This function should only be called once.
-		if partialAlreadyCalled {
-			c.reporter.ReportFatalError(
-				fileName,
-				lineNumber,
-				errors.New("Partial expectation called more than once."))
-			return nil
-		}
-
-		partialAlreadyCalled = true
-
-		// Make sure that the number of args is legal. Keep in mind that the
-		// method's type has an extra receiver arg.
-		if len(args) != method.Type().NumIn() {
-			c.reporter.ReportFatalError(
-				fileName,
-				lineNumber,
-				errors.New(
-					fmt.Sprintf(
-						"Expectation for %s given wrong number of arguments: "+
-							"expected %d, got %d.",
-						methodName,
-						method.Type().NumIn(),
-						len(args))))
-			return nil
-		}
-
-		// Create an expectation and insert it into the controller's map.
-		exp := InternalNewExpectation(
-			c.reporter,
-			method.Type(),
-			args,
-			fileName,
-			lineNumber)
-
-		c.addExpectationLocked(o, methodName, exp)
-
-		// Return the expectation to the user.
-		return exp
-	}
-}
-
-func (c *controllerImpl) Finish() {
-	c.mutex.Lock()
-	defer c.mutex.Unlock()
-
-	// Check whether the minimum cardinality for each registered expectation has
-	// been satisfied.
-	for _, expectationsByMethod := range c.expectationsByObject {
-		for methodName, expectations := range expectationsByMethod {
-			for _, exp := range expectations {
-				exp.mutex.Lock()
-				defer exp.mutex.Unlock()
-
-				minCardinality, _ := computeCardinalityLocked(exp)
-				if exp.NumMatches < minCardinality {
-					c.reporter.ReportError(
-						exp.FileName,
-						exp.LineNumber,
-						errors.New(
-							fmt.Sprintf(
-								"Unsatisfied expectation; expected %s to be called "+
-									"at least %d times; called %d times.",
-								methodName,
-								minCardinality,
-								exp.NumMatches)))
-				}
-			}
-		}
-	}
-}
-
-// expectationMatches checks the matchers for the expectation against the
-// supplied arguments.
-func expectationMatches(exp *InternalExpectation, args []interface{}) bool {
-	matchers := exp.ArgMatchers
-	if len(args) != len(matchers) {
-		panic("expectationMatches: len(args)")
-	}
-
-	// Check each matcher.
-	for i, matcher := range matchers {
-		if err := matcher.Matches(args[i]); err != nil {
-			return false
-		}
-	}
-
-	return true
-}
-
-// Return the expectation that matches the supplied arguments. If there is more
-// than one such expectation, the one furthest along in the list for the method
-// is returned. If there is no such expectation, nil is returned.
-//
-// c.mutex must be held for reading.
-func (c *controllerImpl) chooseExpectationLocked(
-	o MockObject,
-	methodName string,
-	args []interface{}) *InternalExpectation {
-	// Do we have any expectations for this method?
-	expectations := c.getExpectationsLocked(o, methodName)
-	if len(expectations) == 0 {
-		return nil
-	}
-
-	for i := len(expectations) - 1; i >= 0; i-- {
-		if expectationMatches(expectations[i], args) {
-			return expectations[i]
-		}
-	}
-
-	return nil
-}
-
-// makeZeroReturnValues creates a []interface{} containing appropriate zero
-// values for returning from the supplied method type.
-func makeZeroReturnValues(signature reflect.Type) []interface{} {
-	result := make([]interface{}, signature.NumOut())
-
-	for i, _ := range result {
-		outType := signature.Out(i)
-		zeroVal := reflect.Zero(outType)
-		result[i] = zeroVal.Interface()
-	}
-
-	return result
-}
-
-// computeCardinality decides on the [min, max] range of the number of expected
-// matches for the supplied expectations, according to the rules documented in
-// expectation.go.
-//
-// exp.mutex must be held for reading.
-func computeCardinalityLocked(exp *InternalExpectation) (min, max uint) {
-	// Explicit cardinality.
-	if exp.ExpectedNumMatches >= 0 {
-		min = uint(exp.ExpectedNumMatches)
-		max = min
-		return
-	}
-
-	// Implicit count based on one-time actions.
-	if len(exp.OneTimeActions) != 0 {
-		min = uint(len(exp.OneTimeActions))
-		max = min
-
-		// If there is a fallback action, this is only a lower bound.
-		if exp.FallbackAction != nil {
-			max = math.MaxUint32
-		}
-
-		return
-	}
-
-	// Implicit lack of restriction based on a fallback action being configured.
-	if exp.FallbackAction != nil {
-		min = 0
-		max = math.MaxUint32
-		return
-	}
-
-	// Implicit cardinality of one.
-	min = 1
-	max = 1
-	return
-}
-
-// chooseAction returns the action that should be invoked for the i'th match to
-// the supplied expectation (counting from zero). If the implicit "return zero
-// values" action should be used, it returns nil.
-//
-// exp.mutex must be held for reading.
-func chooseActionLocked(i uint, exp *InternalExpectation) Action {
-	// Exhaust one-time actions first.
-	if i < uint(len(exp.OneTimeActions)) {
-		return exp.OneTimeActions[i]
-	}
-
-	// Fallback action (or nil if none is configured).
-	return exp.FallbackAction
-}
-
-// Find an action for the method call, updating expectation match state in the
-// process. Return either an action that should be invoked or a set of zero
-// values to return immediately.
-//
-// This is split out from HandleMethodCall in order to more easily avoid
-// invoking the action with locks held.
-func (c *controllerImpl) chooseActionAndUpdateExpectations(
-	o MockObject,
-	methodName string,
-	fileName string,
-	lineNumber int,
-	args []interface{},
-) (action Action, zeroVals []interface{}) {
-	c.mutex.Lock()
-	defer c.mutex.Unlock()
-
-	// Find the signature for the requested method.
-	ov := reflect.ValueOf(o)
-	method := ov.MethodByName(methodName)
-	if method.Kind() == reflect.Invalid {
-		c.reporter.ReportFatalError(
-			fileName,
-			lineNumber,
-			errors.New("Unknown method: "+methodName),
-		)
-
-		// Should never get here in real code.
-		log.Println("ReportFatalError unexpectedly returned.")
-		return
-	}
-
-	// HACK(jacobsa): Make sure we got the correct number of arguments. This will
-	// need to be refined when issue #5 (variadic methods) is handled.
-	if len(args) != method.Type().NumIn() {
-		c.reporter.ReportFatalError(
-			fileName,
-			lineNumber,
-			errors.New(
-				fmt.Sprintf(
-					"Wrong number of arguments: expected %d; got %d",
-					method.Type().NumIn(),
-					len(args),
-				),
-			),
-		)
-
-		// Should never get here in real code.
-		log.Println("ReportFatalError unexpectedly returned.")
-		return
-	}
-
-	// Find an expectation matching this call.
-	expectation := c.chooseExpectationLocked(o, methodName, args)
-	if expectation == nil {
-		c.reporter.ReportError(
-			fileName,
-			lineNumber,
-			errors.New(
-				fmt.Sprintf("Unexpected call to %s with args: %v", methodName, args),
-			),
-		)
-
-		zeroVals = makeZeroReturnValues(method.Type())
-		return
-	}
-
-	expectation.mutex.Lock()
-	defer expectation.mutex.Unlock()
-
-	// Increase the number of matches recorded, and check whether we're over the
-	// number expected.
-	expectation.NumMatches++
-	_, maxCardinality := computeCardinalityLocked(expectation)
-	if expectation.NumMatches > maxCardinality {
-		c.reporter.ReportError(
-			expectation.FileName,
-			expectation.LineNumber,
-			errors.New(
-				fmt.Sprintf(
-					"Unexpected call to %s: "+
-						"expected to be called at most %d times; called %d times.",
-					methodName,
-					maxCardinality,
-					expectation.NumMatches,
-				),
-			),
-		)
-
-		zeroVals = makeZeroReturnValues(method.Type())
-		return
-	}
-
-	// Choose an action to invoke. If there is none, just return zero values.
-	action = chooseActionLocked(expectation.NumMatches-1, expectation)
-	if action == nil {
-		zeroVals = makeZeroReturnValues(method.Type())
-		return
-	}
-
-	// Let the action take over.
-	return
-}
-
-func (c *controllerImpl) HandleMethodCall(
-	o MockObject,
-	methodName string,
-	fileName string,
-	lineNumber int,
-	args []interface{},
-) []interface{} {
-	// Figure out whether to invoke an action or return zero values.
-	action, zeroVals := c.chooseActionAndUpdateExpectations(
-		o,
-		methodName,
-		fileName,
-		lineNumber,
-		args,
-	)
-
-	if action != nil {
-		return action.Invoke(args)
-	}
-
-	return zeroVals
-}

+ 0 - 226
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/createmock/createmock.go

@@ -1,226 +0,0 @@
-// Copyright 2012 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// createmock is used to generate source code for mock versions of interfaces
-// from installed packages.
-package main
-
-import (
-	"errors"
-	"flag"
-	"fmt"
-	"go/build"
-	"io/ioutil"
-	"log"
-	"os"
-	"os/exec"
-	"path"
-	"regexp"
-	"text/template"
-
-	// Ensure that the generate package, which is used by the generated code, is
-	// installed by goinstall.
-	_ "github.com/smartystreets/goconvey/convey/assertions/oglemock/generate"
-)
-
-// A template for generated code that is used to print the result.
-const tmplStr = `
-{{$inputPkg := .InputPkg}}
-{{$outputPkg := .OutputPkg}}
-
-package main
-
-import (
-	{{range $identifier, $import := .Imports}}
-		{{$identifier}} "{{$import}}"
-	{{end}}
-)
-
-func getTypeForPtr(ptr interface{}) reflect.Type {
-	return reflect.TypeOf(ptr).Elem()
-}
-
-func main() {
-	// Reduce noise in logging output.
-	log.SetFlags(0)
-
-	interfaces := []reflect.Type{
-		{{range $typeName := .TypeNames}}
-			getTypeForPtr((*{{base $inputPkg}}.{{$typeName}})(nil)),
-		{{end}}
-	}
-
-	err := generate.GenerateMockSource(os.Stdout, "{{$outputPkg}}", interfaces)
-	if err != nil {
-		log.Fatalf("Error generating mock source: %v", err)
-	}
-}
-`
-
-// A map from import identifier to package to use that identifier for,
-// containing elements for each import needed by the generated code.
-type importMap map[string]string
-
-type tmplArg struct {
-	InputPkg  string
-	OutputPkg string
-
-	// Imports needed by the generated code.
-	Imports importMap
-
-	// Types to be mocked, relative to their package's name.
-	TypeNames []string
-}
-
-var unknownPackageRegexp = regexp.MustCompile(
-	`tool\.go:\d+:\d+: cannot find package "([^"]+)"`)
-
-var undefinedInterfaceRegexp = regexp.MustCompile(`tool\.go:\d+: undefined: [\pL_0-9]+\.([\pL_0-9]+)`)
-
-// Does the 'go build' output indicate that a package wasn't found? If so,
-// return the name of the package.
-func findUnknownPackage(output []byte) *string {
-	if match := unknownPackageRegexp.FindSubmatch(output); match != nil {
-		res := string(match[1])
-		return &res
-	}
-
-	return nil
-}
-
-// Does the 'go build' output indicate that an interface wasn't found? If so,
-// return the name of the interface.
-func findUndefinedInterface(output []byte) *string {
-	if match := undefinedInterfaceRegexp.FindSubmatch(output); match != nil {
-		res := string(match[1])
-		return &res
-	}
-
-	return nil
-}
-
-// Split out from main so that deferred calls are executed even in the event of
-// an error.
-func run() error {
-	// Reduce noise in logging output.
-	log.SetFlags(0)
-
-	// Check the command-line arguments.
-	flag.Parse()
-
-	cmdLineArgs := flag.Args()
-	if len(cmdLineArgs) < 2 {
-		return errors.New("Usage: createmock [package] [interface ...]")
-	}
-
-	// Create a temporary directory inside of $GOPATH to hold generated code.
-	buildPkg, err := build.Import("github.com/smartystreets/goconvey/convey/assertions/oglemock", "", build.FindOnly)
-	if err != nil {
-		return errors.New(fmt.Sprintf("Couldn't find oglemock in $GOPATH: %v", err))
-	}
-
-	tmpDir, err := ioutil.TempDir(buildPkg.SrcRoot, "tmp-createmock-")
-	if err != nil {
-		return errors.New(fmt.Sprintf("Creating temp dir: %v", err))
-	}
-
-	defer os.RemoveAll(tmpDir)
-
-	// Create a file to hold generated code.
-	codeFile, err := os.Create(path.Join(tmpDir, "tool.go"))
-	if err != nil {
-		return errors.New(fmt.Sprintf("Couldn't create a file to hold code: %v", err))
-	}
-
-	// Create an appropriate path for the built binary.
-	binaryPath := path.Join(tmpDir, "tool")
-
-	// Create an appropriate template argument.
-	var arg tmplArg
-	arg.InputPkg = cmdLineArgs[0]
-	arg.OutputPkg = "mock_" + path.Base(arg.InputPkg)
-	arg.TypeNames = cmdLineArgs[1:]
-
-	arg.Imports = make(importMap)
-	arg.Imports[path.Base(arg.InputPkg)] = arg.InputPkg
-	arg.Imports["generate"] = "github.com/smartystreets/goconvey/convey/assertions/oglemock/generate"
-	arg.Imports["log"] = "log"
-	arg.Imports["os"] = "os"
-	arg.Imports["reflect"] = "reflect"
-
-	// Execute the template to generate code that will itself generate the mock
-	// code. Write the code to the temp file.
-	tmpl := template.Must(
-		template.New("code").Funcs(
-			template.FuncMap{
-				"base": path.Base,
-			}).Parse(tmplStr))
-	if err := tmpl.Execute(codeFile, arg); err != nil {
-		return errors.New(fmt.Sprintf("Error executing template: %v", err))
-	}
-
-	codeFile.Close()
-
-	// Attempt to build the code.
-	cmd := exec.Command("go", "build", "-o", binaryPath)
-	cmd.Dir = tmpDir
-	buildOutput, err := cmd.CombinedOutput()
-
-	if err != nil {
-		// Did the compilation fail due to the user-specified package not being found?
-		if pkg := findUnknownPackage(buildOutput); pkg != nil && *pkg == arg.InputPkg {
-			return errors.New(fmt.Sprintf("Unknown package: %s", *pkg))
-		}
-
-		// Did the compilation fail due to an unknown interface?
-		if in := findUndefinedInterface(buildOutput); in != nil {
-			return errors.New(fmt.Sprintf("Unknown interface: %s", *in))
-		}
-
-		// Otherwise return a generic error.
-		return errors.New(fmt.Sprintf(
-			"%s\n\nError building generated code:\n\n"+
-				"    %v\n\nPlease report this oglemock bug.",
-			buildOutput,
-			err))
-	}
-
-	// Run the binary.
-	cmd = exec.Command(binaryPath)
-	binaryOutput, err := cmd.CombinedOutput()
-
-	if err != nil {
-		return errors.New(fmt.Sprintf(
-			"%s\n\nError running generated code:\n\n"+
-				"    %v\n\n Please report this oglemock bug.",
-			binaryOutput,
-			err))
-	}
-
-	// Copy its output.
-	_, err = os.Stdout.Write(binaryOutput)
-	if err != nil {
-		return errors.New(fmt.Sprintf("Error copying binary output: %v", err))
-	}
-
-	return nil
-}
-
-func main() {
-	if err := run(); err != nil {
-		fmt.Println(err.Error())
-		os.Exit(1)
-	}
-}

+ 0 - 1
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/createmock/test_cases/golden.no_interfaces

@@ -1 +0,0 @@
-Usage: createmock [package] [interface ...]

+ 0 - 1
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/createmock/test_cases/golden.no_package

@@ -1 +0,0 @@
-Usage: createmock [package] [interface ...]

+ 0 - 1
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/createmock/test_cases/golden.unknown_interface

@@ -1 +0,0 @@
-Unknown interface: Frobnicator

+ 0 - 1
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/createmock/test_cases/golden.unknown_package

@@ -1 +0,0 @@
-Unknown package: foo/bar

+ 0 - 29
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/error_reporter.go

@@ -1,29 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglemock
-
-// ErrorReporter is an interface that wraps methods for reporting errors that
-// should cause test failures.
-type ErrorReporter interface {
-	// Report that some failure (e.g. an unsatisfied expectation) occurred. If
-	// known, fileName and lineNumber should contain information about where it
-	// occurred. The test may continue if the test framework supports it.
-	ReportError(fileName string, lineNumber int, err error)
-
-	// Like ReportError, but the test should be halted immediately. It is assumed
-	// that this method does not return.
-	ReportFatalError(fileName string, lineNumber int, err error)
-}

+ 0 - 59
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/expectation.go

@@ -1,59 +0,0 @@
-// Copyright 2011 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package oglemock
-
-// Expectation is an expectation for zero or more calls to a mock method with
-// particular arguments or sets of arguments.
-type Expectation interface {
-	// Times expresses that a matching method call should happen exactly N times.
-	// Times must not be called more than once, and must not be called after
-	// WillOnce or WillRepeatedly.
-	//
-	// The full rules for the cardinality of an expectation are as follows:
-	//
-	//  1. If an explicit cardinality is set with Times(N), then anything other
-	//     than exactly N matching calls will cause a test failure.
-	//
-	//  2. Otherwise, if there are any one-time actions set up, then it is
-	//     expected there will be at least that many matching calls. If there is
-	//     not also a fallback action, then it is expected that there will be
-	//     exactly that many.
-	//
-	//  3. Otherwise, if there is a fallback action configured, any number of
-	//     matching calls (including zero) is allowed.
-	//
-	//  4. Otherwise, the implicit cardinality is one.
-	//
-	Times(n uint) Expectation
-
-	// WillOnce configures a "one-time action". WillOnce can be called zero or
-	// more times, but must be called after any call to Times and before any call
-	// to WillRepeatedly.
-	//
-	// When matching method calls are made on the mock object, one-time actions
-	// are invoked one per matching call in the order that they were set up until
-	// they are exhausted. Afterward the fallback action, if any, will be used.
-	WillOnce(a Action) Expectation
-
-	// WillRepeatedly configures a "fallback action". WillRepeatedly can be
-	// called zero or one times, and must not be called before Times or WillOnce.
-	//
-	// Once all one-time actions are exhausted (see above), the fallback action
-	// will be invoked for any further method calls. If WillRepeatedly is not
-	// called, the fallback action is implicitly an action that returns zero
-	// values for the method's return values.
-	WillRepeatedly(a Action) Expectation
-}

+ 0 - 329
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/generate.go

@@ -1,329 +0,0 @@
-// Copyright 2012 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Package generate implements code generation for mock classes. This is an
-// implementation detail of the createmock command, which you probably want to
-// use directly instead.
-package generate
-
-import (
-	"bytes"
-	"errors"
-	"go/ast"
-	"go/parser"
-	"go/printer"
-	"go/token"
-	"io"
-	"reflect"
-	"regexp"
-	"text/template"
-)
-
-const tmplStr = `
-// This file was auto-generated using createmock. See the following page for
-// more information:
-//
-//     https://github.com/smartystreets/goconvey/convey/assertions/oglemock
-//
-
-package {{.Pkg}}
-
-import (
-	{{range $identifier, $import := .Imports}}{{$identifier}} "{{$import}}"
-	{{end}}
-)
-
-{{range .Interfaces}}
-	{{$interfaceName := printf "Mock%s" .Name}}
-	{{$structName := printf "mock%s" .Name}}
-
-	type {{$interfaceName}} interface {
-		{{getTypeString .}}
-		oglemock.MockObject
-	}
-
-	type {{$structName}} struct {
-		controller oglemock.Controller
-		description string
-	}
-	
-	func New{{printf "Mock%s" .Name}}(
-		c oglemock.Controller,
-		desc string) {{$interfaceName}} {
-	  return &{{$structName}}{
-			controller: c,
-			description: desc,
-		}
-	}
-	
-	func (m *{{$structName}}) Oglemock_Id() uintptr {
-		return uintptr(unsafe.Pointer(m))
-	}
-	
-	func (m *{{$structName}}) Oglemock_Description() string {
-		return m.description
-	}
-
-	{{range getMethods .}}
-	  {{$funcType := .Type}}
-	  {{$inputTypes := getInputs $funcType}}
-	  {{$outputTypes := getOutputs $funcType}}
-
-		func (m *{{$structName}}) {{.Name}}({{range $i, $type := $inputTypes}}p{{$i}} {{getInputTypeString $i $funcType}}, {{end}}) ({{range $i, $type := $outputTypes}}o{{$i}} {{getTypeString $type}}, {{end}}) {
-			// Get a file name and line number for the caller.
-			_, file, line, _ := runtime.Caller(1)
-
-			// Hand the call off to the controller, which does most of the work.
-			retVals := m.controller.HandleMethodCall(
-				m,
-				"{{.Name}}",
-				file,
-				line,
-				[]interface{}{ {{range $i, $type := $inputTypes}}p{{$i}}, {{end}} })
-
-			if len(retVals) != {{len $outputTypes}} {
-				panic(fmt.Sprintf("{{$structName}}.{{.Name}}: invalid return values: %v", retVals))
-			}
-
-			{{range $i, $type := $outputTypes}}
-				// o{{$i}} {{getTypeString $type}}
-				if retVals[{{$i}}] != nil {
-					o{{$i}} = retVals[{{$i}}].({{getTypeString $type}})
-				}
-			{{end}}
-
-			return
-		}
-	{{end}}
-{{end}}
-`
-
-type tmplArg struct {
-	// The package of the generated code.
-	Pkg string
-
-	// Imports needed by the interfaces.
-	Imports importMap
-
-	// The set of interfaces to mock.
-	Interfaces []reflect.Type
-}
-
-var tmpl *template.Template
-
-func init() {
-	extraFuncs := make(template.FuncMap)
-	extraFuncs["getMethods"] = getMethods
-	extraFuncs["getInputs"] = getInputs
-	extraFuncs["getOutputs"] = getOutputs
-	extraFuncs["getInputTypeString"] = getInputTypeString
-	extraFuncs["getTypeString"] = getTypeString
-
-	tmpl = template.New("code")
-	tmpl.Funcs(extraFuncs)
-	tmpl.Parse(tmplStr)
-}
-
-func getInputTypeString(i int, ft reflect.Type) string {
-	numInputs := ft.NumIn()
-	if i == numInputs-1 && ft.IsVariadic() {
-		return "..." + getTypeString(ft.In(i).Elem())
-	}
-
-	return getTypeString(ft.In(i))
-}
-
-func getTypeString(t reflect.Type) string {
-	return t.String()
-}
-
-func getMethods(it reflect.Type) []reflect.Method {
-	numMethods := it.NumMethod()
-	methods := make([]reflect.Method, numMethods)
-
-	for i := 0; i < numMethods; i++ {
-		methods[i] = it.Method(i)
-	}
-
-	return methods
-}
-
-func getInputs(ft reflect.Type) []reflect.Type {
-	numIn := ft.NumIn()
-	inputs := make([]reflect.Type, numIn)
-
-	for i := 0; i < numIn; i++ {
-		inputs[i] = ft.In(i)
-	}
-
-	return inputs
-}
-
-func getOutputs(ft reflect.Type) []reflect.Type {
-	numOut := ft.NumOut()
-	outputs := make([]reflect.Type, numOut)
-
-	for i := 0; i < numOut; i++ {
-		outputs[i] = ft.Out(i)
-	}
-
-	return outputs
-}
-
-// A map from import identifier to package to use that identifier for,
-// containing elements for each import needed by a set of mocked interfaces.
-type importMap map[string]string
-
-var typePackageIdentifierRegexp = regexp.MustCompile(`^([\pL_0-9]+)\.[\pL_0-9]+$`)
-
-// Add an import for the supplied type, without recursing.
-func addImportForType(imports importMap, t reflect.Type) {
-	// If there is no package path, this is a built-in type and we don't need an
-	// import.
-	pkgPath := t.PkgPath()
-	if pkgPath == "" {
-		return
-	}
-
-	// Work around a bug in Go:
-	//
-	//     http://code.google.com/p/go/issues/detail?id=2660
-	//
-	var errorPtr *error
-	if t == reflect.TypeOf(errorPtr).Elem() {
-		return
-	}
-
-	// Use the identifier that's part of the type's string representation as the
-	// import identifier. This means that we'll do the right thing for package
-	// "foo/bar" with declaration "package baz".
-	match := typePackageIdentifierRegexp.FindStringSubmatch(t.String())
-	if match == nil {
-		return
-	}
-
-	imports[match[1]] = pkgPath
-}
-
-// Add all necessary imports for the type, recursing as appropriate.
-func addImportsForType(imports importMap, t reflect.Type) {
-	// Add any import needed for the type itself.
-	addImportForType(imports, t)
-
-	// Handle special cases where recursion is needed.
-	switch t.Kind() {
-	case reflect.Array, reflect.Chan, reflect.Ptr, reflect.Slice:
-		addImportsForType(imports, t.Elem())
-
-	case reflect.Func:
-		// Input parameters.
-		for i := 0; i < t.NumIn(); i++ {
-			addImportsForType(imports, t.In(i))
-		}
-
-		// Return values.
-		for i := 0; i < t.NumOut(); i++ {
-			addImportsForType(imports, t.Out(i))
-		}
-
-	case reflect.Map:
-		addImportsForType(imports, t.Key())
-		addImportsForType(imports, t.Elem())
-	}
-}
-
-// Add imports for each of the methods of the interface, but not the interface
-// itself.
-func addImportsForInterfaceMethods(imports importMap, it reflect.Type) {
-	// Handle each method.
-	for i := 0; i < it.NumMethod(); i++ {
-		m := it.Method(i)
-		addImportsForType(imports, m.Type)
-	}
-}
-
-// Given a set of interfaces, return a map from import identifier to package to
-// use that identifier for, containing elements for each import needed by the
-// mock versions of those interfaces.
-func getImports(interfaces []reflect.Type) importMap {
-	imports := make(importMap)
-	for _, it := range interfaces {
-		addImportForType(imports, it)
-		addImportsForInterfaceMethods(imports, it)
-	}
-
-	// Make sure there are imports for other types used by the generated code
-	// itself.
-	imports["fmt"] = "fmt"
-	imports["oglemock"] = "github.com/smartystreets/goconvey/convey/assertions/oglemock"
-	imports["runtime"] = "runtime"
-	imports["unsafe"] = "unsafe"
-
-	return imports
-}
-
-// Given a set of interfaces to mock, write out source code for a package named
-// `pkg` that contains mock implementations of those interfaces.
-func GenerateMockSource(w io.Writer, pkg string, interfaces []reflect.Type) error {
-	// Sanity-check arguments.
-	if pkg == "" {
-		return errors.New("Package name must be non-empty.")
-	}
-
-	if len(interfaces) == 0 {
-		return errors.New("List of interfaces must be non-empty.")
-	}
-
-	// Make sure each type is indeed an interface.
-	for _, it := range interfaces {
-		if it.Kind() != reflect.Interface {
-			return errors.New("Invalid type: " + it.String())
-		}
-	}
-
-	// Create an appropriate template arg, then execute the template. Write the
-	// raw output into a buffer.
-	var arg tmplArg
-	arg.Pkg = pkg
-	arg.Imports = getImports(interfaces)
-	arg.Interfaces = interfaces
-
-	buf := new(bytes.Buffer)
-	if err := tmpl.Execute(buf, arg); err != nil {
-		return err
-	}
-
-	// Parse the output.
-	fset := token.NewFileSet()
-	astFile, err := parser.ParseFile(fset, pkg+".go", buf, parser.ParseComments)
-	if err != nil {
-		return errors.New("Error parsing generated code: " + err.Error())
-	}
-
-	// Sort the import lines in the AST in the same way that gofmt does.
-	ast.SortImports(fset, astFile)
-
-	// Pretty-print the AST, using the same options that gofmt does by default.
-	cfg := &printer.Config{
-		Mode:     printer.UseSpaces | printer.TabIndent,
-		Tabwidth: 8,
-	}
-
-	if err = cfg.Fprint(w, fset, astFile); err != nil {
-		return errors.New("Error pretty printing: " + err.Error())
-	}
-
-	return nil
-}

+ 0 - 41
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/complicated_pkg/complicated_pkg.go

@@ -1,41 +0,0 @@
-// Copyright 2012 Aaron Jacobs. All Rights Reserved.
-// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Package complicated_pkg contains an interface with lots of interesting
-// cases, for use in integration testing.
-package complicated_pkg
-
-import (
-	"image"
-	"io"
-	"net"
-
-	"github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/renamed_pkg"
-)
-
-type Byte uint8
-
-type ComplicatedThing interface {
-	Channels(a chan chan<- <-chan net.Conn) chan int
-	Pointers(a *int, b *net.Conn, c **io.Reader) (*int, error)
-	Functions(a func(int, image.Image) int) func(string, int) net.Conn
-	Maps(a map[string]*int) (map[int]*string, error)
-	Arrays(a [3]string) ([3]int, error)
-	Slices(a []string) ([]int, error)
-	NamedScalarType(a Byte) ([]Byte, error)
-	EmptyInterface(a interface{}) (interface{}, error)
-	RenamedPackage(a tony.SomeUint8Alias)
-	Variadic(a int, b ...net.Conn) int
-}

+ 0 - 312
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/golden.complicated_pkg.go

@@ -1,312 +0,0 @@
-// This file was auto-generated using createmock. See the following page for
-// more information:
-//
-//     https://github.com/smartystreets/goconvey/convey/assertions/oglemock
-//
-
-package some_pkg
-
-import (
-	fmt "fmt"
-	image "image"
-	io "io"
-	net "net"
-	runtime "runtime"
-	unsafe "unsafe"
-
-	oglemock "github.com/smartystreets/goconvey/convey/assertions/oglemock"
-	complicated_pkg "github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/complicated_pkg"
-	tony "github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/renamed_pkg"
-)
-
-type MockComplicatedThing interface {
-	complicated_pkg.ComplicatedThing
-	oglemock.MockObject
-}
-
-type mockComplicatedThing struct {
-	controller  oglemock.Controller
-	description string
-}
-
-func NewMockComplicatedThing(
-	c oglemock.Controller,
-	desc string) MockComplicatedThing {
-	return &mockComplicatedThing{
-		controller:  c,
-		description: desc,
-	}
-}
-
-func (m *mockComplicatedThing) Oglemock_Id() uintptr {
-	return uintptr(unsafe.Pointer(m))
-}
-
-func (m *mockComplicatedThing) Oglemock_Description() string {
-	return m.description
-}
-
-func (m *mockComplicatedThing) Arrays(p0 [3]string) (o0 [3]int, o1 error) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"Arrays",
-		file,
-		line,
-		[]interface{}{p0})
-
-	if len(retVals) != 2 {
-		panic(fmt.Sprintf("mockComplicatedThing.Arrays: invalid return values: %v", retVals))
-	}
-
-	// o0 [3]int
-	if retVals[0] != nil {
-		o0 = retVals[0].([3]int)
-	}
-
-	// o1 error
-	if retVals[1] != nil {
-		o1 = retVals[1].(error)
-	}
-
-	return
-}
-
-func (m *mockComplicatedThing) Channels(p0 chan chan<- <-chan net.Conn) (o0 chan int) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"Channels",
-		file,
-		line,
-		[]interface{}{p0})
-
-	if len(retVals) != 1 {
-		panic(fmt.Sprintf("mockComplicatedThing.Channels: invalid return values: %v", retVals))
-	}
-
-	// o0 chan int
-	if retVals[0] != nil {
-		o0 = retVals[0].(chan int)
-	}
-
-	return
-}
-
-func (m *mockComplicatedThing) EmptyInterface(p0 interface{}) (o0 interface{}, o1 error) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"EmptyInterface",
-		file,
-		line,
-		[]interface{}{p0})
-
-	if len(retVals) != 2 {
-		panic(fmt.Sprintf("mockComplicatedThing.EmptyInterface: invalid return values: %v", retVals))
-	}
-
-	// o0 interface {}
-	if retVals[0] != nil {
-		o0 = retVals[0].(interface{})
-	}
-
-	// o1 error
-	if retVals[1] != nil {
-		o1 = retVals[1].(error)
-	}
-
-	return
-}
-
-func (m *mockComplicatedThing) Functions(p0 func(int, image.Image) int) (o0 func(string, int) net.Conn) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"Functions",
-		file,
-		line,
-		[]interface{}{p0})
-
-	if len(retVals) != 1 {
-		panic(fmt.Sprintf("mockComplicatedThing.Functions: invalid return values: %v", retVals))
-	}
-
-	// o0 func(string, int) net.Conn
-	if retVals[0] != nil {
-		o0 = retVals[0].(func(string, int) net.Conn)
-	}
-
-	return
-}
-
-func (m *mockComplicatedThing) Maps(p0 map[string]*int) (o0 map[int]*string, o1 error) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"Maps",
-		file,
-		line,
-		[]interface{}{p0})
-
-	if len(retVals) != 2 {
-		panic(fmt.Sprintf("mockComplicatedThing.Maps: invalid return values: %v", retVals))
-	}
-
-	// o0 map[int]*string
-	if retVals[0] != nil {
-		o0 = retVals[0].(map[int]*string)
-	}
-
-	// o1 error
-	if retVals[1] != nil {
-		o1 = retVals[1].(error)
-	}
-
-	return
-}
-
-func (m *mockComplicatedThing) NamedScalarType(p0 complicated_pkg.Byte) (o0 []complicated_pkg.Byte, o1 error) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"NamedScalarType",
-		file,
-		line,
-		[]interface{}{p0})
-
-	if len(retVals) != 2 {
-		panic(fmt.Sprintf("mockComplicatedThing.NamedScalarType: invalid return values: %v", retVals))
-	}
-
-	// o0 []complicated_pkg.Byte
-	if retVals[0] != nil {
-		o0 = retVals[0].([]complicated_pkg.Byte)
-	}
-
-	// o1 error
-	if retVals[1] != nil {
-		o1 = retVals[1].(error)
-	}
-
-	return
-}
-
-func (m *mockComplicatedThing) Pointers(p0 *int, p1 *net.Conn, p2 **io.Reader) (o0 *int, o1 error) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"Pointers",
-		file,
-		line,
-		[]interface{}{p0, p1, p2})
-
-	if len(retVals) != 2 {
-		panic(fmt.Sprintf("mockComplicatedThing.Pointers: invalid return values: %v", retVals))
-	}
-
-	// o0 *int
-	if retVals[0] != nil {
-		o0 = retVals[0].(*int)
-	}
-
-	// o1 error
-	if retVals[1] != nil {
-		o1 = retVals[1].(error)
-	}
-
-	return
-}
-
-func (m *mockComplicatedThing) RenamedPackage(p0 tony.SomeUint8Alias) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"RenamedPackage",
-		file,
-		line,
-		[]interface{}{p0})
-
-	if len(retVals) != 0 {
-		panic(fmt.Sprintf("mockComplicatedThing.RenamedPackage: invalid return values: %v", retVals))
-	}
-
-	return
-}
-
-func (m *mockComplicatedThing) Slices(p0 []string) (o0 []int, o1 error) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"Slices",
-		file,
-		line,
-		[]interface{}{p0})
-
-	if len(retVals) != 2 {
-		panic(fmt.Sprintf("mockComplicatedThing.Slices: invalid return values: %v", retVals))
-	}
-
-	// o0 []int
-	if retVals[0] != nil {
-		o0 = retVals[0].([]int)
-	}
-
-	// o1 error
-	if retVals[1] != nil {
-		o1 = retVals[1].(error)
-	}
-
-	return
-}
-
-func (m *mockComplicatedThing) Variadic(p0 int, p1 ...net.Conn) (o0 int) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"Variadic",
-		file,
-		line,
-		[]interface{}{p0, p1})
-
-	if len(retVals) != 1 {
-		panic(fmt.Sprintf("mockComplicatedThing.Variadic: invalid return values: %v", retVals))
-	}
-
-	// o0 int
-	if retVals[0] != nil {
-		o0 = retVals[0].(int)
-	}
-
-	return
-}

+ 0 - 239
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/golden.image.go

@@ -1,239 +0,0 @@
-// This file was auto-generated using createmock. See the following page for
-// more information:
-//
-//     https://github.com/smartystreets/goconvey/convey/assertions/oglemock
-//
-
-package some_pkg
-
-import (
-	fmt "fmt"
-	image "image"
-	color "image/color"
-	runtime "runtime"
-	unsafe "unsafe"
-
-	oglemock "github.com/smartystreets/goconvey/convey/assertions/oglemock"
-)
-
-type MockImage interface {
-	image.Image
-	oglemock.MockObject
-}
-
-type mockImage struct {
-	controller  oglemock.Controller
-	description string
-}
-
-func NewMockImage(
-	c oglemock.Controller,
-	desc string) MockImage {
-	return &mockImage{
-		controller:  c,
-		description: desc,
-	}
-}
-
-func (m *mockImage) Oglemock_Id() uintptr {
-	return uintptr(unsafe.Pointer(m))
-}
-
-func (m *mockImage) Oglemock_Description() string {
-	return m.description
-}
-
-func (m *mockImage) At(p0 int, p1 int) (o0 color.Color) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"At",
-		file,
-		line,
-		[]interface{}{p0, p1})
-
-	if len(retVals) != 1 {
-		panic(fmt.Sprintf("mockImage.At: invalid return values: %v", retVals))
-	}
-
-	// o0 color.Color
-	if retVals[0] != nil {
-		o0 = retVals[0].(color.Color)
-	}
-
-	return
-}
-
-func (m *mockImage) Bounds() (o0 image.Rectangle) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"Bounds",
-		file,
-		line,
-		[]interface{}{})
-
-	if len(retVals) != 1 {
-		panic(fmt.Sprintf("mockImage.Bounds: invalid return values: %v", retVals))
-	}
-
-	// o0 image.Rectangle
-	if retVals[0] != nil {
-		o0 = retVals[0].(image.Rectangle)
-	}
-
-	return
-}
-
-func (m *mockImage) ColorModel() (o0 color.Model) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"ColorModel",
-		file,
-		line,
-		[]interface{}{})
-
-	if len(retVals) != 1 {
-		panic(fmt.Sprintf("mockImage.ColorModel: invalid return values: %v", retVals))
-	}
-
-	// o0 color.Model
-	if retVals[0] != nil {
-		o0 = retVals[0].(color.Model)
-	}
-
-	return
-}
-
-type MockPalettedImage interface {
-	image.PalettedImage
-	oglemock.MockObject
-}
-
-type mockPalettedImage struct {
-	controller  oglemock.Controller
-	description string
-}
-
-func NewMockPalettedImage(
-	c oglemock.Controller,
-	desc string) MockPalettedImage {
-	return &mockPalettedImage{
-		controller:  c,
-		description: desc,
-	}
-}
-
-func (m *mockPalettedImage) Oglemock_Id() uintptr {
-	return uintptr(unsafe.Pointer(m))
-}
-
-func (m *mockPalettedImage) Oglemock_Description() string {
-	return m.description
-}
-
-func (m *mockPalettedImage) At(p0 int, p1 int) (o0 color.Color) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"At",
-		file,
-		line,
-		[]interface{}{p0, p1})
-
-	if len(retVals) != 1 {
-		panic(fmt.Sprintf("mockPalettedImage.At: invalid return values: %v", retVals))
-	}
-
-	// o0 color.Color
-	if retVals[0] != nil {
-		o0 = retVals[0].(color.Color)
-	}
-
-	return
-}
-
-func (m *mockPalettedImage) Bounds() (o0 image.Rectangle) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"Bounds",
-		file,
-		line,
-		[]interface{}{})
-
-	if len(retVals) != 1 {
-		panic(fmt.Sprintf("mockPalettedImage.Bounds: invalid return values: %v", retVals))
-	}
-
-	// o0 image.Rectangle
-	if retVals[0] != nil {
-		o0 = retVals[0].(image.Rectangle)
-	}
-
-	return
-}
-
-func (m *mockPalettedImage) ColorIndexAt(p0 int, p1 int) (o0 uint8) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"ColorIndexAt",
-		file,
-		line,
-		[]interface{}{p0, p1})
-
-	if len(retVals) != 1 {
-		panic(fmt.Sprintf("mockPalettedImage.ColorIndexAt: invalid return values: %v", retVals))
-	}
-
-	// o0 uint8
-	if retVals[0] != nil {
-		o0 = retVals[0].(uint8)
-	}
-
-	return
-}
-
-func (m *mockPalettedImage) ColorModel() (o0 color.Model) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"ColorModel",
-		file,
-		line,
-		[]interface{}{})
-
-	if len(retVals) != 1 {
-		panic(fmt.Sprintf("mockPalettedImage.ColorModel: invalid return values: %v", retVals))
-	}
-
-	// o0 color.Model
-	if retVals[0] != nil {
-		o0 = retVals[0].(color.Model)
-	}
-
-	return
-}

+ 0 - 128
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/golden.io_reader_writer.go

@@ -1,128 +0,0 @@
-// This file was auto-generated using createmock. See the following page for
-// more information:
-//
-//     https://github.com/smartystreets/goconvey/convey/assertions/oglemock
-//
-
-package some_pkg
-
-import (
-	fmt "fmt"
-	io "io"
-	runtime "runtime"
-	unsafe "unsafe"
-
-	oglemock "github.com/smartystreets/goconvey/convey/assertions/oglemock"
-)
-
-type MockReader interface {
-	io.Reader
-	oglemock.MockObject
-}
-
-type mockReader struct {
-	controller  oglemock.Controller
-	description string
-}
-
-func NewMockReader(
-	c oglemock.Controller,
-	desc string) MockReader {
-	return &mockReader{
-		controller:  c,
-		description: desc,
-	}
-}
-
-func (m *mockReader) Oglemock_Id() uintptr {
-	return uintptr(unsafe.Pointer(m))
-}
-
-func (m *mockReader) Oglemock_Description() string {
-	return m.description
-}
-
-func (m *mockReader) Read(p0 []uint8) (o0 int, o1 error) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"Read",
-		file,
-		line,
-		[]interface{}{p0})
-
-	if len(retVals) != 2 {
-		panic(fmt.Sprintf("mockReader.Read: invalid return values: %v", retVals))
-	}
-
-	// o0 int
-	if retVals[0] != nil {
-		o0 = retVals[0].(int)
-	}
-
-	// o1 error
-	if retVals[1] != nil {
-		o1 = retVals[1].(error)
-	}
-
-	return
-}
-
-type MockWriter interface {
-	io.Writer
-	oglemock.MockObject
-}
-
-type mockWriter struct {
-	controller  oglemock.Controller
-	description string
-}
-
-func NewMockWriter(
-	c oglemock.Controller,
-	desc string) MockWriter {
-	return &mockWriter{
-		controller:  c,
-		description: desc,
-	}
-}
-
-func (m *mockWriter) Oglemock_Id() uintptr {
-	return uintptr(unsafe.Pointer(m))
-}
-
-func (m *mockWriter) Oglemock_Description() string {
-	return m.description
-}
-
-func (m *mockWriter) Write(p0 []uint8) (o0 int, o1 error) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"Write",
-		file,
-		line,
-		[]interface{}{p0})
-
-	if len(retVals) != 2 {
-		panic(fmt.Sprintf("mockWriter.Write: invalid return values: %v", retVals))
-	}
-
-	// o0 int
-	if retVals[0] != nil {
-		o0 = retVals[0].(int)
-	}
-
-	// o1 error
-	if retVals[1] != nil {
-		o1 = retVals[1].(error)
-	}
-
-	return
-}

+ 0 - 67
Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/golden.renamed_pkg.go

@@ -1,67 +0,0 @@
-// This file was auto-generated using createmock. See the following page for
-// more information:
-//
-//     https://github.com/smartystreets/goconvey/convey/assertions/oglemock
-//
-
-package some_pkg
-
-import (
-	fmt "fmt"
-	runtime "runtime"
-	unsafe "unsafe"
-
-	oglemock "github.com/smartystreets/goconvey/convey/assertions/oglemock"
-	tony "github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/renamed_pkg"
-)
-
-type MockSomeInterface interface {
-	tony.SomeInterface
-	oglemock.MockObject
-}
-
-type mockSomeInterface struct {
-	controller  oglemock.Controller
-	description string
-}
-
-func NewMockSomeInterface(
-	c oglemock.Controller,
-	desc string) MockSomeInterface {
-	return &mockSomeInterface{
-		controller:  c,
-		description: desc,
-	}
-}
-
-func (m *mockSomeInterface) Oglemock_Id() uintptr {
-	return uintptr(unsafe.Pointer(m))
-}
-
-func (m *mockSomeInterface) Oglemock_Description() string {
-	return m.description
-}
-
-func (m *mockSomeInterface) DoFoo(p0 int) (o0 int) {
-	// Get a file name and line number for the caller.
-	_, file, line, _ := runtime.Caller(1)
-
-	// Hand the call off to the controller, which does most of the work.
-	retVals := m.controller.HandleMethodCall(
-		m,
-		"DoFoo",
-		file,
-		line,
-		[]interface{}{p0})
-
-	if len(retVals) != 1 {
-		panic(fmt.Sprintf("mockSomeInterface.DoFoo: invalid return values: %v", retVals))
-	}
-
-	// o0 int
-	if retVals[0] != nil {
-		o0 = retVals[0].(int)
-	}
-
-	return
-}

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott