Repository navigation
test: add unit tests for CSV import parseDate - #137
Open
oliveicila-afk wants to merge 1 commit into
Open
oliveicila-afk wants to merge 1 commit into
oliveicila-afk wants to merge 1 commit into
Conversation
Covers the date formats documented in the README (RFC3339, YYYY-MM-DD, and the short human-written form like 2012/8/14) plus the ambiguous DD/MM case that the README says is intentionally rejected, and an invalid-input case. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The project currently has no test files (
internal/api,internal/storage, etc. are all untested). This adds a first, small unit test suite forparseDateininternal/api/import-export.go, the pure function used by CSV import to parse expense dates.Covers:
YYYY-MM-DDdates2012/8/14)DD/MMcase, which the README explicitly says is rejected (notMM/DDorDD/MM)No production code was changed.
Disclosure
This is my first open-source contribution. The test was drafted with Claude (Anthropic's Claude Code) and reviewed by me before submitting.
Test plan
go build ./...— succeedsgo vet ./...— cleangofmt -l— no formatting issuesgo test ./...— all tests pass, including the newTestParseDate(6/6 subtests)🤖 Generated with Claude Code