Index: pkg/polymer_expressions/test/parser_test.dart |
diff --git a/pkg/polymer_expressions/test/parser_test.dart b/pkg/polymer_expressions/test/parser_test.dart |
index e57d11a3ccafb5ef1b997b9cc9c2822e459da791..d7f06ac25f19d38a19f61601b16efedab162a3b8 100644 |
--- a/pkg/polymer_expressions/test/parser_test.dart |
+++ b/pkg/polymer_expressions/test/parser_test.dart |
@@ -64,10 +64,9 @@ main() { |
test('should give multiply higher associativity than plus', () { |
expectParse('a + b * c', |
- binary( |
- ident('a'), |
- '+', |
- binary(ident('b'), '*', ident('c')))); |
+ binary(ident('a'), '+', binary(ident('b'), '*', ident('c')))); |
+ expectParse('a * b + c', |
+ binary(binary(ident('a'), '*', ident('b')), '+', ident('c'))); |
}); |
test('should parse a dot operator', () { |
@@ -164,7 +163,7 @@ main() { |
'|', ident('c'))); |
}); |
- test('should parse comprehension', () { |
+ test('should parse "in" expression', () { |
expectParse('a in b', inExpr(ident('a'), ident('b'))); |
expectParse('a in b.c', |
inExpr(ident('a'), getter(ident('b'), 'c'))); |
@@ -176,8 +175,15 @@ main() { |
expect(() => parse('a + 1 in b'), throwsException); |
}); |
+ test('should parse "as" expressions', () { |
+ expectParse('a as b', asExpr(ident('a'), ident('b'))); |
+ }); |
+ |
test('should reject keywords as identifiers', () { |
- expect(() => parse('a.in'), throwsException); |
+ expect(() => parse('a.in'), throws); |
+ expect(() => parse('a.as'), throws); |
+ // TODO: re-enable when 'this' is a keyword |
+// expect(() => parse('a.this'), throws); |
}); |
test('should parse map literals', () { |