summaryrefslogtreecommitdiff
path: root/internal/store/data_test.go
AgeCommit message (Collapse)Author
2026-03-02store: make Data carry injected deps (task 402)Paul Buetow
2026-03-02store: decouple crypto/git via interfaces (task 402)Paul Buetow
2026-02-22Rename binary from geheim to foostorePaul Buetow
- go.mod: module path codeberg.org/snonux/geheim → codeberg.org/snonux/foostore - cmd/geheim/ → cmd/foostore/ - Magefile.go: binary/binaryName/mainPkg constants updated - internal/config: config file path ~/.config/geheim.json → ~/.config/foostore.json - All import paths and comments updated throughout - Delete geheim.rb (the original Ruby implementation, superseded by this Go rewrite) - CLAUDE.md rewritten to reflect the Go implementation, new binary name, build system (mage), and current package architecture Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22Address store package review findings (task 352/store)Paul Buetow
Fix CommitIndex to respect force=false by checking os.Stat before writing, mirroring the Data.Commit behaviour and keeping index/data pairs consistent. Skip .git directory in WalkIndexes via filepath.SkipDir to avoid spurious errors or false matches inside the git metadata tree. Make ShredAllExported continue past individual shred errors and return the last error, matching Ruby's best-effort shredding behaviour. Accept io.Reader in Store.Remove instead of hardwiring os.Stdin, enabling deterministic testing via strings.NewReader injection. Fix runFzf comment to state that any non-zero fzf exit is treated as no selection (not only exit 130). Document ImportRecursive divergence from Ruby basename-flattening behaviour. Add 14 new tests: Search, SearchActionCat, SearchActionCatBinarySkip, ShredAllExported, SearchActionExport, ImportRecursive, ReimportAfterExport, RemoveInteractive, RemoveInteractiveDecline, CommitIndexSkipsExisting, LoadIndexMissingFile, LoadIndexCorrupted, LoadDataMissingFile, LoadDataCorrupted, DataExportUnwritable, HashPathEdgeCases, ImportMissingSourceFile, WalkIndexesInvalidRegex. Improve TestIndexSort to call sort.Sort and assert final order. Remove orphaned section-header comment from store_test.go. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22Implement store package with full test coverage (task 352/store)Paul Buetow
Adds internal/store with Index, Data, and Store types that mirror the Ruby Index, GeheimData, and Geheim classes. All 22 tests pass including AddAndSearch, Import, Export, Remove, HashPath, IsBinary, and sort interface. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>