1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-02-21 19:06:18 +02:00
2018-12-03 20:38:33 -10:00
..
2018-09-19 09:17:08 +10:00
2018-09-19 09:17:08 +10:00
2018-03-03 10:16:21 +11:00
2018-03-03 10:16:21 +11:00
2018-03-19 17:26:42 +11:00
2018-01-02 15:11:41 +11:00
2018-03-19 10:54:09 +11:00
2018-04-02 18:39:22 +10:00
2018-04-02 18:39:22 +10:00
2018-03-26 17:30:55 +11:00
2018-03-26 17:30:55 +11:00
2018-10-03 19:40:14 +10:00
2018-10-03 19:40:14 +10:00
2018-03-19 10:54:09 +11:00
2018-06-23 08:53:43 -04:00
2018-06-23 08:53:43 -04:00
2018-01-03 18:52:55 +11:00
2018-01-03 18:52:55 +11:00
2018-06-23 08:53:29 -04:00
2018-06-23 08:53:29 -04:00
2018-06-22 20:00:57 -04:00
2018-06-22 20:00:57 -04:00
2018-08-01 16:49:42 -04:00
2018-08-01 16:49:42 -04:00
2018-03-18 20:38:29 +11:00
2018-03-19 10:54:09 +11:00
2018-01-02 20:59:02 +11:00
2018-03-19 10:54:09 +11:00
2018-02-07 11:16:00 +11:00
2018-02-07 11:16:00 +11:00

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
  2. Create/edit a file lexers/testdata/${LEXER}.actual (eg. csharp.actual).
  3. Run go run ./cmd/chroma/main.go --lexer ${LEXER} --json lexers/testdata/${LEXER}.actual > lexers/testdata/${LEXER}.expected.
  4. Run go test -v -run TestLexers ./lexers.

eg.

$ 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