Fix crash during artifact download (#14147)

This commit is contained in:
Michael Goderbauer
2018-01-17 16:08:19 -08:00
committed by GitHub
parent bf7cc09625
commit a67df9e1d1
2 changed files with 12 additions and 3 deletions

View File

@@ -77,6 +77,14 @@ void main() {
verify(artifact2.update());
});
});
testUsingContext('flattenNameSubdirs', () {
expect(flattenNameSubdirs(Uri.parse('http://flutter.io/foo/bar')), 'flutter.io/foo/bar');
expect(flattenNameSubdirs(Uri.parse('http://docs.flutter.io/foo/bar')), 'docs.flutter.io/foo/bar');
expect(flattenNameSubdirs(Uri.parse('https://www.flutter.io')), 'www.flutter.io');
}, overrides: <Type, Generator>{
FileSystem: () => new MockFileSystem(),
});
}
class MockFileSystem extends MemoryFileSystem {