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

Unified Diff: utils/dartdoc/test/dartdoc_tests.dart

Issue 8958017: Don't fix up paths that are already absolute. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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
« no previous file with comments | « utils/dartdoc/files.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/dartdoc/test/dartdoc_tests.dart
diff --git a/utils/dartdoc/test/dartdoc_tests.dart b/utils/dartdoc/test/dartdoc_tests.dart
index 9ae5a2d87f407894f0a478ff766bbccda43d3fa8..2a4103c04272fd23b1af8f96979bda620c543e2b 100644
--- a/utils/dartdoc/test/dartdoc_tests.dart
+++ b/utils/dartdoc/test/dartdoc_tests.dart
@@ -47,7 +47,26 @@ main() {
});
});
+ group('isAbsolute', () {
+ test('returns false if there is no scheme', () {
+ expect(isAbsolute('index.html')).isFalse();
+ expect(isAbsolute('foo/index.html')).isFalse();
+ expect(isAbsolute('foo/bar/index.html')).isFalse();
+ });
+
+ test('returns true if there is a scheme', () {
+ expect(isAbsolute('http://google.com')).isTrue();
+ expect(isAbsolute('hTtPs://google.com')).isTrue();
+ expect(isAbsolute('mailto:fake@email.com')).isTrue();
+ });
+ });
+
group('relativePath', () {
+ test('absolute path is unchanged', () {
+ startFile('dir/sub/file.html');
+ expect(relativePath('http://google.com')).equals('http://google.com');
+ });
+
test('from root to root', () {
startFile('root.html');
expect(relativePath('other.html')).equals('other.html');
« no previous file with comments | « utils/dartdoc/files.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698