76 lines
1.0 KiB
JSON
76 lines
1.0 KiB
JSON
{
|
|
"function": "move",
|
|
"cases": [
|
|
{
|
|
"name": "move-up",
|
|
"args": [
|
|
{
|
|
"x": 3,
|
|
"y": 3
|
|
},
|
|
"Up"
|
|
],
|
|
"expected": {
|
|
"x": 3,
|
|
"y": 2
|
|
}
|
|
},
|
|
{
|
|
"name": "move-down",
|
|
"args": [
|
|
{
|
|
"x": 3,
|
|
"y": 3
|
|
},
|
|
"Down"
|
|
],
|
|
"expected": {
|
|
"x": 3,
|
|
"y": 4
|
|
}
|
|
},
|
|
{
|
|
"name": "move-left",
|
|
"args": [
|
|
{
|
|
"x": 3,
|
|
"y": 3
|
|
},
|
|
"Left"
|
|
],
|
|
"expected": {
|
|
"x": 2,
|
|
"y": 3
|
|
}
|
|
},
|
|
{
|
|
"name": "move-right",
|
|
"args": [
|
|
{
|
|
"x": 3,
|
|
"y": 3
|
|
},
|
|
"Right"
|
|
],
|
|
"expected": {
|
|
"x": 4,
|
|
"y": 3
|
|
}
|
|
},
|
|
{
|
|
"name": "move-does-not-wrap-at-the-edge",
|
|
"args": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
},
|
|
"Up"
|
|
],
|
|
"expected": {
|
|
"x": 0,
|
|
"y": -1
|
|
}
|
|
}
|
|
]
|
|
}
|