Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Unified Diff: pkg/polymer/test/build/import_inliner_test.dart

Issue 433913002: Strip bindings before calling Uri.parse (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add support for [[ bindings and unify bindings regexes Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/polymer/test/build/import_inliner_test.dart
diff --git a/pkg/polymer/test/build/import_inliner_test.dart b/pkg/polymer/test/build/import_inliner_test.dart
index f6daa409ff7a720a50bf6723a0b76aa3e33bcd95..dcd2d181f885ee8c1b0f33bafd719e0403f847a3 100644
--- a/pkg/polymer/test/build/import_inliner_test.dart
+++ b/pkg/polymer/test/build/import_inliner_test.dart
@@ -173,11 +173,11 @@ void importTests() {
'<!DOCTYPE html><html><head>'
'<script type="application/dart">/*3*/</script>'
'</head></html>',
- 'a|web/*test_%foo_04!.html':
+ 'a|web/test_fo*o_04!.html':
'<!DOCTYPE html><html><head>'
'<script type="application/dart">/*4*/</script>'
'</head></html>',
- 'a|web/%05_test.html':
+ 'a|web/foo_05_test.html':
'<!DOCTYPE html><html><head>'
'<script type="application/dart">/*5*/</script>'
'</head></html>',
@@ -188,10 +188,10 @@ void importTests() {
'library a.web.foo_02_test_html_0;\n/*2*/', // Allows numbers in the middle.
'a|web/test_03.html.0.dart':
'library a.web.test_03_html_0;\n/*3*/', // Allows numbers at the end.
- 'a|web/*test_%foo_04!.html.0.dart':
- 'library a.web._test__foo_04__html_0;\n/*4*/', // Replaces invalid characters with _.
- 'a|web/%05_test.html.0.dart':
- 'library a.web._05_test_html_0;\n/*5*/', // Replace invalid character followed by number.
+ 'a|web/test_fo*o_04!.html.0.dart':
+ 'library a.web.test_fo_o_04__html_0;\n/*4*/', // Replaces invalid characters with _.
+ 'a|web/foo_05_test.html.0.dart':
+ 'library a.web.foo_05_test_html_0;\n/*5*/', // Replace invalid character followed by number.
});
testPhases('no transformation outside web/', phases,
@@ -883,6 +883,32 @@ void urlAttributeTests() {
'<img src="foo/{{bar}}">'
'</body></html>',
});
+
+ testPhases('arbitrary bindings can exist in paths', phases, {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head></head><body>'
+ '<img src="./{{(bar[2] + baz[\'foo\']) * 14 / foobar() - 0.5}}.jpg">'
+ '<img src="./[[bar[2]]].jpg">'
+ '</body></html>',
+ }, {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head></head><body>'
+ '<img src="{{(bar[2] + baz[\'foo\']) * 14 / foobar() - 0.5}}.jpg">'
+ '<img src="[[bar[2]]].jpg">'
+ '</body></html>',
+ });
+
+ testPhases('multiple bindings can exist in paths', phases, {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head></head><body>'
+ '<img src="./{{bar[0]}}/{{baz[1]}}.{{extension}}">'
+ '</body></html>',
+ }, {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head></head><body>'
+ '<img src="{{bar[0]}}/{{baz[1]}}.{{extension}}">'
+ '</body></html>',
+ });
}
void entryPointTests() {

Powered by Google App Engine
This is Rietveld 408576698