From 8efcf186e66f5aca576e1b085f9301b2b97a8e2d Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Wed, 13 May 2026 07:40:12 +0200 Subject: [PATCH] test sweep: cover kernel ProjectManager + RecentProject (T-91) 18 tests in test/kernel/src/project_test.dart driving ProjectManager with an injected onValidateProject hook so the manager doesn't shell out to git in tests. Covers: - RecentProject: relativePath HOME collapsing, timeAgo bucketing (minutes / hours / yesterday / days / weeks / months), toJson / fromJson round-trip, fromJson tolerance for missing fields. - ProjectManager.open: non-git path (returns false), valid path (sets current, emits ProjectOpened, registers in recents), re-open deduplication, recents capped at 10. - ProjectManager.close: resets current, emits ProjectClosed, no-op when already closed. - ProjectManager.loadRecents: happy path, malformed-value tolerance, no-setting clears to empty. - ProjectManager.openLast: no-stored, stored-but-missing, stored-and-exists. - ProjectManager.resolveProject without injected validator falls back to Process.run. Coverage: kernel/src/project.dart 2/72 -> 66/72 (92%). Remaining 6 lines are the _currentBranch helper + ProjectOpened-event-time branch shake (need a real git in the sandbox to materialise the branch). Total coverage 81.64% -> 82.42%; floor bumped to 82. Co-Authored-By: Claude Opus 4.7 (1M context) --- pubspec.yaml | 2 +- test/kernel/src/project_test.dart | Bin 0 -> 8180 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 test/kernel/src/project_test.dart diff --git a/pubspec.yaml b/pubspec.yaml index 15919808..f6c010a2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,7 +18,7 @@ repository: https://github.com/postmeridiem/clide # Pre-push line-coverage floor. Ratchets up only — see D-66. # Reading: `awk -F: '/^coverage_floor:/ {gsub(/ /,"",$2); print $2}' pubspec.yaml`. -coverage_floor: 81 +coverage_floor: 82 # Project metadata (was project.yaml, folded in per D-056). # version: above is the single source of truth. The Makefile reads diff --git a/test/kernel/src/project_test.dart b/test/kernel/src/project_test.dart new file mode 100644 index 0000000000000000000000000000000000000000..a3915385df479101ac2de4660bd0c6cbb897231c GIT binary patch literal 8180 zcmd^ET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