added test snippet for cpp

This commit is contained in:
Oliver Hartmann 2023-01-09 09:52:21 +01:00
parent 874cb95f01
commit 35552af831
2 changed files with 28 additions and 0 deletions

14
my_snippets/cpp.json Normal file
View File

@ -0,0 +1,14 @@
{
"TEST_F for g/setter": {
"prefix": "TEST_F_getter",
"body": [
"TEST_F($1, test_${CLIPBOARD/m_(.*)/${1}/}_${2:setter}_${3:getter})",
"{",
" set${CLIPBOARD/m_(.)(.*)/${1:/upcase}${2}/}($4);",
" ${5:type} result = get${CLIPBOARD/m_(.)(.*)/${1:/upcase}${2}/}();",
" EXPECT_EQ($4, result);$0",
"}"
],
"description": "Generate TEST_F body for getter and setter functions"
}
}

14
my_snippets/package.json Normal file
View File

@ -0,0 +1,14 @@
{
"name": "my_snippets",
"engines": {
"vscode": "^1.11.0"
},
"contributes": {
"snippets": [
{
"language": "cpp",
"path": "./cpp.json"
}
]
}
}