OLD | NEW |
1 // Copyright 2012 The Go Authors. All rights reserved. | 1 // Copyright 2012 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 // This file contains tests verifying the types associated with an AST after | 5 // This file contains tests verifying the types associated with an AST after |
6 // type checking. | 6 // type checking. |
7 | 7 |
8 package types | 8 package types |
9 | 9 |
10 import ( | 10 import ( |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // TODO(gri) writing the code below w/o the decl variable will | 164 // TODO(gri) writing the code below w/o the decl variable will |
165 // cause a 386 compiler error (out of fixed registers) | 165 // cause a 386 compiler error (out of fixed registers) |
166 decl := pkg.Files[filename].Decls[0].(*ast.GenDecl) | 166 decl := pkg.Files[filename].Decls[0].(*ast.GenDecl) |
167 expr := decl.Specs[0].(*ast.ValueSpec).Values[0] | 167 expr := decl.Specs[0].(*ast.ValueSpec).Values[0] |
168 str := exprString(expr) | 168 str := exprString(expr) |
169 if str != test.str { | 169 if str != test.str { |
170 t.Errorf("%s: got %s, want %s", test.src, str, test.str) | 170 t.Errorf("%s: got %s, want %s", test.src, str, test.str) |
171 } | 171 } |
172 } | 172 } |
173 } | 173 } |
OLD | NEW |