Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 3ce88d2

Browse files
committed
Address nits
1 parent 75dd544 commit 3ce88d2

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import 'package:win32/win32.dart';
1313

1414
import 'folders.dart';
1515

16-
/// Constant for en-US language used in VersionInfo keys
16+
/// Constant for en-US language used in VersionInfo keys.
1717
@visibleForTesting
1818
const String languageEn = '0409';
1919

@@ -43,6 +43,8 @@ class VersionInfoQuerier {
4343
required String language,
4444
required String encoding,
4545
}) {
46+
assert(language.isNotEmpty);
47+
assert(encoding.isNotEmpty);
4648
if (versionInfo == null) {
4749
return null;
4850
}

packages/path_provider/path_provider_windows/test/path_provider_windows_test.dart

+8-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ import 'package:path_provider_windows/src/path_provider_windows_real.dart'
1212

1313
// A fake VersionInfoQuerier that just returns preset responses.
1414
class FakeVersionInfoQuerier implements VersionInfoQuerier {
15-
FakeVersionInfoQuerier(this.responses,
16-
[this.language = languageEn, this.encoding = encodingUnicode]);
15+
FakeVersionInfoQuerier(
16+
this.responses, {
17+
this.language = languageEn,
18+
this.encoding = encodingUnicode,
19+
});
1720

1821
final String language;
1922
final String encoding;
@@ -60,7 +63,7 @@ void main() {
6063
pathProvider.versionInfoQuerier = FakeVersionInfoQuerier(<String, String>{
6164
'CompanyName': 'A Company',
6265
'ProductName': 'Amazing App',
63-
}, languageEn, encodingCP1252);
66+
}, language: languageEn, encoding: encodingCP1252);
6467
final String? path = await pathProvider.getApplicationSupportPath();
6568
expect(path, isNotNull);
6669
if (path != null) {
@@ -74,7 +77,7 @@ void main() {
7477
pathProvider.versionInfoQuerier = FakeVersionInfoQuerier(<String, String>{
7578
'CompanyName': 'A Company',
7679
'ProductName': 'Amazing App',
77-
}, languageEn, encodingUnicode);
80+
}, language: languageEn, encoding: encodingUnicode);
7881
final String? path = await pathProvider.getApplicationSupportPath();
7982
expect(path, isNotNull);
8083
if (path != null) {
@@ -90,7 +93,7 @@ void main() {
9093
pathProvider.versionInfoQuerier = FakeVersionInfoQuerier(<String, String>{
9194
'CompanyName': 'A Company',
9295
'ProductName': 'Amazing App',
93-
}, '0000', '0000');
96+
}, language: '0000', encoding: '0000');
9497
final String? path = await pathProvider.getApplicationSupportPath();
9598
expect(path, contains(r'C:\'));
9699
expect(path, contains(r'AppData'));

0 commit comments

Comments
 (0)