diff --git a/test/template/manifest.json b/test/template/manifest.json index b00590b..e54d0e6 100644 --- a/test/template/manifest.json +++ b/test/template/manifest.json @@ -6,9 +6,16 @@ "dir": "../_res", "testmode": false }, + "store": { + "test_int": 123, + "test_text": "lorem ipsum" + }, "name": "template tests", "tests": [ - /* printf "%s" "@test1.json" | marshal */"", - "@test2.json" - ], + /* printf "%s" "@test1.json" | marshal */"" + ,"@test2.json" + ,"@test3.json" + ,"@test4.json" + ,"@test5.json" + ] } \ No newline at end of file diff --git a/test/template/test3.json b/test/template/test3.json new file mode 100644 index 0000000..0371e56 --- /dev/null +++ b/test/template/test3.json @@ -0,0 +1,22 @@ +// template-delims: {{ }} +{ + "name": "delimiter in templates: \"", + "request": { + "server_url": "http://localhost:9999", + "endpoint": "bounce-json", + "method": "POST", + "body": { + "num": "integer from datastore: {{ datastore "test_int" }}", + "text": "string from datastore: {{ datastore "test_text" }}" + } + }, + "response": { + "statuscode": 200, + "body": { + "body": { + "num": "integer from datastore: 123", + "text": "string from datastore: lorem ipsum" + } + } + } +} \ No newline at end of file diff --git a/test/template/test4.json b/test/template/test4.json new file mode 100644 index 0000000..280f10a --- /dev/null +++ b/test/template/test4.json @@ -0,0 +1,22 @@ +// template-delims: {{ }} +{ + "name": "delimiter in templates: `", + "request": { + "server_url": "http://localhost:9999", + "endpoint": "bounce-json", + "method": "POST", + "body": { + "num": "integer from datastore: {{ datastore `test_int` }}", + "text": "string from datastore: {{ datastore `test_text` }}" + } + }, + "response": { + "statuscode": 200, + "body": { + "body": { + "num": "integer from datastore: 123", + "text": "string from datastore: lorem ipsum" + } + } + } +} \ No newline at end of file diff --git a/test/template/test5.json b/test/template/test5.json new file mode 100644 index 0000000..7ce923a --- /dev/null +++ b/test/template/test5.json @@ -0,0 +1,87 @@ +// template-delims: {{ }} +[ + { + "name": "delimiter in templates: \"", + "request": { + "server_url": "http://localhost:9999", + "endpoint": "bounce-json", + "method": "POST", + "body": { + "num": "integer from datastore: {{ datastore "test_int" }}", + "text": "string from datastore: {{ datastore "test_text" }}" + } + }, + "response": { + "statuscode": 200, + "body": { + "body": { + "num": "integer from datastore: 123", + "text": "string from datastore: lorem ipsum" + } + } + } + }, + { + "name": "delimiter in templates: `", + "request": { + "server_url": "http://localhost:9999", + "endpoint": "bounce-json", + "method": "POST", + "body": { + "num": "integer from datastore: {{ datastore `test_int` }}", + "text": "string from datastore: {{ datastore `test_text` }}" + } + }, + "response": { + "statuscode": 200, + "body": { + "body": { + "num": "integer from datastore: 123", + "text": "string from datastore: lorem ipsum" + } + } + } + }, + { + "name": "delimiter in templates: \"", + "request": { + "server_url": "http://localhost:9999", + "endpoint": "bounce-json", + "method": "POST", + "body": { + "num": "integer from datastore: 123", + "text": "string from datastore: lorem ipsum" + } + }, + "response": { + "statuscode": 200, + "body": { + "body": { + "num": "integer from datastore: {{ datastore "test_int" }}", + "text": "string from datastore: {{ datastore "test_text" }}" + } + } + } + }, + { + "name": "delimiter in templates: `", + "request": { + "server_url": "http://localhost:9999", + "endpoint": "bounce-json", + "method": "POST", + "body": { + "num": "integer from datastore: 123", + "text": "string from datastore: lorem ipsum" + } + }, + "response": { + "statuscode": 200, + "body": { + "body": { + "num": "integer from datastore: {{ datastore `test_int` }}", + "text": "string from datastore: {{ datastore `test_text` }}" + } + } + } + } +] \ No newline at end of file