1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
13 type atobTest struct {
19 var atobtests = []atobTest{
20 {"", false, os.EINVAL},
21 {"asdf", false, os.EINVAL},
25 {"FALSE", false, nil},
26 {"false", false, nil},
34 func TestAtob(t *testing.T) {
35 for _, test := range atobtests {
40 t.Errorf("%s: expected %s but got nil", test.in, test.err)
42 // NumError assertion must succeed; it's the only thing we return.
43 if test.err != e.(*NumError).Error {
44 t.Errorf("%s: expected %s but got %s", test.in, test.err, e)
49 t.Errorf("%s: expected no error but got %s", test.in, test.err, e)
52 t.Errorf("%s: expected %t but got %t", test.in, test.out, b)