test/com/google/javascript/jscomp/IntegrationTestCase.java
/** Asserts that when compiling with the given compiler options, there is an error or warning. */
Asserts that when compiling with the given compiler options, there is an error or warning.
Asserts that when compiling with the given compiler options there is an error or warning .
protected void test(
      CompilerOptions options, String[] original, String[] compiled, DiagnosticType[] warnings) {
    Compiler compiler = compile(options, original);
    checkUnexpectedErrorsOrWarnings(compiler, warnings.length);
    if (compiled != null) {
      Node root = compiler.getRoot().getLastChild();
      Node expectedRoot = parseExpectedCode(compiled, options, normalizeResults);
      String explanation = expectedRoot.checkTreeEquals(root);
      assertWithMessage(
              "\nExpected: "
                  + compiler.toSource(expectedRoot)
                  + "\nResult:   "
                  + compiler.toSource(root)
                  + "\n"
                  + explanation)
          .that(explanation)
          .isNull();
    }
  }
protected void test ( CompilerOptions options , String [ ] original , String [ ] compiled , DiagnosticType [ ] warnings ) { Compiler compiler = compile ( options , original ) ; checkUnexpectedErrorsOrWarnings ( compiler , warnings . length ) ; if ( compiled != null ) { Node root = compiler . getRoot ( ) . getLastChild ( ) ; Node expectedRoot = parseExpectedCode ( compiled , options , normalizeResults ) ; String explanation = expectedRoot . checkTreeEquals ( root ) ; assertWithMessage ( "\nExpected: " + compiler . toSource ( expectedRoot ) + "\nResult:   " + compiler . toSource ( root ) + "\n" + explanation ) . that ( explanation ) . isNull ( ) ; } }
Asserts that when compiling with the given compiler options, there is an error or warning.
Asserts that when compiling with the given compiler options there is an error or warning .