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

Unified Diff: pkg/polymer_expressions/test/tokenizer_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
Index: pkg/polymer_expressions/test/tokenizer_test.dart
diff --git a/pkg/polymer_expressions/test/tokenizer_test.dart b/pkg/polymer_expressions/test/tokenizer_test.dart
index 6c4051400fc3508b39dbb3a855b9af1d9180b60d..a29ee649c78e8a89704fd17b0ae5e04621af99bc 100644
--- a/pkg/polymer_expressions/test/tokenizer_test.dart
+++ b/pkg/polymer_expressions/test/tokenizer_test.dart
@@ -58,6 +58,15 @@ main() {
t(IDENTIFIER_TOKEN, 'b')]);
});
+ test('should tokenize a ternary operator', () {
+ expectTokens('a ? b : c', [
+ t(IDENTIFIER_TOKEN, 'a'),
+ t(OPERATOR_TOKEN, '?'),
+ t(IDENTIFIER_TOKEN, 'b'),
+ t(COLON_TOKEN, ':'),
+ t(IDENTIFIER_TOKEN, 'c')]);
+ });
+
test('should tokenize an iterate expression with "in" keyword', () {
expectTokens('item in items', [
t(IDENTIFIER_TOKEN, 'item'),
@@ -153,11 +162,11 @@ class MatcherList extends Matcher {
for (int i = 0; i < o.length; i++) {
var state = new Map();
if (!matchers[i].matches(o[i], state)) {
- matchState = {
+ matchState.addAll({
'index': i,
'value': o[i],
'state': state,
- };
+ });
return false;
}
}
« pkg/polymer_expressions/test/eval_test.dart ('K') | « pkg/polymer_expressions/test/parser_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698