| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 package com.google.dart.compiler.end2end.inc; | 4 package com.google.dart.compiler.end2end.inc; |
| 5 | 5 |
| 6 import com.google.common.collect.Lists; | 6 import com.google.common.collect.Lists; |
| 7 import com.google.common.collect.Maps; | 7 import com.google.common.collect.Maps; |
| 8 import com.google.common.collect.Sets; | 8 import com.google.common.collect.Sets; |
| 9 import com.google.dart.compiler.CompilerTestCase; | 9 import com.google.dart.compiler.CompilerTestCase; |
| 10 import com.google.dart.compiler.DartCompilationError; | 10 import com.google.dart.compiler.DartCompilationError; |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 public void unitCompiled(DartUnit unit) { | 582 public void unitCompiled(DartUnit unit) { |
| 583 isCompiling = false; | 583 isCompiling = false; |
| 584 } | 584 } |
| 585 }; | 585 }; |
| 586 DartCompiler.compileLib(appSource, config, provider, listener); | 586 DartCompiler.compileLib(appSource, config, provider, listener); |
| 587 // Check that errors where reported (and in correct time). | 587 // Check that errors where reported (and in correct time). |
| 588 assertErrors(errors, errEx(DartCompilerErrorCode.MISSING_SOURCE, 3, 1, 29)); | 588 assertErrors(errors, errEx(DartCompilerErrorCode.MISSING_SOURCE, 3, 1, 29)); |
| 589 } | 589 } |
| 590 | 590 |
| 591 /** | 591 /** |
| 592 * <p> |
| 593 * http://code.google.com/p/dart/issues/detail?id=6859 |
| 594 */ |
| 595 public void test_reportMissingImport_dart() throws Exception { |
| 596 appSource.setContent( |
| 597 APP, |
| 598 makeCode( |
| 599 "// filler filler filler filler filler filler filler filler filler f
iller filler", |
| 600 "library app;", |
| 601 "import 'dart:mirrors as mirrors';", |
| 602 "")); |
| 603 compile(); |
| 604 // Check that errors where reported (and in correct time). |
| 605 assertErrors(errors, errEx(DartCompilerErrorCode.MISSING_SOURCE, 3, 1, 33)); |
| 606 } |
| 607 |
| 608 /** |
| 592 * Test that same prefix can be used to import several libraries. | 609 * Test that same prefix can be used to import several libraries. |
| 593 */ | 610 */ |
| 594 public void test_samePrefix_severalLibraries() throws Exception { | 611 public void test_samePrefix_severalLibraries() throws Exception { |
| 595 appSource.setContent( | 612 appSource.setContent( |
| 596 APP, | 613 APP, |
| 597 makeCode( | 614 makeCode( |
| 598 "// filler filler filler filler filler filler filler filler filler f
iller filler", | 615 "// filler filler filler filler filler filler filler filler filler f
iller filler", |
| 599 "library application;", | 616 "library application;", |
| 600 "import 'A.dart' as p;", | 617 "import 'A.dart' as p;", |
| 601 "import 'B.dart' as p;", | 618 "import 'B.dart' as p;", |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1690 private void didWrite(String sourceName, String extension) { | 1707 private void didWrite(String sourceName, String extension) { |
| 1691 String spec = sourceName + "/" + extension; | 1708 String spec = sourceName + "/" + extension; |
| 1692 assertTrue("Expected write: " + spec, provider.writes.contains(spec)); | 1709 assertTrue("Expected write: " + spec, provider.writes.contains(spec)); |
| 1693 } | 1710 } |
| 1694 | 1711 |
| 1695 private void didNotWrite(String sourceName, String extension) { | 1712 private void didNotWrite(String sourceName, String extension) { |
| 1696 String spec = sourceName + "/" + extension; | 1713 String spec = sourceName + "/" + extension; |
| 1697 assertFalse("Didn't expect write: " + spec, provider.writes.contains(spec)); | 1714 assertFalse("Didn't expect write: " + spec, provider.writes.contains(spec)); |
| 1698 } | 1715 } |
| 1699 } | 1716 } |
| OLD | NEW |