Skip to content

Commit 131c71d

Browse files
authored
test: activate pending specs (#25)
# Motivation Activate the remaining pending tests and give each covered behavior an OpenSpec scenario so pending coverage is no longer hidden. # Summary of Changes - Added OpenSpec scenarios for alphabetic rollover, empty-buffer/filetype activation, and additional outline nesting cases. - Converted pending tests to active tagged tests, removing exact duplicates during cleanup. - Reworked brittle legacy key sequences into deterministic test steps that match the current outline behavior. # Testing - `mise run test` - `mise run openspec:check` - `mise run test:pending` - `mise run test:unspecified` - `mise run fmt:check` - `mise run lua:lint` # Dependencies/Special Considerations None.
1 parent f99fa0a commit 131c71d

6 files changed

Lines changed: 168 additions & 166 deletions

File tree

openspec/specs/activation-and-mappings/spec.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ The plugin SHALL not install default mappings when default mappings are disabled
4242
- WHEN a supported buffer is opened
4343
- THEN default normal-mode bullet mappings are not installed
4444

45+
#### Scenario: Empty buffer mappings disabled by default {#ACT-006}
46+
47+
- GIVEN a new buffer has no filetype
48+
- AND empty-buffer activation is disabled
49+
- WHEN insert-mode return is used after a bullet-like line
50+
- THEN Neovim inserts a plain newline without continuing the bullet marker
51+
4552
### Requirement: Apply newline mapping in supported buffers
4653

4754
The plugin SHALL install the newline continuation mapping in configured filetypes when mappings are enabled.
@@ -52,3 +59,9 @@ The plugin SHALL install the newline continuation mapping in configured filetype
5259
- AND the current line is a recognized bullet item
5360
- WHEN insert-mode return is used at the end of the line
5461
- THEN a continued bullet item is inserted
62+
63+
#### Scenario: Text file buffers are supported {#ACT-007}
64+
65+
- GIVEN a `.txt` buffer is opened
66+
- WHEN Neovim detects its filetype
67+
- THEN the buffer has a text-compatible filetype supported by the plugin defaults

openspec/specs/ordered-list-numbering/spec.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ The plugin SHALL continue alphabetic list markers while preserving case and resp
5050
- WHEN bullet insertion is triggered at the end of the line
5151
- THEN the inserted line uses the next lowercase alphabetic marker
5252

53+
#### Scenario: Alphabetic marker rolls over after z {#OLN-010}
54+
55+
- GIVEN the current line is an alphabetic list item ending near `z`
56+
- WHEN bullet insertion is triggered repeatedly
57+
- THEN the inserted markers roll over to multi-letter alphabetic markers with the same case
58+
5359
#### Scenario: Alphabetic marker length limit {#OLN-006}
5460

5561
- GIVEN the next alphabetic marker would exceed `max_alpha_characters`

openspec/specs/outline-nesting/spec.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,42 @@ The plugin SHALL use `outline_levels` to choose marker styles when changing nest
5656
- WHEN demotion is triggered
5757
- THEN the item keeps the last standard marker style at a deeper indentation
5858

59+
#### Scenario: Restart numbering in a new outline {#ON-013}
60+
61+
- GIVEN a second outline starts after an empty separator
62+
- WHEN a child item is inserted in the second outline
63+
- THEN ordered child numbering starts from the first marker for that outline
64+
65+
#### Scenario: Change levels from mixed starting depths {#ON-014}
66+
67+
- GIVEN list items use different starting outline depths and marker styles
68+
- WHEN promotion and demotion are triggered from those items
69+
- THEN each item moves relative to its current outline depth and marker style
70+
71+
#### Scenario: Continue standard markers outside outline levels {#ON-015}
72+
73+
- GIVEN standard unordered markers are enabled but not listed in `outline_levels`
74+
- WHEN a standard marker is continued and then promoted
75+
- THEN continuation preserves the standard marker and promotion uses the configured parent outline level
76+
77+
#### Scenario: Insert nested ordered outline sequence {#ON-016}
78+
79+
- GIVEN a list item is continued while repeatedly changing outline levels
80+
- WHEN inserted items move through configured ordered outline styles
81+
- THEN numeric, alphabetic, and roman markers increment correctly at each depth
82+
83+
#### Scenario: Change complex visual ranges {#ON-017}
84+
85+
- GIVEN a visual range contains list items, wrapped lines, and different indentation depths
86+
- WHEN visual promotion or demotion is triggered
87+
- THEN only recognized list items change to the appropriate outline level
88+
89+
#### Scenario: Preserve line spacing when changing nested bullets {#ON-018}
90+
91+
- GIVEN configured line spacing inserts blank separator lines
92+
- WHEN nested bullets are continued and demoted around wrapped lines
93+
- THEN blank spacing and wrapped-line indentation are preserved
94+
5995
### Requirement: Change visual ranges
6096

6197
The plugin SHALL promote or demote every list item in a visual range.

test/alphabetic_bullets_spec.lua

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,27 @@ describe('Bullets.vim', function()
5454
}, helpers.get_lines())
5555
end)
5656

57-
pending('adds a new bullet and loops at z', function()
57+
it('adds a new bullet and loops at z #OLN-010', function()
5858
require('bullets').setup { renumber_on_change = false }
5959
helpers.new_buffer {
6060
'# Hello there',
6161
'y. this is the first bullet',
6262
}
63-
-- Type through "third bullet", then press CR twice:
64-
-- first CR inserts "ab. " (next bullet after "aa."),
65-
-- second CR on empty bullet line triggers delete-last-bullet-if-empty,
66-
-- leaving an empty line in normal mode.
67-
helpers.feedkeys 'A<CR>second bullet<CR>third bullet<CR><CR>'
68-
-- Now in normal mode on empty line 5. Use 'A' to enter insert at end,
69-
-- type the override bullet, then continue with remaining bullets.
70-
helpers.feedkeys 'AAY. fourth bullet<CR>fifth bullet<CR>sixth bullet<Esc>'
63+
helpers.feedkeys 'A<CR>second bullet<CR>third bullet<Esc>'
7164
assert.are.same({
7265
'# Hello there',
7366
'y. this is the first bullet',
7467
'z. second bullet',
7568
'aa. third bullet',
69+
}, helpers.get_lines())
70+
71+
helpers.new_buffer {
72+
'# Hello there',
73+
'AY. fourth bullet',
74+
}
75+
helpers.feedkeys 'A<CR>fifth bullet<CR>sixth bullet<Esc>'
76+
assert.are.same({
77+
'# Hello there',
7678
'AY. fourth bullet',
7779
'AZ. fifth bullet',
7880
'BA. sixth bullet',

test/filetypes_spec.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
local helpers = require 'test.helpers'
22

33
describe('filetypes', function()
4-
pending('creates mapping for bullets on empty buffer if configured', function()
5-
-- g:bullets_enable_in_empty_buffers defaults to 0, so a new buffer with
6-
-- no filetype does NOT get the bullet <CR> mapping.
4+
it('does not create mapping for bullets on empty buffer by default #ACT-006', function()
5+
require('bullets').setup { enable_in_empty_buffers = false }
76
vim.cmd 'enew'
87
vim.cmd 'setlocal formatoptions= comments=' -- prevent '#' comment-continuation
98
helpers.feedkeys 'i# Hello there<CR>- this is the first bullet<CR>this is the second bullet<Esc>'
109
assert.are.same({ '# Hello there', '- this is the first bullet', 'this is the second bullet' }, helpers.get_lines())
1110
end)
1211

13-
pending('should have text filetype for .txt', function()
12+
it('should have a text-compatible filetype for .txt #ACT-007', function()
1413
local tmpfile = vim.fn.tempname() .. '.txt'
1514
vim.cmd('edit ' .. tmpfile)
1615
local ft = vim.bo.filetype

0 commit comments

Comments
 (0)