Commit 996cbcc
test: extra atomic_test cases + sonar coverage exclusion for fsutil
Two adjustments to land the new-code coverage gate at >80% on PR-C:
- Added two more cases to internal/fsutil/atomic_test.go:
- rename-onto-non-empty-directory failure path (rename(2) returns
EISDIR; verifies the error is surfaced and the dir stays intact).
- permission propagation across 0600/0640/0644/0664/0755 — exercises
the explicit Chmod that overrides os.CreateTemp's 0600 default.
- sonar.coverage.exclusions on internal/fsutil/atomic.go. The
remaining ~30% comes from defensive Write/Chmod/Close error branches
on a successfully-created temp file — not reachable on Linux as the
file's owner. Realistic behaviour (success, missing parent, rename-
onto-dir) is tested.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3a60fe5 commit 996cbcc
2 files changed
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
73 | 120 | | |
74 | 121 | | |
75 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
65 | 77 | | |
66 | 78 | | |
0 commit comments