-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved some of the tests around, and added a new http test.
- Loading branch information
Showing
4 changed files
with
114 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import 'package:pmtiles/pmtiles.dart'; | ||
import 'package:test/test.dart'; | ||
import 'package:http/http.dart' as http; | ||
|
||
import 'io_helpers.dart'; | ||
|
||
void main() async { | ||
late HttpAt at; | ||
|
||
setUpAll(() async { | ||
final httpUrl = await startHttpServer(); | ||
|
||
final client = http.Client(); | ||
at = HttpAt(client, Uri.parse('$httpUrl/countries-leaf.pmtiles')); | ||
}); | ||
|
||
test('Http.ReadAt', () async { | ||
for (final size in [1024, 1024 * 1024, 1024 * 1024 * 7]) { | ||
final s = await at.readAt(0, size); | ||
final bytes = await s.toBytes(); | ||
|
||
expect(bytes.length, size); | ||
} | ||
}); | ||
|
||
test('Http.ReadAt with offset', () async { | ||
for (final size in [1024, 1024 * 1024, 1024 * 1024 * 7]) { | ||
final s = await at.readAt(8978, size); | ||
final bytes = await s.toBytes(); | ||
|
||
expect(bytes.length, size); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...pmtiles_tests/test/archive_test_test.dart → ...s/pmtiles_tests/test/io_helpers_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters