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

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

Issue 336013003: Version 1.5.0-dev.4.14 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 6 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: dart/pkg/polymer_expressions/test/eval_test.dart
===================================================================
--- dart/pkg/polymer_expressions/test/eval_test.dart (revision 37358)
+++ dart/pkg/polymer_expressions/test/eval_test.dart (working copy)
@@ -92,6 +92,13 @@
expectEval('1 != 2', true);
expectEval('1 != null', true);
+ var x = {};
+ var y = {};
+ expectEval('x === y', true, null, {'x': x, 'y': x});
+ expectEval('x !== y', false, null, {'x': x, 'y': x});
+ expectEval('x === y', false, null, {'x': x, 'y': y});
+ expectEval('x !== y', true, null, {'x': x, 'y': y});
+
expectEval('1 > 1', false);
expectEval('1 > 2', false);
expectEval('2 > 1', true);
@@ -418,12 +425,16 @@
Object evalString(String s, [Object model, Map vars]) =>
eval(new Parser(s).parse(), new Scope(model: model, variables: vars));
-expectEval(String s, dynamic matcher, [Object model, Map vars = const {}]) =>
- expect(
- eval(new Parser(s).parse(), new Scope(model: model, variables: vars)),
- matcher,
- reason: s);
+expectEval(String s, dynamic matcher, [Object model, Map vars = const {}]) {
+ var expr = new Parser(s).parse();
+ var scope = new Scope(model: model, variables: vars);
+ expect(eval(expr, scope), matcher, reason: s);
+ var observer = observe(expr, scope);
+ new Updater(scope).visit(observer);
+ expect(observer.currentValue, matcher, reason: s);
+}
+
expectObserve(String s, {
Object model,
Map variables: const {},
« no previous file with comments | « dart/pkg/polymer_expressions/test/bindings_test.dart ('k') | dart/pkg/polymer_expressions/test/globals_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698