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

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: Roll to latest version, simplified much of the scope creation Created 6 years, 8 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
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 2181215eb887734966d55aa0c17e4ef764e5d916..213f17ba48deeeee732ade8a155f446cd9b43ec3 100644
--- a/pkg/polymer_expressions/test/eval_test.dart
+++ b/pkg/polymer_expressions/test/eval_test.dart
@@ -216,24 +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 comprehension = eval(parse('item in items'), scope);
- expect(comprehension.iterable, orderedEquals([1, 2, 3]));
- });
-
- test('should evaluate complex "in" expressions', () {
- var holder = new ListHolder([1, 2, 3]);
- var scope = new Scope(variables: {'holder': holder});
- var comprehension = eval(parse('item in holder.items'), scope);
- expect(comprehension.iterable, orderedEquals([1, 2, 3]));
- });
-
- test('should handle null iterators in "in" expressions', () {
- var scope = new Scope(variables: {'items': null});
- var comprehension = eval(parse('item in items'), scope);
- expect(comprehension, isNotNull);
- expect(comprehension.iterable, []);
+ test('should not evaluate "in" expressions', () {
+ expect(() => eval(parse('item in items'), null), throws);
});
});
@@ -340,19 +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.iterable.isEmpty,
- mutate: () {
- items.add(foo);
- },
- afterMatcher: (c) => c.iterable.contains(foo)
- );
- });
-
});
}

Powered by Google App Engine
This is Rietveld 408576698