測試

Nvim :help 頁面, 原始碼 使用 tree-sitter-vimdoc 解析器 產生


測試 Vim 和 Vim 腳本
表達式求值在 eval.txt 中說明。這個檔案詳細介紹了如何在 Vim 腳本中編寫測試。這可以用於測試 Vim 本身和測試外掛程式。
1. 測試 Vim testing 2. 測試函數 test-functions-details 3. 斷言函數 assert-functions-details

1. 測試 Vim testing

Vim 可以在建置後進行測試,通常使用 "make test"。測試位於 "src/testdir" 目錄中。
新式測試
新測試應作為新式測試加入。測試腳本命名為 test_<feature>.vim (將 <feature> 替換為被測試的功能)。這些腳本使用諸如 assert_equal() 之類的函數,將測試命令和預期結果放在一起。
更多資訊請參閱 src/testdir/README.txt 檔案。

2. 測試函數 test-functions-details

3. 斷言函數 assert-functions-details

主頁
命令索引
快速參考