Skip to content

Commit

Permalink
Fixed tests on windows (#207)
Browse files Browse the repository at this point in the history

---------

Co-authored-by: Arjan Mels <[email protected]>
  • Loading branch information
arjanmels and Arjan Mels authored Nov 5, 2024
1 parent 8783b15 commit 6761199
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/src/tzdata/zone_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class LocationDescriptionDatabase {
LocationDescriptionDatabase(this.locations);

factory LocationDescriptionDatabase.fromString(String data) {
final lines = data.split('\n');
final lines = data.replaceAll('\r\n', '\n').split('\n');
final locations = <LocationDescription>[];
for (final line in lines) {
if (line.isEmpty || line[0].startsWith('#')) {
Expand Down
2 changes: 1 addition & 1 deletion test/zicfile_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void main() {
test('Read US/Eastern 2014h tzfile', () async {
var packageUri = Uri(scheme: 'package', path: 'timezone/timezone.dart');
var packagePath = p.dirname(
p.dirname((await Isolate.resolvePackageUri(packageUri))!.path));
p.dirname((await Isolate.resolvePackageUri(packageUri))!.toFilePath()));
var locationDir = p.join(packagePath, 'test');
var rawData =
await File(p.join(locationDir, 'data/US/Eastern')).readAsBytes();
Expand Down
2 changes: 1 addition & 1 deletion test/zone_tab_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void main() {
test('Read zone1970.tab file', () async {
var packageUri = Uri(scheme: 'package', path: 'timezone/timezone.dart');
var packagePath = p.dirname(
p.dirname((await Isolate.resolvePackageUri(packageUri))!.path));
p.dirname((await Isolate.resolvePackageUri(packageUri))!.toFilePath()));
var locationDir = p.join(packagePath, 'test');
var rawData =
await File(p.join(locationDir, 'data/zone1970.tab')).readAsString();
Expand Down
2 changes: 1 addition & 1 deletion tool/encode_tzf.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Future<void> main(List<String> arguments) async {
final files = await Glob('**').list(root: zoneinfoPath).toList();
for (final f in files) {
if (f is pkg_file.File) {
final name = p.relative(f.path, from: zoneinfoPath);
final name = p.relative(f.path, from: zoneinfoPath).replaceAll('\\', '/');
log.info('- $name');
db.add(tzfileLocationToNativeLocation(
tzfile.Location.fromBytes(name, await f.readAsBytes())));
Expand Down

0 comments on commit 6761199

Please sign in to comment.