Skip to content

test: add unit tests for CSV import parseDate - #137

Open
oliveicila-afk wants to merge 1 commit into
Tanq16:mainfrom
oliveicila-afk:test/parse-date-unit-tests
Open

oliveicila-afk wants to merge 1 commit into
Tanq16:mainfrom
oliveicila-afk:test/parse-date-unit-tests

Conversation

@oliveicila-afk

Copy link
Copy Markdown

Summary

The project currently has no test files (internal/api, internal/storage, etc. are all untested). This adds a first, small unit test suite for parseDate in internal/api/import-export.go, the pure function used by CSV import to parse expense dates.

Covers:

  • RFC3339 timestamps
  • YYYY-MM-DD dates
  • The short, human-written form documented in the README (e.g. 2012/8/14)
  • The ambiguous DD/MM case, which the README explicitly says is rejected (not MM/DD or DD/MM)
  • Invalid input

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 ./... — succeeds
  • go vet ./... — clean
  • gofmt -l — no formatting issues
  • go test ./... — all tests pass, including the new TestParseDate (6/6 subtests)

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant