Skip to content

Commit 0efd027

Browse files
committed
add arithmetic tests for "more than two values on the stack"
1 parent 6856f08 commit 0efd027

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

exercises/forth/canonical-data.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@
6262
"expected": {
6363
"error": "only one value on the stack"
6464
}
65+
},
66+
{
67+
"uuid": "1e07a098-c5fa-4c66-97b2-3c81205dbc2f",
68+
"description": "more than two values on the stack",
69+
"property": "evaluate",
70+
"input": {
71+
"instructions": ["1 2 3 +"]
72+
},
73+
"expected": [1, 5]
6574
}
6675
]
6776
},
@@ -98,6 +107,15 @@
98107
"expected": {
99108
"error": "only one value on the stack"
100109
}
110+
},
111+
{
112+
"uuid": "2c8cc5ed-da97-4cb1-8b98-fa7b526644f4",
113+
"description": "more than two values on the stack",
114+
"property": "evaluate",
115+
"input": {
116+
"instructions": ["1 12 3 -"]
117+
},
118+
"expected": [1, 9]
101119
}
102120
]
103121
},
@@ -134,6 +152,15 @@
134152
"expected": {
135153
"error": "only one value on the stack"
136154
}
155+
},
156+
{
157+
"uuid": "5cd085b5-deb1-43cc-9c17-6b1c38bc9970",
158+
"description": "more than two values on the stack",
159+
"property": "evaluate",
160+
"input": {
161+
"instructions": ["1 2 3 *"]
162+
},
163+
"expected": [1, 6]
137164
}
138165
]
139166
},
@@ -190,6 +217,15 @@
190217
"expected": {
191218
"error": "only one value on the stack"
192219
}
220+
},
221+
{
222+
"uuid": "f224f3e0-b6b6-4864-81de-9769ecefa03f",
223+
"description": "more than two values on the stack",
224+
"property": "evaluate",
225+
"input": {
226+
"instructions": ["1 12 3 /"]
227+
},
228+
"expected": [1, 4]
193229
}
194230
]
195231
},

0 commit comments

Comments
 (0)