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

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

Issue 131623004: Ternary operator support for 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 | « pkg/polymer_expressions/lib/visitor.dart ('k') | pkg/polymer_expressions/test/parser_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 3094994c9d740f4b934080a797187aff2467ddf7..744284e8ce0c1604f6b7ba22fd1786cca576f325 100644
--- a/pkg/polymer_expressions/test/eval_test.dart
+++ b/pkg/polymer_expressions/test/eval_test.dart
@@ -108,6 +108,16 @@ main() {
expectEval('false && false', false);
});
+ test('should evaulate ternary operators', () {
+ expectEval('true ? 1 : 2', 1);
+ expectEval('false ? 1 : 2', 2);
+ expectEval('true ? true ? 1 : 2 : 3', 1);
+ expectEval('true ? false ? 1 : 2 : 3', 2);
+ expectEval('false ? true ? 1 : 2 : 3', 3);
+ expectEval('false ? 1 : true ? 2 : 3', 2);
+ expectEval('false ? 1 : false ? 2 : 3', 3);
Jennifer Messerly 2014/01/28 00:03:29 maybe add a test for `null` and some other kind of
justinfagnani 2014/01/28 01:05:21 Done.
+ });
+
test('should invoke a method on the model', () {
var foo = new Foo(name: 'foo', age: 2);
expectEval('x()', foo.x(), foo);
« no previous file with comments | « pkg/polymer_expressions/lib/visitor.dart ('k') | pkg/polymer_expressions/test/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698