]> Cypherpunks repositories - gostls13.git/commitdiff
database/sql: TestConversions add forgotten fields wantbytes and wantraw
authorCyrill Schumacher <cyrill@schumacher.fm>
Wed, 27 Sep 2017 18:37:02 +0000 (20:37 +0200)
committerDaniel Theophanes <kardianos@gmail.com>
Wed, 27 Sep 2017 20:42:07 +0000 (20:42 +0000)
The fields wantbytes and wantraw in the test struct `conversionTest` has
been forgotten to include in the TestConversions function.

Change-Id: I6dab69e76de3799a1bbf9fa09a15607e55172114
Reviewed-on: https://go-review.googlesource.com/66610
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/database/sql/convert_test.go

index cfe52d7f548aab6fa843e63b4ffaf8ab50030410..169ecaed6f864c28018fb3954fd50215ad9bab88 100644 (file)
@@ -222,6 +222,12 @@ func TestConversions(t *testing.T) {
                if ct.wantstr != "" && ct.wantstr != scanstr {
                        errf("want string %q, got %q", ct.wantstr, scanstr)
                }
+               if ct.wantbytes != nil && string(ct.wantbytes) != string(scanbytes) {
+                       errf("want byte %q, got %q", ct.wantbytes, scanbytes)
+               }
+               if ct.wantraw != nil && string(ct.wantraw) != string(scanraw) {
+                       errf("want RawBytes %q, got %q", ct.wantraw, scanraw)
+               }
                if ct.wantint != 0 && ct.wantint != intValue(ct.d) {
                        errf("want int %d, got %d", ct.wantint, intValue(ct.d))
                }