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

Unified Diff: compiler/javatests/com/google/dart/compiler/backend/js/JavaScriptStringTest.java

Issue 9479013: Remove backends. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More clean up Created 8 years, 10 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: compiler/javatests/com/google/dart/compiler/backend/js/JavaScriptStringTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/backend/js/JavaScriptStringTest.java b/compiler/javatests/com/google/dart/compiler/backend/js/JavaScriptStringTest.java
deleted file mode 100644
index 0d592d3200aa25fcf0747c8f62535d3b5d07bac9..0000000000000000000000000000000000000000
--- a/compiler/javatests/com/google/dart/compiler/backend/js/JavaScriptStringTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-package com.google.dart.compiler.backend.js;
-
-import junit.framework.TestCase;
-
-import org.mozilla.javascript.Node;
-import org.mozilla.javascript.Parser;
-import org.mozilla.javascript.Token;
-import org.mozilla.javascript.ast.AstNode;
-import org.mozilla.javascript.ast.ExpressionStatement;
-import org.mozilla.javascript.ast.StringLiteral;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-/**
- * Tests {@link JsToStringGenerationVisitor#javaScriptString(String)}.
- */
-public class JavaScriptStringTest extends TestCase {
- private void test(String original) throws IOException {
- String escaped = JsToStringGenerationVisitor.javaScriptString(original);
-
- // Parse it back
- Parser parser = new Parser();
- AstNode node = parser.parse(new StringReader(escaped), "virtual file", 1);
- assertEquals(Token.SCRIPT, node.getType());
- Node exprResult = node.getFirstChild();
- assertEquals(Token.EXPR_RESULT, node.getFirstChild().getType());
- ExpressionStatement exprStatement = (ExpressionStatement) node.getFirstChild();
- assertEquals(Token.STRING, exprStatement.getExpression().getType());
- StringLiteral stringLiteral = (StringLiteral) exprStatement.getExpression();
- assertEquals(original, stringLiteral.getValue());
-
- // It should be the only token
- assertNull(node.getNext());
- }
-
- public void testBasic() throws IOException {
- test("abc");
- test("");
- test("abc\0def");
- test("abc\\def");
- test("\u00CC\u1234\5678\uabcd");
- test("'''");
- test("\"\"\"");
- test("\b\f\n\r\t");
- }
-}

Powered by Google App Engine
This is Rietveld 408576698