Add integration tests verifying isDayExpr() integration:
- TestResolveTimeRangeWithDefaultsToTomorrowEndOfDay: verifies
--to tomorrow expands to end-of-day (23:59:59.999999999)
- TestResolveTimeRangeWithDefaultsToNowNoExpansion: verifies
--to now does NOT expand to end-of-day (remains current time)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add boolTrue/boolFalse constants for string "true"/"false" values
- Rename shadowed err variable to writeErr in test file
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add integration tests verifying isDayExpr() integration:
- TestResolveTimeRangeWithDefaultsToTomorrowEndOfDay: verifies
--to tomorrow expands to end-of-day (23:59:59.999999999)
- TestResolveTimeRangeWithDefaultsToNowNoExpansion: verifies
--to now does NOT expand to end-of-day (remains current time)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Distinguish the update command from write by specifying it inserts
text at a specific index position in the document.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Test that --index flag properly rejects zero and negative values
with the expected error message.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Cover the readTextInput function and file path expansion logic
by testing DocsWriteCmd and DocsUpdateCmd with temp files.
Also test error cases: non-existent file, empty file, and
mutual exclusion of --text and --file flags.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add paragraph-number addressing (5d, 3s/.*/text/, $a/text/) and
`docs structure` / `docs cat -N` commands for paragraph-level
document manipulation.
New commands:
- `docs structure` — numbered paragraph list with types (text + JSON)
- `docs cat -N` — cat with [N] paragraph prefixes
Address syntax for `docs sed`:
- Nd (delete paragraph N), N,Md (range delete), $d (last)
- Ns/pat/repl/ (substitute within paragraph N)
- Na/text/ (append after N), Ni/text/ (insert before N)
- --tab flag for multi-tab document support
Testing:
- 24 new unit tests covering parseAddress (13 cases),
parseFullExpr_Addressed (10 cases), resolveAddress (6 cases),
and buildParagraphMap (8 cases). All pass.
- Manual testing against live Google Docs verified: structure,
cat -N, addressed substitute, delete, append, insert, dollar
addressing, and range delete.
- Bug found and fixed during manual testing: addressed a/text/
and i/text/ were parsed by parseAICommand (expects a/pat/text/)
which put text in the pattern field instead of replacement,
producing empty paragraphs. Added parseAddressedAICommand for
the single-field addressed form.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rename inner err to err2 in docs_sed.go and docs_sed_manual.go to fix shadow warnings
- Return non-nil empty response from batchUpdate when no requests (nilnil)
- Hardcode test constants for buildDocWithInlineImage helper (unparam)
* fix(gmail): decode ISO-2022-JP bodies
* fix(gmail): include cc/bcc in get output
* feat(calendar): allow selecting calendars in events
* test(gmail): add edge case tests for ISO-2022-JP decoding
Add tests for edge cases in ISO-2022-JP body decoding:
- Mixed ASCII and Japanese text (e.g., "Hello こんにちは World")
- Empty content with ISO-2022-JP charset header
- Malformed ISO-2022-JP sequences (graceful degradation)
- Truncated escape sequences
These tests verify the graceful fallback behavior in decodeBodyCharset
which returns original data if decoding fails.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(calendar): validate unknown calendar names in resolveCalendarIDs
When a calendar name doesn't match any known calendar (not in bySummary
or byID maps), return an error listing the unrecognized names instead
of treating them as raw calendar IDs which causes cryptic Google API
errors.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(calendar): validate unknown and ambiguous calendar name resolutions
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>