$ go test -count=1 -v ./... === RUN TestParseCountsANight --- PASS: TestParseCountsANight (0.00s) === RUN TestLogLayout --- PASS: TestLogLayout (0.00s) === RUN TestStoppedNightAndEmptyLedger --- PASS: TestStoppedNightAndEmptyLedger (0.00s) === RUN TestSelectTargetAndResume --- PASS: TestSelectTargetAndResume (0.00s) === RUN TestDryRunScheduleFresh --- PASS: TestDryRunScheduleFresh (0.00s) === RUN TestResumedOpeningLines --- PASS: TestResumedOpeningLines (0.00s) === RUN TestRequestRecognition --- PASS: TestRequestRecognition (0.00s) === RUN TestLiveRunWithFakeClockAndFakeAction --- PASS: TestLiveRunWithFakeClockAndFakeAction (0.01s) === RUN TestGrantsAreTheHalvingSeriesThenBelowTheMinimum --- PASS: TestGrantsAreTheHalvingSeriesThenBelowTheMinimum (0.00s) === RUN TestNumberOfGrantsIsSevenComputedFromTheConstants --- PASS: TestNumberOfGrantsIsSevenComputedFromTheConstants (0.00s) === RUN TestCumulativeTotalNeverReachesTheCeiling --- PASS: TestCumulativeTotalNeverReachesTheCeiling (0.00s) === RUN TestSumOfAllGrantsAndShortfall --- PASS: TestSumOfAllGrantsAndShortfall (0.00s) === RUN TestTotalAndRemainingAfterSeven --- PASS: TestTotalAndRemainingAfterSeven (0.00s) === RUN TestWords --- PASS: TestWords (0.00s) === RUN TestClockFormat --- PASS: TestClockFormat (0.00s) PASS ok bedtime 0.030s $ go build -o bedtime . && test/e2e.sh ok exit code ok lines starting Asking is open ok seven Granted lines match the schedule ok one Not granted line ok no Not yet line ok Bedtime. and Sleeping. at the end ok the --then command ran ok wall time 31774 ms between 31 and 34 s ok no late send ok ledger events in order ok 7 granted, 1 declined ok ask deadlines match the schedule ok end action=then ok log header ok log row ok log count e2e: all checks passed exit=0 $ test/checks.sh real == 2. build and hygiene ok go build offline ok go vet clean ok gofmt -l prints nothing ok go.mod has no require ok only standard library packages ok no file contains an em dash == 3. dry run, fresh ok exit 0 ok finished in 4 ms ok no ledger file created ok heading is line 2 ok output equals the card's schedule line for line == 6. the wall holds across restarts ok SIGINT exits 130 ok SIGINT output ends Stopped ok the one request was granted ok ledger end action=interrupted ok SIGTERM exits 143 ok SIGTERM output ends Stopped ok SIGTERM ledger end action=interrupted ok log: Starts 1, Asks 1, Granted 1, Added 15 minutes, stopped, Slept - ok resumed dry run opening ok rows start at 2 ok last possible bedtime unchanged ok resumed run exits 0 ok resumed run ends Bedtime. Sleeping. ok resumed run acted at 23:15:00 (real 14006 ms for 14 simulated minutes) ok log: Starts 2, Ended then, Slept 23:15:00 ok another night starts fresh == 7. request handling ok case and punctuation accepted ok early request answered Not yet ok ledger ask result=early ok other text is not a request ok no ledger ask line for it ok still running 3 s after input closed ok simulated clock refused without its own ledger, exit 2 ok the home folder is still empty ok unreadable time ok unknown flag prints one usage line, exit 2 == 8. the action and the fallback, with stubs ok (a) both fail: message, exit 3 ok (a) end action=none failed=suspend,lock ok (b) suspend called with suspend, exit 0, end action=suspend ok (c) --lock calls lock-session and no suspend ok (d) suspend fails, lock works: action=lock failed=suspend ok (e) Slept is the deadline second although the stub took 120 simulated seconds ok (e) the end line's time is the same == 9. real clock, real input (about two minutes) target 16:46:00, the command ran at 16:46:00.003 ok exit 0 ok four opening lines, then Bedtime. Sleeping. ok the command ran 0 to 1.5 s after the target ok ledger end line checks: all passed exit=0