From b2c400a0fb6662e27043910c57f7408b6fc5512d Mon Sep 17 00:00:00 2001 From: RyuJongJin <266630912+RyuJongJin@users.noreply.github.com> Date: Tue, 20 Oct 2026 13:35:16 +0900 Subject: [PATCH] =?UTF-8?q?WIP=20=EC=8B=9C=ED=97=98:=20=EC=BC=A4=20?= =?UTF-8?q?=EB=95=8C=20=EC=A7=80=EC=9A=B0=EB=8A=94=20=EA=B2=83=EC=9D=80=20?= =?UTF-8?q?=EC=95=B1=EC=9D=B4=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8=20?= =?UTF-8?q?=EB=95=8C=20=EB=A7=8C=EB=93=A0=20=EC=9D=B4=EB=A6=84=EB=A7=8C=20?= =?UTF-8?q?-=20=EB=8B=A4=EB=A5=B8=20jj=20=EC=9D=B4=EB=A6=84=20(=EC=95=B1?= =?UTF-8?q?=20=EC=9E=84=EC=8B=9C=20=ED=8F=B4=EB=8D=94=20=C2=B7=20=EB=8F=84?= =?UTF-8?q?=EA=B5=AC=20=EB=B0=9B=EA=B8=B0=20=C2=B7=20Chrome=20=EC=97=94?= =?UTF-8?q?=EC=A7=84=20=C2=B7=20=EB=B9=84=EC=8A=B7=ED=95=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84)=20=EC=9D=80=20=EB=82=A8=EA=B9=80=20(=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=EC=9E=90=20=EC=A7=80=EC=8B=9C=2010/20,=20=EA=B2=80?= =?UTF-8?q?=ED=86=A0=20=EB=8C=80=EA=B8=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- test/cleanup_test.dart | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/test/cleanup_test.dart b/test/cleanup_test.dart index aabe8d7..9812c9d 100644 --- a/test/cleanup_test.dart +++ b/test/cleanup_test.dart @@ -143,7 +143,7 @@ void main() { expect(Cleaner.sizeText(5 * 1024 * 1024), '5.0 MB'); expect(Cleaner.sizeText(3 * 1024 * 1024 * 1024), '3.0 GB'); }); - test('관리자 지시 (10/20): 앱이 켜질 때 지난 업데이트가 남긴 것 (풀어 둔 새 판 · .ps1 · .log) 을 지운다 - 막 생긴 것 · 다른 것은 남김', () { + test('관리자 지시 (10/20): 앱이 켜질 때 지난 업데이트가 남긴 것 (풀어 둔 새 판 · .ps1 · .log) 만 지운다 - 막 생긴 것 · 다른 jj 이름은 남김', () { final tmp = Directory.systemTemp.createTempSync('jj_upd_left_'); addTearDown(() => tmp.deleteSync(recursive: true)); final old = DateTime.now().subtract(const Duration(hours: 1)); @@ -155,16 +155,21 @@ void main() { make(p.join('jj_mkvmaker_update_2026.10.18_979', 'extract', 'jj_mkvmaker.exe')); make('jj_mkvmaker_update.ps1'); make('jj_mkvmaker_update.log', fresh: true); // 교체 스크립트가 막 쓴 것 - make('jj_mkvmaker_updater.txt'); - make(p.join('jj_mkvmaker', 'a.wav')); + // 앱 자신이 업데이트 때 만든 이름만 지운다 - 다른 jj 이름 (앱 임시 폴더 · 도구 받기 · Chrome 엔진 · 비슷한 이름) 은 건드리지 않음 + final others = ['jj_mkvmaker_updater.txt', p.join('jj_mkvmaker', 'a.wav'), 'jj_ffmpeg.download', p.join('jj_cef_1', 'x'), p.join('jj_tool_1', 'x'), + p.join('jj_mkvmaker_update', 'x'), 'jj_mkvmaker_update.txt', p.join('jj_other_update_1', 'x')]; + for (final o in others) { + make(o); + } // 폴더는 안에 파일을 만들어 바뀐 때가 지금이다 - 5분 뒤로 보고 지우는지 본다 final dir = Directory(p.join(tmp.path, 'jj_mkvmaker_update_2026.10.18_979')); final gone = removeUpdateLeftovers(tmp.path, now: DateTime.now().add(const Duration(minutes: 5))); expect(gone..sort(), ['jj_mkvmaker_update.log', 'jj_mkvmaker_update.ps1', 'jj_mkvmaker_update_2026.10.18_979'], reason: '5분 뒤로 보면 막 생긴 기록도 2분이 지남'); expect(dir.existsSync(), isFalse); - expect(File(p.join(tmp.path, 'jj_mkvmaker_updater.txt')).existsSync(), isTrue); - expect(Directory(p.join(tmp.path, 'jj_mkvmaker')).existsSync(), isTrue); + for (final o in others) { + expect(File(p.join(tmp.path, o)).existsSync(), isTrue, reason: '$o 는 남김'); + } make('jj_mkvmaker_update.log', fresh: true); expect(removeUpdateLeftovers(tmp.path), isEmpty, reason: '2분이 안 된 것은 남김 (스크립트가 끝나는 중일 수 있음)');