summaryrefslogtreecommitdiff
path: root/internal/store/store_test.go
AgeCommit message (Collapse)Author
2026-03-02store/cli: move search output to CLI layer (task 400)Paul Buetow
2026-03-02store: make Data carry injected deps (task 402)Paul Buetow
2026-02-23Release v0.5.2v0.5.2Paul Buetow
2026-02-22Add unit tests to reach 63.3% coverage (task 335)Paul Buetow
- internal/shell/shell_internal_test.go (new): tests prefixCompleter.Do with table-driven cases covering empty prefix, partial match, no match, and multi-word line (prefix after space) - internal/cli/cli_test.go (new): tests pure helpers (logMsg, warn, printHelp, shredFile), dispatch paths with real store (ls, search, cat, rm, shred, get, paste, export, pathexport, open, edit, unknown command, empty argv), error paths for cmdAdd/cmdImport/cmdImportR, readPIN env-var path, completionFn commands-only path, makeActionFn nil cases - internal/store/store_test.go: added TestSearchActionPathExport, TestSearchActionWithCallback, TestSearchActionNilCallback, TestFzfEmpty, TestRemoveInteractiveInvalidThenDecline, TestImportForceOverwrite Total coverage: 44.8% → 63.3% Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>