fix up tests
diff --git a/lib/build/html_import_annotation_inliner.dart b/lib/build/html_import_annotation_inliner.dart
index 491b4c7..ffb6668 100644
--- a/lib/build/html_import_annotation_inliner.dart
+++ b/lib/build/html_import_annotation_inliner.dart
@@ -63,8 +63,8 @@
var leftoverMatches = _htmlImportGeneral.allMatches(newDartCode);
for (var match in leftoverMatches) {
_logger.warning('Found HtmlImport constructor which was supplied an '
- 'expression. Only raw strings are currently supported: '
- '${match.group(0)}');
+ 'expression. Only raw strings are currently supported for the '
+ 'transformer, so ${match.group(1)} will be injected dynamically');
}
transform.addOutput(
new Asset.fromString(dartEntryPoint.id, newDartCode));
@@ -93,5 +93,5 @@
// Matches HtmlImport initializers which are supplied any arguments. This
// is used to detect if any were left over and not inlined.
final RegExp _htmlImportGeneral = new RegExp(
- r"\n\s*new InitEntry\(const i[\d]*\.HtmlImport\('([\w\.].*)'\),\s.*\),");
+ r"\n\s*new InitEntry\(const i[\d]*\.HtmlImport\(([\w\d\.]*)\),\s.*\),");
}
diff --git a/pubspec.yaml b/pubspec.yaml
index d761671..2fea43f 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -28,5 +28,8 @@
- initialize:
entry_point: test/html_import_annotation_test.dart
html_entry_point: test/html_import_annotation_test.html
+- web_components/build/html_import_annotation_inliner:
+ bootstrap_file: test/html_import_annotation_test.bootstrap.dart
+ html_entry_point: test/html_import_annotation_test.html
environment:
sdk: ">=1.4.0-dev.6.6 <2.0.0"
diff --git a/test/html_import_annotation_test.dart b/test/html_import_annotation_test.dart
index 65045d2..b5b2cc3 100644
--- a/test/html_import_annotation_test.dart
+++ b/test/html_import_annotation_test.dart
@@ -2,7 +2,8 @@
// 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.
@HtmlImport(importPath)
-@HtmlImport(badImportPath)
+ // This one will throw a build time warning, but should still work dynamically.
+@HtmlImport('bad_import.html')
library web_components.test.html_import_annotation;
import 'dart:html';
@@ -13,7 +14,6 @@
const String importPath = 'my_import.html';
-const String badImportPath = 'bad_import.html';
main() {
useHtmlConfiguration();
@@ -22,7 +22,7 @@
return init.run().then((_) {
var good = document.head.querySelector('link[href="$importPath"]');
expect(good.import.body.text, 'Hello world!\n');
- var bad = document.head.querySelector('link[href="$badImportPath"]');
+ var bad = document.head.querySelector('link[href="bad_import.html"]');
expect(bad.import, isNull);
});
});