Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: pkg/polymer_expressions/test/parser_test.dart

Issue 139903008: List literals in polymer_expressions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library parser_test; 5 library parser_test;
6 6
7 import 'package:polymer_expressions/parser.dart'; 7 import 'package:polymer_expressions/parser.dart';
8 import 'package:polymer_expressions/expression.dart'; 8 import 'package:polymer_expressions/expression.dart';
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 10
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 expectParse("{'a': foo('a')}", 203 expectParse("{'a': foo('a')}",
204 mapLiteral([mapLiteralEntry( 204 mapLiteral([mapLiteralEntry(
205 literal('a'), invoke(ident('foo'), null, [literal('a')]))])); 205 literal('a'), invoke(ident('foo'), null, [literal('a')]))]));
206 }); 206 });
207 207
208 test('should parse map literals with method calls', () { 208 test('should parse map literals with method calls', () {
209 expectParse("{'a': 1}.length", 209 expectParse("{'a': 1}.length",
210 getter(mapLiteral([mapLiteralEntry(literal('a'), literal(1))]), 210 getter(mapLiteral([mapLiteralEntry(literal('a'), literal(1))]),
211 'length')); 211 'length'));
212 }); 212 });
213
214 test('should parse list literals', () {
215 expectParse('[1, "a", b]',
216 listLiteral([literal(1), literal('a'), ident('b')]));
217 expectParse('[[1, 2], [3, 4]]',
218 listLiteral([listLiteral([literal(1), literal(2)]),
219 listLiteral([literal(3), literal(4)])]));
220 });
213 }); 221 });
214 } 222 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698