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

Unified Diff: compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java

Issue 8513011: Sorted some files before refactoring (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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 | compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java b/compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java
index dfab34d3c02f2ab21d1accca23d99892be01b580..eada1dc43ca7240265f9f00b1564682e25a171f0 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java
@@ -245,52 +245,6 @@ public class CompileTimeConstantTest extends ResolverTestCase{
ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION_NUMBER);
}
- public void testConstantUnaryExpression() {
- resolveAndTest(Joiner.on("\n").join(
- "class Object {}",
- "class A {",
- " // Unary expression",
- " static final BOOL_LIT = true;",
- " static final INT_LIT = 123;",
- " static final DOUBLE_LIT = 12.3;",
- " static final UOP1_0 = !BOOL_LIT;",
- " static final UOP1_1 = BOOL_LIT || !true;",
- " static final UOP1_2 = !BOOL_LIT || true;",
- " static final UOP1_3 = !(BOOL_LIT && true);",
- " static final UOP2_0 = ~0xf0;",
- " static final UOP2_1 = ~INT_LIT;",
- " static final UOP2_2 = ~INT_LIT & 123;",
- " static final UOP2_3 = ~(INT_LIT | 0xff);",
- " static final UOP3_0 = -0xf0;",
- " static final UOP3_1 = -INT_LIT;",
- " static final UOP3_2 = -INT_LIT + 123;",
- " static final UOP3_3 = -(INT_LIT * 0xff);",
- " static final UOP3_4 = -0xf0;",
- " static final UOP3_5 = -DOUBLE_LIT;",
- " static final UOP3_6 = -DOUBLE_LIT + 123;",
- " static final UOP3_7 = -(DOUBLE_LIT * 0xff);",
- "}"));
-
- resolveAndTest(Joiner.on("\n").join(
- "class Object {}",
- "class int {}",
- "class A {",
- " // Unary expression",
- " static final BOOL_LIT = true;",
- " static int foo() { return 3; }",
- " static final UOP1 = !5;",
- " static final UOP2 = !foo();",
- " static final UOP3 = !(5);",
- " static final UOP4 = !(foo());",
- "}"),
- ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION_BOOLEAN,
- ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION,
- ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION_BOOLEAN,
- ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION_BOOLEAN,
- ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION,
- ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION_BOOLEAN);
- }
-
public void testConstantConstructorAssign() {
resolveAndTest(Joiner.on("\n").join(
@@ -391,6 +345,52 @@ public class CompileTimeConstantTest extends ResolverTestCase{
ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION);
}
+ public void testConstantUnaryExpression() {
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "class A {",
+ " // Unary expression",
+ " static final BOOL_LIT = true;",
+ " static final INT_LIT = 123;",
+ " static final DOUBLE_LIT = 12.3;",
+ " static final UOP1_0 = !BOOL_LIT;",
+ " static final UOP1_1 = BOOL_LIT || !true;",
+ " static final UOP1_2 = !BOOL_LIT || true;",
+ " static final UOP1_3 = !(BOOL_LIT && true);",
+ " static final UOP2_0 = ~0xf0;",
+ " static final UOP2_1 = ~INT_LIT;",
+ " static final UOP2_2 = ~INT_LIT & 123;",
+ " static final UOP2_3 = ~(INT_LIT | 0xff);",
+ " static final UOP3_0 = -0xf0;",
+ " static final UOP3_1 = -INT_LIT;",
+ " static final UOP3_2 = -INT_LIT + 123;",
+ " static final UOP3_3 = -(INT_LIT * 0xff);",
+ " static final UOP3_4 = -0xf0;",
+ " static final UOP3_5 = -DOUBLE_LIT;",
+ " static final UOP3_6 = -DOUBLE_LIT + 123;",
+ " static final UOP3_7 = -(DOUBLE_LIT * 0xff);",
+ "}"));
+
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "class int {}",
+ "class A {",
+ " // Unary expression",
+ " static final BOOL_LIT = true;",
+ " static int foo() { return 3; }",
+ " static final UOP1 = !5;",
+ " static final UOP2 = !foo();",
+ " static final UOP3 = !(5);",
+ " static final UOP4 = !(foo());",
+ "}"),
+ ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION_BOOLEAN,
+ ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION,
+ ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION_BOOLEAN,
+ ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION_BOOLEAN,
+ ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION,
+ ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION_BOOLEAN);
+ }
+
public void testConstantVariableAssign() {
resolveAndTest(Joiner.on("\n").join(
"class Object {}",
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698