убрана информация о паролях пользователя
This commit is contained in:
@@ -92,6 +92,30 @@ void main() {
|
||||
expect(await cacheDirectory.list().isEmpty, isTrue);
|
||||
});
|
||||
|
||||
test('removeSavedAccountName removes accountName lines only', () async {
|
||||
final configFile = File(
|
||||
'${rootDirectory.path}${Platform.pathSeparator}WTF${Platform.pathSeparator}Config.wtf',
|
||||
);
|
||||
await configFile.parent.create(recursive: true);
|
||||
await configFile.writeAsString(
|
||||
'SET gxWindow "1"\r\n'
|
||||
'SET accountName "admin#&|𞉀#&|�"\r\n'
|
||||
'set ACCOUNTNAME "another account"\r\n'
|
||||
'SET locale "ruRU"\r\n',
|
||||
);
|
||||
|
||||
await service.removeSavedAccountName(rootDirectory.path);
|
||||
|
||||
expect(
|
||||
await configFile.readAsString(),
|
||||
'SET gxWindow "1"\r\nSET locale "ruRU"\r\n',
|
||||
);
|
||||
});
|
||||
|
||||
test('removeSavedAccountName ignores a missing Config.wtf', () async {
|
||||
await service.removeSavedAccountName(rootDirectory.path);
|
||||
});
|
||||
|
||||
test('ensureParentDirectoryExists creates nested directories', () async {
|
||||
final tempPath =
|
||||
'${rootDirectory.path}${Platform.pathSeparator}Data${Platform.pathSeparator}patches${Platform.pathSeparator}common-2.MPQ.moonwell.part';
|
||||
|
||||
Reference in New Issue
Block a user