Skip to content

Test(tasks): task output matches zn v0.18.1, and test data keeps LF - #56

Open
spirit-of-light wants to merge 4 commits into
ZenNotes:mainfrom
spirit-of-light:test/task-output-guards
Open

spirit-of-light wants to merge 4 commits into
ZenNotes:mainfrom
spirit-of-light:test/task-output-guards

Conversation

@spirit-of-light

Copy link
Copy Markdown
Contributor

Summary

This change adds tests that compare the task output of zn with zn v0.18.1. It is the first small PR from the review of #50. It changes no production code and no note format.

What changes

  • Task list and Tasks view: zn task list in text and JSON, the Tasks view of the terminal app, and a new task note give the same output as zn v0.18.1.
  • Released repeat values: a vault with only the @repeat: values of released zn (daily, weekly, weekdays, mon/thu and after-3d) and a date in @remind: lists the same text and JSON as zn v0.18.1.
  • Remote vaults: against a fake server, zn task list and the MCP tool list_tasks give the same bytes as zn v0.18.1, also with --all. A toggle of a @repeat: task on a remote vault writes the next open line and the finished line, in the CLI and in MCP.
  • .gitattributes: two lines keep LF in internal/cli/testdata and internal/tui/testdata, as you found on Feat(tasks): times, repeat rules, task notes, events, work sessions #50.

The tests from #50 that used syntax from that branch are not in this PR. No test in this PR makes a folder read-only, so no test must stop early on Windows.

Tests

  • go vet ./..., gofmt -l internal cmd and git diff --check show no problems.
  • go test -race ./... passes, except for TestManyControlSequencesRenderQuickly, which also fails under -race on a clean main.
  • The new tests pass in a clone with core.autocrlf=true, and in more than one time zone.
  • A zn binary from main gives the same bytes as each golden file.

Known limit

The Tasks view reads the system clock, and this PR changes no production code. Thus the Tasks view test can fail if it runs at midnight. A comment in the test gives this limit.

🤖 Generated with Claude Code

https://claude.ai/code/session_0171pE1tFQspTuCEpf1xvQiH

spirit-of-light and others added 4 commits November 21, 2026 09:03
…zn v0.18.1

These golden tests record the output of zn v0.18.1: `zn task list
--json` byte for byte, the Tasks view groups, board columns and
calendar order under both list orders, and the frontmatter of a newly
created task note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0171pE1tFQspTuCEpf1xvQiH
…n v0.18.1

A new fixture holds `@repeat:` tasks that use only the values of
released zn. The test compares the output of `zn task list` in text and
in JSON, with and without `--all`, with golden files. The base is zn
v0.18.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0171pE1tFQspTuCEpf1xvQiH
These tests compare zn with the output of zn v0.18.1 and add no new
behaviour. Against a server, `zn task list` in JSON and in text, and
the MCP `list_tasks` tool, give the same bytes as zn v0.18.1. This
includes a `scheduled` value that the server sends.

A toggle of a `@repeat:` task on a remote vault writes the next open
line and the finished line. The tests keep this behaviour in the CLI and
in MCP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0171pE1tFQspTuCEpf1xvQiH
Git on Windows can convert the golden files to CRLF. The tests then
fail. Two lines in `.gitattributes` keep LF in `internal/cli/testdata`
and in `internal/tui/testdata`. No test in this change makes a folder read-only,
so no test must stop early on Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0171pE1tFQspTuCEpf1xvQiH
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