| 1 |
# |
| 2 |
# Setup_Schema |
| 3 |
# |
| 4 |
-->macro Setup_Schema |
| 5 |
stmtadmin create_collection {"schema":"xtest", "name":"xdoc"}; |
| 6 |
recvresult; |
| 7 |
varlet %RESULT_PATCH_STRING% {"a": "foo", "_id": 1}; |
| 8 |
varlet %RESULT_PATCH_NULL% {"a": "foo", "_id": 1}; |
| 9 |
varlet %RESULT_PATCH_ARRAY% {"a": "foo", "_id": 1}; |
| 10 |
varlet %RESULT_PATCH_ID% {"a": "foo", "_id": 1}; |
| 11 |
varlet %OBJECT% Collection1; |
| 12 |
varlet %OBJECT_COLUMN% ; |
| 13 |
-->endmacro |
| 14 |
|
| 15 |
|
| 16 |
# |
| 17 |
# Document_UpdatePatch_Find |
| 18 |
# |
| 19 |
-->macro Document_UpdatePatch_Find %ERROR% %DOC% %PATCH% %EXPECT% |
| 20 |
echo # Verification of JSON patch [%DOC% patch %PATCH% = %EXPECT%]; |
| 21 |
quiet; |
| 22 |
noquery_result; |
| 23 |
callmacro Crud_insert Collection1 'xdoc' Row_octet '%DOC%'; |
| 24 |
callmacro Crud_update Collection1 'xdoc' Op_octets |
| 25 |
MERGE_PATCH '%PATCH%'; |
| 26 |
callmacro Crud_find Collection1 'xdoc'; |
| 27 |
callmacro Crud_delete Collection1 'xdoc'; |
| 28 |
recvresult; |
| 29 |
expecterror %ERROR%; |
| 30 |
recvresult; |
| 31 |
recvtovar %RESULT%; |
| 32 |
recvresult; |
| 33 |
noquiet; |
| 34 |
query_result; |
| 35 |
assert_eq %EXPECT% %RESULT%; |
| 36 |
echo; |
| 37 |
-->endmacro |
| 38 |
|
| 39 |
|
| 40 |
# |
| 41 |
# Document_UpdatePatchObj_Find |
| 42 |
# |
| 43 |
-->macro Document_UpdatePatchObj_Find %ERROR% %DOC% %OBJ% %EXPECT% |
| 44 |
echo # Verification of JSON patch [%DOC% patch PROTOBUF_EXPR = %EXPECT%]; |
| 45 |
quiet; |
| 46 |
noquery_result; |
| 47 |
callmacro Crud_insert Collection1 'xdoc' Row_octet '%DOC%'; |
| 48 |
callmacro Crud_update Collection1 'xdoc' Op_object |
| 49 |
MERGE_PATCH %OBJ%; |
| 50 |
callmacro Crud_find Collection1 'xdoc'; |
| 51 |
callmacro Crud_delete Collection1 'xdoc'; |
| 52 |
recvresult; |
| 53 |
expecterror %ERROR%; |
| 54 |
recvresult; |
| 55 |
recvtovar %RESULT%; |
| 56 |
recvresult; |
| 57 |
noquiet; |
| 58 |
query_result; |
| 59 |
assert_eq %EXPECT% %RESULT%; |
| 60 |
echo; |
| 61 |
-->endmacro |
| 62 |
|
| 63 |
|
| 64 |
# |
| 65 |
# Document_OnlyTable_UpdatePatch_Find |
| 66 |
# |
| 67 |
-->macro Document_OnlyTable_UpdatePatch_Find %ERROR% %DOC% %PATCH% %EXPECT% |
| 68 |
echo # Test not applicable:; |
| 69 |
echo # doc:%DOC% patch:%PATCH% result:%EXPECT%; |
| 70 |
echo # document can't be an array; |
| 71 |
-->endmacro |
| 72 |
|
| 73 |
|
| 74 |
# |
| 75 |
# DocumentNull_OnlyTable_UpdatePatch_Find |
| 76 |
# |
| 77 |
-->macro DocumentNull_OnlyTable_UpdatePatch_Find %ERROR% %DOC% %PATCH% %EXPECT% |
| 78 |
echo # Test not applicable:; |
| 79 |
echo # doc:%DOC% patch:%PATCH% result:%EXPECT%; |
| 80 |
echo # document can't be an array; |
| 81 |
-->endmacro |
| 82 |
|