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

Unified Diff: pkg/polymer_expressions/test/eval_test.dart

Issue 141703024: Refactor of PolymerExpressions. Adds "as" expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: syntax, bindings, and globals tests now passing in Safari Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/polymer_expressions/test/bindings_test.dart ('k') | pkg/polymer_expressions/test/globals_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer_expressions/test/eval_test.dart
diff --git a/pkg/polymer_expressions/test/eval_test.dart b/pkg/polymer_expressions/test/eval_test.dart
index 8ca3490946315ca92037400ec828c3479a49722a..213f17ba48deeeee732ade8a155f446cd9b43ec3 100644
--- a/pkg/polymer_expressions/test/eval_test.dart
+++ b/pkg/polymer_expressions/test/eval_test.dart
@@ -216,35 +216,8 @@ main() {
expectEval('a || b', false, null, {'a': null, 'b': null});
});
- test('should evaluate an "in" expression', () {
- var scope = new Scope(variables: {'items': [1, 2, 3]});
- var childScopes = eval(parse('item in items'), scope);
- expect(childScopes.length, 3);
- expect(childScopes[0].varName, 'item');
- expect(childScopes[0].value, 1);
- expect(childScopes[1].varName, 'item');
- expect(childScopes[1].value, 2);
- expect(childScopes[2].varName, 'item');
- expect(childScopes[2].value, 3);
- });
-
- test('should evaluate complex "in" expressions', () {
- var holder = new ListHolder([1, 2, 3]);
- var scope = new Scope(variables: {'holder': holder});
- var childScopes = eval(parse('item in holder.items'), scope);
- expect(childScopes.length, 3);
- expect(childScopes[0].varName, 'item');
- expect(childScopes[0].value, 1);
- expect(childScopes[1].varName, 'item');
- expect(childScopes[1].value, 2);
- expect(childScopes[2].varName, 'item');
- expect(childScopes[2].value, 3);
- });
-
- test('should handle null iterators in "in" expressions', () {
- var scope = new Scope(variables: {'items': null});
- var childScopes = eval(parse('item in items'), scope);
- expect(childScopes.length, 0);
+ test('should not evaluate "in" expressions', () {
+ expect(() => eval(parse('item in items'), null), throws);
});
});
@@ -351,20 +324,6 @@ main() {
);
});
- test('should observe an comprehension', () {
- var items = new ObservableList();
- var foo = new Foo(name: 'foo');
- return expectObserve('item in items',
- variables: {'items': items},
- beforeMatcher: (c) => c.isEmpty,
- mutate: () {
- items.add(foo);
- },
- afterMatcher:
- (c) => c.single.varName == 'item' && c.single.value == foo
- );
- });
-
});
}
« no previous file with comments | « pkg/polymer_expressions/test/bindings_test.dart ('k') | pkg/polymer_expressions/test/globals_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698