turbo-editors/turbo-corepublic Fork 0
v1.0.0
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-core.git
git clone ssh://git@rickub.com/turbo-editors/turbo-core.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

run-the-tests.md · 67 lines · 1.8 KBmarkdown Blame HistoryRaw
🛟 Updated. 28d5985 k33g 17h ago1# How to run the tests
2
3This guide shows how to run turbo-core's test suite and what it covers. It assumes a checkout and Go 1.26 or later.
4
5## The one command
6
7```bash
8make test
9```
10
11That is `go test ./...` over every package. It needs no setup, no network and no language server: everything it drives is either a pure function or a simulated terminal.
12
13## Steps
14
15### Run the whole suite
16
17```bash
18make test
19```
20
21You should see one `ok` line per package, fifteen of them.
22
23### Run it under the race detector
24
25```bash
26make race
27```
28
29The editor has goroutines in three places — the language-server read loop, the terminal's pty reader, and a running tool's output — and every one of them has had a race in it at some point. Run this before committing anything that touches them.
30
31### See what is covered
32
33```bash
34make cover
35```
36
37### Run one package
38
39```bash
40go test ./syntax/
41go test -run TestRegister ./syntax/
42```
43
44### See the commands themselves
45
46```bash
47make help
48```
49
50## Variants
51
52### You changed a scanner
53
54`go test ./syntax/` is the fast loop. Then run the whole suite, because `editor` and `app` both draw through it.
55
56### You changed something with a goroutine behind it
57
58Use `make race`, not `make test`. A data race in a constructor that starts a goroutine hid here for a whole feature, because a shell takes longer to produce output than an assignment takes to run.
59
60### A test passed the moment you wrote it
61
62Break the code it covers and watch it fail. This project has more than one recorded case of a test that passed because it tested nothing — a callback nobody wired, a step the test itself performed. A new test that has never failed has not been tested.
63
64## See also
65
66- Running an editor's own tests: each editor's `how-to/run-the-tests.md`
67- What the packages are: [packages reference](../reference/packages.md)