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