test/com/google/javascript/jscomp/deps/DepsGeneratorTest.java
/** Ensures that an error is thrown when the closure_path flag is set incorrectly. */
Ensures that an error is thrown when the closure_path flag is set incorrectly.
Ensures that an error is thrown when the closure_path flag is set incorrectly .
@Test
  public void testDuplicateProvidesErrorThrownIfBadClosurePathSpecified() throws Exception {
    SourceFile fauxClosureDeps =
        SourceFile.fromCode("dep1.js", "goog.addDependency('foo/a.js', ['a'], []);\n");
    SourceFile fauxClosureSrc =
        SourceFile.fromCode("path/to/closure/foo/a.js", "goog.provide('a');\n");
    SourceFile userSrc =
        SourceFile.fromCode("my/package/script.js", "goog.require('a');\n"
            + "goog.provide('my.package.script');\n");
    doErrorMessagesRun(ImmutableList.of(fauxClosureDeps),
        ImmutableList.of(fauxClosureSrc, userSrc), true /* fatal */,
        "Namespace \"a\" is already provided in other file dep1.js");
  }
@ Test public void testDuplicateProvidesErrorThrownIfBadClosurePathSpecified ( ) throws Exception { SourceFile fauxClosureDeps = SourceFile . fromCode ( "dep1.js" , "goog.addDependency('foo/a.js', ['a'], []);\n" ) ; SourceFile fauxClosureSrc = SourceFile . fromCode ( "path/to/closure/foo/a.js" , "goog.provide('a');\n" ) ; SourceFile userSrc = SourceFile . fromCode ( "my/package/script.js" , "goog.require('a');\n" + "goog.provide('my.package.script');\n" ) ; doErrorMessagesRun ( ImmutableList . of ( fauxClosureDeps ) , ImmutableList . of ( fauxClosureSrc , userSrc ) , true /* fatal */ , "Namespace \"a\" is already provided in other file dep1.js" ) ; }
Ensures that an error is thrown when the closure_path flag is set incorrectly.
Ensures that an error is thrown when the closure_path flag is set incorrectly .
// Create a stub Closure Library. // Create a source file that depends on the stub Closure Library. // doErrorMessagesRun uses closure_path //javascript/closure and therefore // fails to recognize and de-dupe the stub Closure Library at // //path/to/closure.