| Index: compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
|
| diff --git a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
|
| index d0eed60ac900cb6348c5ee21432c1491dd386629..8c6da26130eeaa7c5631dccf4d39ead78a9d8602 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
|
| @@ -9,7 +9,9 @@ import com.google.dart.compiler.DartCompilerListener;
|
| import com.google.dart.compiler.DartSourceTest;
|
| import com.google.dart.compiler.ast.DartAnnotation;
|
| import com.google.dart.compiler.ast.DartArrayLiteral;
|
| +import com.google.dart.compiler.ast.DartAssertStatement;
|
| import com.google.dart.compiler.ast.DartBinaryExpression;
|
| +import com.google.dart.compiler.ast.DartBooleanLiteral;
|
| import com.google.dart.compiler.ast.DartClass;
|
| import com.google.dart.compiler.ast.DartComment;
|
| import com.google.dart.compiler.ast.DartExprStmt;
|
| @@ -103,12 +105,28 @@ public class SyntaxTest extends AbstractParserTest {
|
| "}"));
|
| }
|
|
|
| + public void test_assertStatement() {
|
| + DartUnit unit = parseUnit("function.dart", Joiner.on("\n").join(
|
| + "main() {",
|
| + " assert(true);",
|
| + "}"
|
| + ));
|
| + assertNotNull(unit);
|
| + assertEquals(1, unit.getTopLevelNodes().size());
|
| + DartMethodDefinition function = (DartMethodDefinition) unit.getTopLevelNodes().get(0);
|
| + assertNotNull(function);
|
| + DartStatement statement = function.getFunction().getBody().getStatements().get(0);
|
| + assertTrue(statement instanceof DartAssertStatement);
|
| + DartExpression expression = ((DartAssertStatement) statement).getCondition();
|
| + assertTrue(expression instanceof DartBooleanLiteral);
|
| + }
|
| +
|
| public void test_functionExpression_asStatement() {
|
| DartUnit unit = parseUnit("function.dart", Joiner.on("\n").join(
|
| "main() {",
|
| " () {};",
|
| "}"
|
| - ));
|
| + ));
|
| assertNotNull(unit);
|
| assertEquals(1, unit.getTopLevelNodes().size());
|
| DartMethodDefinition function = (DartMethodDefinition) unit.getTopLevelNodes().get(0);
|
|
|