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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/constant/ConstantEvaluatorTest.java

Issue 581773002: Implement new constant expressions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/constant/ConstantEvaluatorTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/constant/ConstantEvaluatorTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/constant/ConstantEvaluatorTest.java
index 3aaf9246e62eeaffebc04550f314a240998a07b1..3c93491fb1b396113f4cfd1e6b2ea231cb90a048 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/constant/ConstantEvaluatorTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/constant/ConstantEvaluatorTest.java
@@ -313,6 +313,10 @@ public class ConstantEvaluatorTest extends ResolverTestCase {
assertValue(5L, "2 + 3");
}
+ public void test_plus_string_string() throws Exception {
+ assertValue("ab", "'a' + 'b'");
+ }
+
public void test_remainder_double_double() throws Exception {
assertValue(3.2 % 2.3, "3.2 % 2.3");
}
@@ -325,6 +329,14 @@ public class ConstantEvaluatorTest extends ResolverTestCase {
assertValue(16L, "64 >> 2");
}
+ public void test_stringLength_complex() throws Exception {
+ assertValue(6L, "('qwe' + 'rty').length");
+ }
+
+ public void test_stringLength_simple() throws Exception {
+ assertValue(6L, "'Dvorak'.length");
+ }
+
public void test_times_double_double() throws Exception {
assertValue(2.3 * 3.2, "2.3 * 3.2");
}

Powered by Google App Engine
This is Rietveld 408576698