Skip to content

Commit 85212e6

Browse files
etc: add vim script to help convert C++ tests to pytest
1 parent 5ee385c commit 85212e6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

etc/catch-cpp-to-pytest.vim

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
function! CatchCPPToPytest()
2+
silent '<,'>s/{/[/ge
3+
silent '<,'>s/}/]/ge
4+
silent '<,'>s/::/./ge
5+
silent '<,'>s/true/True/ge
6+
silent '<,'>s/false/False/ge
7+
silent '<,'>s/;//ge
8+
silent '<,'>s/REQUIRE(\([^)]*\))/assert \1/ge
9+
silent '<,'>s/<[^>]*>//ge
10+
endfunction
11+
12+
map! <F1> <ESC>:call CatchCPPToPytest()<CR>i
13+
map <F1> :call CatchCPPToPytest()<CR>

0 commit comments

Comments
 (0)