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

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

Issue 148523002: Add test for complex in expressions in polymer_expressions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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 | « no previous file | no next file » | 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 9445d8e0aac180fd7a58c0415d6326ab5c1214ae..9f623ce70cd2c0005137e417c119f841d26c815c 100644
--- a/pkg/polymer_expressions/test/eval_test.dart
+++ b/pkg/polymer_expressions/test/eval_test.dart
@@ -216,6 +216,13 @@ main() {
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);
@@ -361,6 +368,12 @@ class Foo extends ChangeNotifier {
int x() => age * age;
}
+@reflectable
+class ListHolder {
+ List items;
+ ListHolder(this.items);
+}
+
parseInt([int radix = 10]) => new IntToString(radix: radix);
class IntToString extends Transformer<int, String> {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698