1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
"input": {
"string": "the QuIcK brOwn fox",
"padChar" : "Y",
"padAmount" : 10
},
"spec": {
"leftPad": {
"basic1": "=leftPad('fox', 10, 'X')", // happy path : actually do some padding
"basic2": "=leftPad('brown', 5, 'X')", // ok path : desired pad width is the same as the input
"basic3": "=leftPad('brown', 2, 'X')", // ok path : desired pad width less than the size of the input
"basic4": "=leftPad(@(2,string), 22, 'X')", // happy path : actually pad a looked up string from the data
"complex1" : "=leftPad('quick', @(2,padAmount), @(2,padChar))", // happy path : lookup pad amount and pad char
"badArgs1" : "=leftPad('quick', -1, 'X')", // negative pad amount
"badArgs2" : "=leftPad('quick', 0, 'X')", // zero pad amount
"badArgs3" : "=leftPad('quick', 8, 'AB')", // pad char is not a single character
"badArgs4" : "=leftPad('quick', 1000, 'F')" // stupidly big pad width should fail
},
"rightPad": {
"basic1": "=rightPad('fox', 10, 'X')", // happy path : actually do some padding
"basic2": "=rightPad('brown', 5, 'X')", // ok path : desired pad width is the same as the input
"basic3": "=rightPad('brown', 2, 'X')", // ok path : desired pad width less than the size of the input
"basic4": "=rightPad(@(2,string), 22, 'X')", // happy path : actually pad a looked up string from the data
"complex1" : "=rightPad('quick', @(2,padAmount), @(2,padChar))", // happy path : lookup pad amount and pad char
"badArgs1" : "=rightPad('quick', -1, 'X')", // negative pad amount
"badArgs2" : "=rightPad('quick', 0, 'X')", // zero pad amount
"badArgs3" : "=rightPad('quick', 8, 'AB')", // pad char is not a single character
"badArgs4" : "=leftPad('quick', 1000, 'F')" // stupidly big pad width should fail
}
},
"context": {},
"OVERWRITR": {
//
// the input
"string": "the QuIcK brOwn fox",
"padChar" : "Y",
"padAmount" : 10,
//
// the things modify added
"leftPad": {
"basic1": "XXXXXXXfox",
"basic2": "brown",
"basic3" : "brown",
"basic4": "XXXthe QuIcK brOwn fox",
"complex1" : "YYYYYquick"
},
"rightPad": {
"basic1": "foxXXXXXXX",
"basic2": "brown",
"basic3" : "brown",
"basic4": "the QuIcK brOwn foxXXX",
"complex1" : "quickYYYYY"
}
}
}