Examples of checkTreeEquals()


Examples of com.google.javascript.rhino.Node.checkTreeEquals()

    Node root = compiler.getRoot().getLastChild();
    if (useStringComparison) {
      assertEquals(Joiner.on("").join(compiled), compiler.toSource());
    } else {
      Node expectedRoot = parse(compiled);
      String explanation = expectedRoot.checkTreeEquals(root);
      assertNull("\nExpected: " + compiler.toSource(expectedRoot) +
          "\nResult: " + compiler.toSource(root) +
          "\n" + explanation, explanation);
    }
  }
View Full Code Here

Examples of com.google.javascript.rhino.Node.checkTreeEquals()

        if (compareAsTree) {
          String explanation;
          if (compareJsDoc) {
            explanation = expectedRoot.checkTreeEqualsIncludingJsDoc(mainRoot);
          } else {
            explanation = expectedRoot.checkTreeEquals(mainRoot);
          }
          assertNull(
              "\nExpected: " + compiler.toSource(expectedRoot) +
              "\nResult:   " + compiler.toSource(mainRoot) +
              "\n" + explanation, explanation);
View Full Code Here

Examples of com.google.javascript.rhino.Node.checkTreeEquals()

          normalizeCheckRootClone.getFirstChild();
      Node normalizeCheckMainRootClone = normalizeCheckRootClone.getLastChild();
      new PrepareAst(compiler).process(
          normalizeCheckExternsRootClone, normalizeCheckMainRootClone);
      String explanation =
          normalizeCheckMainRootClone.checkTreeEquals(mainRoot);
      assertNull("Node structure normalization invalidated." +
          "\nExpected: " +
          compiler.toSource(normalizeCheckMainRootClone) +
          "\nResult:   " + compiler.toSource(mainRoot) +
          "\n" + explanation, explanation);
View Full Code Here

Examples of com.google.javascript.rhino.Node.checkTreeEquals()

      // (Closure primitive rewrites, etc) runs before the Normalize pass,
      // so this can't be force on everywhere.
      if (normalizeEnabled) {
        new Normalize(compiler, true).process(
            normalizeCheckExternsRootClone, normalizeCheckMainRootClone);
        explanation =  normalizeCheckMainRootClone.checkTreeEquals(mainRoot);
        assertNull("Normalization invalidated." +
            "\nExpected: " +
            compiler.toSource(normalizeCheckMainRootClone) +
            "\nResult:   " + compiler.toSource(mainRoot) +
            "\n" + explanation, explanation);
View Full Code Here

Examples of com.google.javascript.rhino.Node.checkTreeEquals()

        : IR.string("");
    Node newBlockNode = IR.block(IR.returnNode(valueNode));

    // TODO(user): checkTreeEqual is overkill. I am in process of rewriting
    // these functions.
    if (newBlockNode.checkTreeEquals(oldBlockNode) != null) {
      newBlockNode.copyInformationFromForTree(oldBlockNode);
      functionNode.replaceChild(oldBlockNode, newBlockNode);
      compiler.reportCodeChange();
    }
  }
View Full Code Here

Examples of com.google.javascript.rhino.Node.checkTreeEquals()

        "Warnings: \n" + Joiner.on("\n").join(compiler.getWarnings()),
        0, compiler.getErrors().length + compiler.getWarnings().length);

    Node root = compiler.getRoot().getLastChild();
    Node expectedRoot = parseExpectedCode(compiled, options, normalizeResults);
    String explanation = expectedRoot.checkTreeEquals(root);
    assertNull("\nExpected: " + compiler.toSource(expectedRoot) +
        "\nResult: " + compiler.toSource(root) +
        "\n" + explanation, explanation);
  }
View Full Code Here

Examples of com.google.javascript.rhino.Node.checkTreeEquals()

    }

    if (compiled != null) {
      Node root = compiler.getRoot().getLastChild();
      Node expectedRoot = parseExpectedCode(compiled, options, normalizeResults);
      String explanation = expectedRoot.checkTreeEquals(root);
      assertNull("\nExpected: " + compiler.toSource(expectedRoot) +
          "\nResult: " + compiler.toSource(root) +
          "\n" + explanation, explanation);
    }
  }
View Full Code Here

Examples of com.google.javascript.rhino.Node.checkTreeEquals()

    if (compiled != null) {
      Node root = compiler.getRoot().getLastChild();
      Node expectedRoot = parseExpectedCode(
          new String[] {compiled}, options, normalizeResults);
      String explanation = expectedRoot.checkTreeEquals(root);
      assertNull("\nExpected: " + compiler.toSource(expectedRoot) +
          "\nResult: " + compiler.toSource(root) +
          "\n" + explanation, explanation);
    }
  }
View Full Code Here

Examples of com.google.javascript.rhino.Node.checkTreeEquals()

    checkUnexpectedErrorsOrWarnings(compiler, warnings.length);

    if (compiled != null) {
      Node root = compiler.getRoot().getLastChild();
      Node expectedRoot = parseExpectedCode(compiled, options, normalizeResults);
      String explanation = expectedRoot.checkTreeEquals(root);
      assertNull("\nExpected: " + compiler.toSource(expectedRoot) +
          "\nResult: " + compiler.toSource(root) +
          "\n" + explanation, explanation);
    }
  }
View Full Code Here

Examples of com.google.javascript.rhino.Node.checkTreeEquals()

        assertTrue("compiler.reportCodeChange() should have been called",
            hasCodeChanged);
      }

      if (compareAsTree) {
        String explanation = expectedRoot.checkTreeEquals(mainRoot);
        assertNull("\nExpected: " + compiler.toSource(expectedRoot) +
            "\nResult: " + compiler.toSource(mainRoot) +
            "\n" + explanation, explanation);
      } else if (expected != null) {
        assertEquals(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.