LEFT | RIGHT |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package parser | 5 package parser |
6 | 6 |
7 import ( | 7 import ( |
| 8 "go/token" |
8 "os" | 9 "os" |
9 "testing" | 10 "testing" |
10 "go/token" | |
11 ) | 11 ) |
12 | 12 |
13 | 13 |
14 var fset = token.NewFileSet() | 14 var fset = token.NewFileSet() |
15 | 15 |
16 var illegalInputs = []interface{}{ | 16 var illegalInputs = []interface{}{ |
17 nil, | 17 nil, |
18 3.14, | 18 3.14, |
19 []byte(nil), | 19 []byte(nil), |
20 "foo!", | 20 "foo!", |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 if pkg == nil { | 103 if pkg == nil { |
104 t.Errorf(`package "parser" not found`) | 104 t.Errorf(`package "parser" not found`) |
105 return | 105 return |
106 } | 106 } |
107 for filename, _ := range pkg.Files { | 107 for filename, _ := range pkg.Files { |
108 if !nameFilter(filename) { | 108 if !nameFilter(filename) { |
109 t.Errorf("unexpected package file: %s", filename) | 109 t.Errorf("unexpected package file: %s", filename) |
110 } | 110 } |
111 } | 111 } |
112 } | 112 } |
LEFT | RIGHT |