@@ -14,7 +14,27 @@ Thank you for your interest in contributing to Marksman.nvim! This document prov
1414### Prerequisites
1515- Neovim >= 0.8.0
1616- Git
17- - Lua 5.1+ (for testing outside Neovim)
17+ - [ just] ( https://github.com/casey/just ) command runner (or make)
18+ - [ plenary.nvim] ( https://github.com/nvim-lua/plenary.nvim ) for testing
19+
20+ ### Quick Start
21+ ``` bash
22+ # Install dependencies
23+ just install-deps
24+
25+ # Run tests
26+ just test
27+
28+ # Run specific test
29+ just test-file tests/marksman_spec.lua
30+
31+ # Watch tests (requires entr)
32+ just test-watch
33+
34+ # Lint and format
35+ just lint
36+ just format
37+ ```
1838
1939### Code Quality Tools
2040``` bash
@@ -25,10 +45,10 @@ luarocks install luacheck
2545cargo install stylua
2646
2747# Run linting
28- luacheck lua/
48+ just lint
2949
3050# Run formatting
31- stylua lua/
51+ just format
3252```
3353
3454## Code Style
@@ -64,6 +84,10 @@ lua/marksman/
6484├── storage.lua -- Mark persistence and project management
6585├── ui.lua -- Floating window and interface
6686└── utils.lua -- Utilities and validation
87+
88+ tests/
89+ ├── minimal_init.lua -- Test environment setup
90+ └── marksman_spec.lua -- Main test suite
6791```
6892
6993## Contribution Types
@@ -77,7 +101,7 @@ lua/marksman/
77101### New Features
781021 . ** Discuss the feature** in an issue first
791032 . ** Ensure it aligns** with the plugin's focused scope
80- 3 . ** Write comprehensive documentation **
104+ 3 . ** Write comprehensive tests **
811054 . ** Add configuration options** if needed
82106
83107### Documentation
@@ -87,11 +111,35 @@ lua/marksman/
87111
88112## Testing Guidelines
89113
90- ### Manual Testing
91- - Test with ** multiple projects**
92- - Verify ** mark persistence** across sessions
93- - Test ** edge cases** (empty files, special characters)
94- - Check ** memory usage** with large mark sets
114+ ### Test Framework
115+ We use [ plenary.nvim] ( https://github.com/nvim-lua/plenary.nvim ) for testing with a describe/it structure:
116+
117+ ``` lua
118+ describe (" feature" , function ()
119+ before_each (function ()
120+ -- Setup code
121+ end )
122+
123+ it (" does something" , function ()
124+ assert .is_true (some_condition )
125+ end )
126+ end )
127+ ```
128+
129+ ### Running Tests
130+ ``` bash
131+ # Run all tests
132+ just test
133+
134+ # Run specific test file
135+ just test-file tests/marksman_spec.lua
136+
137+ # Watch tests (auto-run on file changes)
138+ just test-watch
139+
140+ # Clean test artifacts
141+ just clean
142+ ```
95143
96144### Test Scenarios
971451 . ** Basic Operations** :
@@ -113,6 +161,12 @@ lua/marksman/
113161 - Keyboard navigation
114162 - Search and filtering
115163
164+ ### Writing Tests
165+ - Use descriptive test names
166+ - Test both success and failure cases
167+ - Clean up resources in ` after_each `
168+ - Mock external dependencies when needed
169+
116170## Performance Considerations
117171
118172### Memory Efficiency
@@ -190,9 +244,10 @@ require("marksman").setup({
190244
191245### Before Submitting
1922461 . ** Test thoroughly** on your system
193- 2 . ** Run linting** and fix issues
194- 3 . ** Update documentation** if needed
195- 4 . ** Rebase on main** branch
247+ 2 . ** Run linting** and fix issues: ` just lint `
248+ 3 . ** Format code** : ` just format `
249+ 4 . ** Update documentation** if needed
250+ 5 . ** Rebase on main** branch
196251
197252### PR Description Template
198253``` markdown
0 commit comments