Repository navigation
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
Open
spirit-of-light wants to merge 4 commits into
spirit-of-light wants to merge 4 commits into
Conversation
…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
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
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
zn task listin text and JSON, the Tasks view of the terminal app, and a new task note give the same output as zn v0.18.1.@repeat:values of released zn (daily,weekly,weekdays,mon/thuandafter-3d) and a date in@remind:lists the same text and JSON as zn v0.18.1.zn task listand the MCP toollist_tasksgive 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 ininternal/cli/testdataandinternal/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 cmdandgit diff --checkshow no problems.go test -race ./...passes, except forTestManyControlSequencesRenderQuickly, which also fails under-raceon a cleanmain.core.autocrlf=true, and in more than one time zone.znbinary frommaingives 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