nvim/my_snippets/cpp.json
2023-01-09 09:52:21 +01:00

15 lines
403 B
JSON

{
"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"
}
}