From 88114a65a419b1cfc3dbd96f3dcc5c30fc767c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Fr=C3=B3es=20Franco?= Date: Sun, 31 May 2026 22:35:41 +0000 Subject: [PATCH] test: land the vim diary -count cases + dedup the lua one (follow-up to 2da2168) 2da2168's diary test edits landed unevenly: the lua cmd.VimwikiMakeDiaryNote_has_count case got inserted twice, and the two vim cases (cmd.Vimwiki{MakeDiaryNote,DiaryIndex}_accepts_count) the commit message referenced never landed (the Edit had no-matched). Remove the lua duplicate and add the two vim cases before the harness wrap-up. lua 284, vim 274/18/21, all 0 failed. Co-Authored-By: Claude Opus 4.8 (1M context) --- development/tests/test-keymaps-vim.vim | 29 ++++++++++++++++++++++++++ development/tests/test-keymaps.lua | 9 -------- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/development/tests/test-keymaps-vim.vim b/development/tests/test-keymaps-vim.vim index 771f37d..50449d3 100644 --- a/development/tests/test-keymaps-vim.vim +++ b/development/tests/test-keymaps-vim.vim @@ -727,6 +727,35 @@ call s:record( \ 'complete.colors_from_buffer_spans', \ 'got ' . string(s:cl)) +" ===== Diary-note family -count=0 (wiki selector) ===== +" Was bare: `:2VimwikiMakeDiaryNote` raised E481. The diary open is an LSP +" roundtrip (no server here), so assert only the attribute parse: no E481. +call s:set_buf(['= page =']) +let s:dc_err = '' +try + silent 2VimwikiMakeDiaryNote +catch /E481/ + let s:dc_err = v:exception +catch + " non-E481 (e.g. no LSP attached) is expected and fine here. +endtry +call s:record( + \ s:dc_err ==# '' ? 1 : 0, + \ 'cmd.VimwikiMakeDiaryNote_accepts_count', + \ 'err=' . s:dc_err) + +let s:di_err = '' +try + silent 2VimwikiDiaryIndex +catch /E481/ + let s:di_err = v:exception +catch +endtry +call s:record( + \ s:di_err ==# '' ? 1 : 0, + \ 'cmd.VimwikiDiaryIndex_accepts_count', + \ 'err=' . s:di_err) + " ===== Wrap up ===== call add(s:results, '') diff --git a/development/tests/test-keymaps.lua b/development/tests/test-keymaps.lua index bb2daff..2835bec 100644 --- a/development/tests/test-keymaps.lua +++ b/development/tests/test-keymaps.lua @@ -915,15 +915,6 @@ vim.defer_fn(function() error('VimwikiMakeDiaryNote missing -count: ' .. vim.inspect(c)) end end) - -- Diary-note family carries -count=0 (vimwiki's wiki selector), so - -- `:2VimwikiMakeDiaryNote` selects wiki #2 instead of raising E481. - tobj_case('cmd.VimwikiMakeDiaryNote_has_count', function() - local c = vim.api.nvim_buf_get_commands(0, {}).VimwikiMakeDiaryNote - if not c then error(':VimwikiMakeDiaryNote not defined') end - if c.count == nil or c.count == false then - error('VimwikiMakeDiaryNote missing -count: ' .. vim.inspect(c)) - end - end) -- `:VimwikiNormalizeLink 1` (the arg is upstream's visual flag; the command -- is -nargs=? not -range, so no `'<,'>`) wraps the last visual selection. tobj_case('cmd.normalize_link_visual_wraps_selection', function()