diff options
| author | Craig Jennings <c@cjennings.net> | 2025-11-04 23:35:07 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-11-04 23:35:07 -0600 |
| commit | 8d8e436a032b0e25074165c81bd89b4c3402bc9b (patch) | |
| tree | d0d40aa093f09927e6fb42c83950a0be60960b1c /docs | |
| parent | c313d060877db0e44f84cbb84092b43a8386900f (diff) | |
| download | dotemacs-8d8e436a032b0e25074165c81bd89b4c3402bc9b.tar.gz dotemacs-8d8e436a032b0e25074165c81bd89b4c3402bc9b.zip | |
test: Add comprehensive test suite for LanguageTool grammar checking
Created complete test coverage for the LanguageTool integration:
Unit Tests (test-flycheck-languagetool-setup.el):
- 6 tests covering installation and configuration
- Verifies LanguageTool binary availability
- Checks wrapper script exists and is executable
- Validates wrapper script structure (shebang, imports)
- Tests error handling for missing arguments
- All tests pass ✓
Integration Tests (test-integration-grammar-checking.el):
- 9 tests covering end-to-end grammar checking workflow
- Tests wrapper script with real LanguageTool execution
- Validates output format (filename:line:column: message)
- Tests normal cases (error detection, formatting)
- Tests boundary cases (empty files, single word, multiple paragraphs)
- Tests error cases (nonexistent files, missing arguments)
- Uses real test fixtures with known grammar errors
- All tests pass ✓ (takes ~35 seconds due to LanguageTool execution)
Test Fixtures (tests/fixtures/grammar-*.txt):
- grammar-errors-basic.txt: Common errors (subject-verb, could of, etc.)
- grammar-errors-punctuation.txt: Punctuation and spacing errors
- grammar-correct.txt: Clean text with no errors
Testing Philosophy Applied:
- Focus on OUR code (wrapper script), not flycheck internals
- Trust external frameworks work correctly
- Test real integration (wrapper → LanguageTool → output)
- No mocking of domain logic, only external side-effects
- Clear test categories: Normal, Boundary, Error cases
- Comprehensive docstrings listing integrated components
- Deterministic tests using real fixtures
Usage:
make test-file FILE=test-flycheck-languagetool-setup.el
make test-file FILE=test-integration-grammar-checking.el
make test-integration # Includes grammar integration test
Tests automatically discovered by Makefile wildcards.
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions
