feat(js): m03 rules with fixtures and tests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e9c41fed03
commit
2e39f23bb3
7 files changed
+1570
No files matched your search
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user