diff --git a/test/explorer_test.dart b/test/explorer_test.dart index ac7624a..f2cfec6 100644 --- a/test/explorer_test.dart +++ b/test/explorer_test.dart @@ -1170,7 +1170,8 @@ void main() { await settle(tester, () => find.textContaining('비교하는 중').evaluate().isEmpty, rounds: 400); expect(find.text('$ls/ → $rs/'), findsOneWidget); expect(find.text('$rs/ → $ls/'), findsNothing); - expect(find.textContaining('-u'), findsNothing); + // 옵션 낱말 -u 만 (폴더 이름 vscode-stable-user-x64 같은 것은 아님 - 시험 임시 폴더 위가 %TEMP% 일 때) + expect(find.textContaining(RegExp(r'(^|\s)-u(\s|$)')), findsNothing); expect(find.text('빈 폴더 지움 · 원본 폴더는 남김'), findsNothing); await tester.tap(find.text('원본 파일 지우기 (--remove-source-files)')); await calm(tester); diff --git a/tool/test_temp_check.ps1 b/tool/test_temp_check.ps1 index d9a4638..9c5d360 100644 --- a/tool/test_temp_check.ps1 +++ b/tool/test_temp_check.ps1 @@ -5,7 +5,8 @@ # - 앱 코드 (lib) 가 시험 중에 만든 임시 폴더 (jj_up_ · jj_7z_ 등) 도 같은 곳에 생기므로 함께 잡힌다. # - 표는 환경 변수 JJ_TEST_TMP_TAG 로도 시험에 넘긴다: 시험 도우미 (test/support/temp_dirs.dart · integration_test/support/temp_dir.dart) # 가 임시 폴더가 그 안에 생기는지 확인한다 (통합 시험 -d windows 에서 앱까지 환경 변수가 가는지). -# - 끝나면 남은 jj 폴더의 이름을 보이고 (하나라도 있으면 실패, exit 2) 실행 폴더를 통째로 지운다. +# - 끝나면 남은 것을 보이고 실행 폴더를 통째로 지운다. 실패 (exit 2) 는 시험 소스가 만드는 이름 (createTemp('jj_x_') 등) 의 폴더가 남았을 때만 +# (앱 코드의 고정 이름 jj_mkvmaker · 파일 · 앱이 끝날 때까지 잡힌 jj_held_ 는 참고로만). # 사용 (app 폴더에서): powershell -ExecutionPolicy Bypass -File tool\test_temp_check.ps1 [flutter test 인자…] # 통합 시험 · 캡처도 (관리자 지시 10/19, 28 이 찾음): … test_temp_check.ps1 integration_test\windows_b6_shot_test.dart -d windows $ErrorActionPreference = 'Stop' @@ -37,11 +38,19 @@ Start-Sleep -Seconds 3 $items = @(Get-ChildItem -LiteralPath $run -Force -ErrorAction SilentlyContinue) # jj_held_ 는 앱이 끝날 때까지 놓지 않는 폴더 (integration_test/support/temp_dir.dart 의 heldByApp - Edge 사용자 데이터) - 보이기만 하고 아래에서 함께 지운다 $held = @($items | Where-Object { $_.Name -like 'jj_held_*' } | ForEach-Object { $_.Name }) -$left = @($items | Where-Object { $_.Name -like 'jj*' -and $_.Name -notlike 'jj_held_*' } | ForEach-Object { $_.Name }) -# 참고: jj 가 아닌 것 (flutter 도구 · 다른 프로그램이 만든 것 - 실패로 세지 않고 보이기만) -$other = @($items | Where-Object { $_.Name -notlike 'jj*' } | ForEach-Object { $_.Name }) +# 실패로 세는 것: 시험 소스가 만드는 이름 (createTemp('jj_x_') · testTempDir('jj_x_') · tempDirUntilEnd('jj_x_')) 의 폴더 (예전 검사와 같은 기준) +$prefixes = @(@('test', 'integration_test') | ForEach-Object { Join-Path $app $_ } | Where-Object { Test-Path $_ } | + ForEach-Object { Get-ChildItem $_ -Recurse -Filter *.dart } | + ForEach-Object { [regex]::Matches((Get-Content $_.FullName -Raw -Encoding utf8), '(?:createTemp(?:Sync)?|testTempDir|tempDirUntilEnd)\(''(jj[^''$]*)''') } | + ForEach-Object { $_.Groups[1].Value } | Sort-Object -Unique) +$left = @($items | Where-Object { $_.PSIsContainer -and $_.Name -notlike 'jj_held_*' } | Where-Object { + $n = $_.Name + @($prefixes | Where-Object { $n.StartsWith($_) }).Count -gt 0 + } | ForEach-Object { $_.Name }) +# 참고: 그 밖의 것 (flutter 도구 · 앱 코드의 고정 이름 jj_mkvmaker 등 · 파일 - 실패로 세지 않고 보이기만, 실행 폴더와 함께 지움) +$other = @($items | Where-Object { $_.Name -notlike 'jj_held_*' -and $left -notcontains $_.Name } | ForEach-Object { $_.Name }) if ($other.Count -gt 0) { - Write-Host ("참고 - jj 가 아닌 남은 것 {0}개:" -f $other.Count) + Write-Host ("참고 - 시험 이름이 아닌 남은 것 {0}개 (실행 폴더와 함께 지움):" -f $other.Count) $other | Sort-Object | ForEach-Object { Write-Host " $_" } } if ($held.Count -gt 0) {