/usr/share/gocode/src/github.com/alecthomas/chroma/lexers/testdata/README.md is in golang-github-alecthomas-chroma-dev 0.4.0+git20180402.51d250f-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | # Lexer tests
This directory contains input source and expected output lexer tokens.
Input filenames for lexers are in the form `<name>.actual`. Expected output filenames are in the form `<name>.expected`.
Each input filename is parsed by the corresponding lexer and checked against the expected JSON-encoded token list.
To add/update tests do the following:
1. `export LEXER=csharp`
1. Create/edit a file `lexers/testdata/${LEXER}.actual` (eg. `csharp.actual`).
2. Run `go run ./cmd/chroma/main.go --lexer ${LEXER} --json lexers/testdata/${LEXER}.actual > lexers/testdata/${LEXER}.expected`.
3. Run `go test -v -run TestLexers ./lexers`.
eg.
```bash
$ export LEXER=csharp
$ go run ./cmd/chroma/main.go --lexer ${LEXER} --json lexers/testdata/${LEXER}.actual > lexers/testdata/${LEXER}.expected
$ go test -v -run TestLexers ./lexers
=== RUN TestLexers
=== RUN TestLexers/C#
=== RUN TestLexers/CSS
--- PASS: TestLexers (0.01s)
--- PASS: TestLexers/C# (0.00s)
--- PASS: TestLexers/CSS (0.00s)
PASS
ok github.com/alecthomas/chroma/lexers 0.032s
```
|