25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.4 KiB

13 년 전
13 년 전
  1. zsh-syntax-highlighting / tests
  2. ===============================
  3. Utility scripts for testing zsh-syntax-highlighting highlighters.
  4. The tests expect the highlighter directory to contain a `test-data` directory with test data files. See the [main highlighter](../highlighters/main/test-data) for examples.
  5. Each test should define the array parameter `$expected_region_highlight`.
  6. The value of that parameter is a list of `"$i $j $style [$todo]"` strings.
  7. Each string specifies the highlighting that `$BUFFER[$i,$j]` should have;
  8. that is, `$i` and `$j` specify a range, 1-indexed, inclusive of both endpoints.
  9. If `$todo` exists, the test point is marked as TODO (the failure of that test point will not fail the test), and `$todo` is used as the explanation.
  10. _Note_: `$region_highlight` uses the same `"$i $j $style"` syntax but interprets the indexes differently.
  11. highlighting test
  12. -----------------
  13. [`test-highlighting.zsh`](tests/test-highlighting.zsh) tests the correctness of the highlighting. Usage:
  14. zsh test-highlighting.zsh <HIGHLIGHTER NAME>
  15. All tests may be run with
  16. make test
  17. which will run all highlighting tests and report results in [TAP](http://testanything.org/) format.
  18. performance test
  19. ----------------
  20. [`test-perfs.zsh`](tests/test-perfs.zsh) measures the time spent doing the highlighting. Usage:
  21. zsh test-perfs.zsh <HIGHLIGHTER NAME>
  22. All tests may be run with
  23. make perf