Skip to content

Commit

Permalink
Add tests for non en-US system locale
Browse files Browse the repository at this point in the history
  • Loading branch information
juliano-souza000 committed Nov 3, 2024
1 parent ba70aa4 commit dc82296
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/utils_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'dart:typed_data';

import 'package:intl/date_symbol_data_local.dart';
import 'package:intl/intl.dart';
import 'package:minio/src/utils.dart';
import 'package:test/test.dart';

Expand All @@ -25,6 +27,20 @@ void testRfc7231Time() {
expect(parseRfc7231Time(timeStringUtc), equals(timeUtc));
expect(parseRfc7231Time(timeStringUtc).isUtc, isTrue);
});

test(
'works for non en-US locale', () async {
initializeDateFormatting('pt_BR');
Intl.withLocale(
'pt_BR',
()
{
expect(parseRfc7231Time(timeStringUtc), equals(timeUtc));
expect(parseRfc7231Time(timeStringUtc).isUtc, isTrue);
}
);
}
);
});

group('toRfc7231Time', () {
Expand All @@ -35,6 +51,19 @@ void testRfc7231Time() {
test('works for GMT time', () {
expect(toRfc7231Time(timeUtc), equals(timeStringUtc));
});

test(
'works for non en-US locale', () async {
initializeDateFormatting('pt_BR');
Intl.withLocale(
'pt_BR',
()
{
expect(toRfc7231Time(timeUtc), equals(timeStringUtc));
}
);
}
);
});
}

Expand Down

0 comments on commit dc82296

Please sign in to comment.