Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forth: additional tests for "combined arithmetic" category #2477

Merged
merged 3 commits into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions exercises/forth/canonical-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@
"expected": {
"error": "only one value on the stack"
}
},
{
"uuid": "1e07a098-c5fa-4c66-97b2-3c81205dbc2f",
"description": "more than two values on the stack",
"property": "evaluate",
"input": {
"instructions": ["1 2 3 +"]
},
"expected": [1, 5]
}
]
},
Expand Down Expand Up @@ -98,6 +107,15 @@
"expected": {
"error": "only one value on the stack"
}
},
{
"uuid": "2c8cc5ed-da97-4cb1-8b98-fa7b526644f4",
"description": "more than two values on the stack",
"property": "evaluate",
"input": {
"instructions": ["1 12 3 -"]
},
"expected": [1, 9]
}
]
},
Expand Down Expand Up @@ -134,6 +152,15 @@
"expected": {
"error": "only one value on the stack"
}
},
{
"uuid": "5cd085b5-deb1-43cc-9c17-6b1c38bc9970",
"description": "more than two values on the stack",
"property": "evaluate",
"input": {
"instructions": ["1 2 3 *"]
},
"expected": [1, 6]
}
]
},
Expand Down Expand Up @@ -190,6 +217,15 @@
"expected": {
"error": "only one value on the stack"
}
},
{
"uuid": "f224f3e0-b6b6-4864-81de-9769ecefa03f",
"description": "more than two values on the stack",
"property": "evaluate",
"input": {
"instructions": ["1 12 3 /"]
},
"expected": [1, 4]
}
]
},
Expand All @@ -213,6 +249,24 @@
"instructions": ["2 4 * 3 /"]
},
"expected": [2]
},
{
"uuid": "f749b540-53aa-458e-87ec-a70797eddbcb",
"description": "multiplication and addition",
"property": "evaluate",
"input": {
"instructions": ["1 3 4 * +"]
},
"expected": [13]
IsaacG marked this conversation as resolved.
Show resolved Hide resolved
},
{
"uuid": "c8e5a4c2-f9bf-4805-9a35-3c3314e4989a",
"description": "addition and multiplication",
"property": "evaluate",
"input": {
"instructions": ["1 3 4 + *"]
},
"expected": [7]
}
]
},
Expand Down