| 1 | { |
| 2 | "version": "1.0", |
| 3 | "testCases": [ |
| 4 | { |
| 5 | "documentation": "uriEncode when the string has nothing to encode returns the input", |
| 6 | "params": { |
| 7 | "TestCaseId": "1", |
| 8 | "Input": "abcdefg" |
| 9 | }, |
| 10 | "expect": { |
| 11 | "error": "The value is: `abcdefg`" |
| 12 | } |
| 13 | }, |
| 14 | { |
| 15 | "documentation": "uriEncode with single character to encode encodes only that character", |
| 16 | "params": { |
| 17 | "TestCaseId": "1", |
| 18 | "Input": "abc:defg" |
| 19 | }, |
| 20 | "expect": { |
| 21 | "error": "The value is: `abc%3Adefg`" |
| 22 | } |
| 23 | }, |
| 24 | { |
| 25 | "documentation": "uriEncode with all ASCII characters to encode encodes all characters", |
| 26 | "params": { |
| 27 | "TestCaseId": "1", |
| 28 | "Input": "/:,?#[]{}|@! $&'()*+;=%<>\"^`\\" |
| 29 | }, |
| 30 | "expect": { |
| 31 | "error": "The value is: `%2F%3A%2C%3F%23%5B%5D%7B%7D%7C%40%21%20%24%26%27%28%29%2A%2B%3B%3D%25%3C%3E%22%5E%60%5C`" |
| 32 | } |
| 33 | }, |
| 34 | { |
| 35 | "documentation": "uriEncode with ASCII characters that should not be encoded returns the input", |
| 36 | "params": { |
| 37 | "TestCaseId": "1", |
| 38 | "Input": "0123456789.underscore_dash-Tilda~" |
| 39 | }, |
| 40 | "expect": { |
| 41 | "error": "The value is: `0123456789.underscore_dash-Tilda~`" |
| 42 | } |
| 43 | }, |
| 44 | { |
| 45 | "documentation": "uriEncode encodes unicode characters", |
| 46 | "params": { |
| 47 | "TestCaseId": "1", |
| 48 | "Input": "\ud83d\ude39" |
| 49 | }, |
| 50 | "expect": { |
| 51 | "error": "The value is: `%F0%9F%98%B9`" |
| 52 | } |
| 53 | }, |
| 54 | { |
| 55 | "documentation": "uriEncode on all printable ASCII characters", |
| 56 | "params": { |
| 57 | "TestCaseId": "1", |
| 58 | "Input": " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" |
| 59 | }, |
| 60 | "expect": { |
| 61 | "error": "The value is: `%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~`" |
| 62 | } |
| 63 | }, |
| 64 | { |
| 65 | "documentation": "uriEncode on an empty string", |
| 66 | "params": { |
| 67 | "TestCaseId": "1", |
| 68 | "Input": "" |
| 69 | }, |
| 70 | "expect": { |
| 71 | "error": "The value is: ``" |
| 72 | } |
| 73 | } |
| 74 | ] |
| 75 | } |