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..af8aaf5d046a18d92db61c966ebe53b3ba7b932e 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" expressions', () { |
expectParse('a in b', inExpr(ident('a'), ident('b'))); |
expectParse('a in b.c', |
inExpr(ident('a'), getter(ident('b'), 'c'))); |
@@ -176,6 +175,10 @@ 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); |
}); |