Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
laniakea64 committed Dec 24, 2023
1 parent 2799645 commit bb63588
Showing 1 changed file with 52 additions and 6 deletions.
58 changes: 52 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,55 @@ Run `just deps` to install the cargo dev dependencies, which right now is only

### Test Suite

To run the tests, run `just run` in tests/. Cargo will build and run the project, which
is a simple test-runner in the `main` fn. If you're going to do more than a simple
change, I recommend calling `just watch` in tests/, which will watch for any changes in
the whole repo and re-run the test suite. If you want to only run or watch a single test file, you
can specify the name by passing an argument to `run` or `watch`: `just run
recipe-dependency`.
`vim-just` includes automated tests of its syntax highlighting and filetype detection.
Running the tests invokes Cargo to build and run the project, which
is a simple test-runner in the `main` fn.

To run the syntax highlighting tests, run `just run` in tests/.
If you want to run only a subset of the syntax highlighting tests,
you can pass an optional regex parameter to `just run` matching the filenames you want to include:

```bash
# run only the 'kitchen-sink.just' syntax highlighting test
$ just run kitchen-sink
...
test kitchen-sink…
ok

# run the syntax highlighting tests with base filenames matching the regex ^\w+$
$ just run '^\w+$'
...
test comment…
ok
test deprecated_obsolete…
ok
test invalid…
ok
test set…
ok
test tricky…
ok
```

Note that the `.just` extension is trimmed off before matching against the regex.

To run the filetype detection tests, run `just ftdetect` in tests/.

If you're going to do more than a simple change, I recommend calling `just watch` in tests/,
which will watch for any changes in the whole repo and re-run the test suite.
By default, it will run all syntax tests.
`just watch` accepts up to two parameters to customize which tests to watch:

```bash
# watch all syntax highlighting tests (default)
$ just watch

# watch ftdetect tests
$ just watch ftdetect

# watch all tests
$ just watch ftdetect run

# watch syntax highlighting tests with filenames matching the regex ^r.*s$
$ just watch run '^r.*s$'
```

0 comments on commit bb63588

Please sign in to comment.