Skip to content
Merged
Show file tree
Hide file tree
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
24 changes: 24 additions & 0 deletions exercises/practice/wordy/.meta/additional_tests.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
{
"cases": [
{
"description": "4 number question",
"property": "answer",
"input": {
"question": "What is 1 plus -10 multiplied by 3 minus 4?"
},
"expected": -31
},
{
"description": "4 number question with zero",
"property": "answer",
"input": {
"question": "What is 12 minus 0 divided by 6 plus 5?"
},
"expected": 7
},
{
"description": "5 number question",
"property": "answer",
"input": {
"question": "What is 3 multiplied by 6 minus 2 divided by 4 plus 11?"
},
"expected": 15
},
{
"description": "Missing operation",
"property": "answer",
Expand Down
3 changes: 2 additions & 1 deletion exercises/practice/wordy/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"rootulp",
"sjakobi",
"tqa236",
"yawpitch"
"yawpitch",
"yrahcaz7"
],
"files": {
"solution": [
Expand Down
13 changes: 12 additions & 1 deletion exercises/practice/wordy/wordy_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/wordy/canonical-data.json
# File last updated on 2025-06-20
# File last updated on 2026-05-22

import unittest

Expand Down Expand Up @@ -111,6 +111,17 @@ def test_reject_prefix_notation(self):

# Additional tests for this track

def test_4_number_question(self):
self.assertEqual(answer("What is 1 plus -10 multiplied by 3 minus 4?"), -31)

def test_4_number_question_with_zero(self):
self.assertEqual(answer("What is 12 minus 0 divided by 6 plus 5?"), 7)

def test_5_number_question(self):
self.assertEqual(
answer("What is 3 multiplied by 6 minus 2 divided by 4 plus 11?"), 15
)

def test_missing_operation(self):
with self.assertRaises(ValueError) as err:
answer("What is 2 2 minus 3?")
Expand Down
Loading