OLD | NEW |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 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 template | 5 package template |
6 | 6 |
7 import ( | 7 import ( |
8 "reflect" | 8 "reflect" |
9 "testing" | 9 "testing" |
10 ) | 10 ) |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 items = append(items, item) | 133 items = append(items, item) |
134 if item.typ == itemEOF || item.typ == itemError { | 134 if item.typ == itemEOF || item.typ == itemError { |
135 break | 135 break |
136 } | 136 } |
137 } | 137 } |
138 return | 138 return |
139 } | 139 } |
140 | 140 |
141 func TestLex(t *testing.T) { | 141 func TestLex(t *testing.T) { |
142 for _, test := range lexTests { | 142 for _, test := range lexTests { |
143 println(test.name) | |
144 items := collect(&test) | 143 items := collect(&test) |
145 if !reflect.DeepEqual(items, test.items) { | 144 if !reflect.DeepEqual(items, test.items) { |
146 t.Errorf("%s: got\n\t%v\nexpected\n\t%v", test.name, ite
ms, test.items) | 145 t.Errorf("%s: got\n\t%v\nexpected\n\t%v", test.name, ite
ms, test.items) |
147 } | 146 } |
148 } | 147 } |
149 } | 148 } |
OLD | NEW |