убрана информация о паролях пользователя

This commit is contained in:
2026-08-30 02:16:26 +04:00
parent 25e7ad156b
commit dd189fe48f
5 changed files with 84 additions and 9 deletions
@@ -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#&|&#123456#&|&#0"\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';