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
25 changes: 22 additions & 3 deletions exercises/practice/wordy/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
# This is an auto-generated file. Regular comments will be removed when this
# file is regenerated. Regenerating will not touch any manually added keys,
# so comments can be added in a "comment" key.
# This is an auto-generated file.
#
# Regenerating this file via `configlet sync` will:
# - Recreate every `description` key/value pair
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
# - Preserve any other key/value pair
#
# As user-added comments (using the # character) will be removed when this file
# is regenerated, comments can be added via a `comment` key.

[88bf4b28-0de3-4883-93c7-db1b14aa806e]
description = "just a number"

[18983214-1dfc-4ebd-ac77-c110dde699ce]
description = "just a zero"

[607c08ee-2241-4288-916d-dae5455c87e6]
description = "just a negative number"

[bb8c655c-cf42-4dfc-90e0-152fcfd8d4e0]
description = "addition"

[bb9f2082-171c-46ad-ad4e-c3f72087c1b5]
description = "addition with a left hand zero"

[6fa05f17-405a-4742-80ae-5d1a8edb0d5d]
description = "addition with a right hand zero"

[79e49e06-c5ae-40aa-a352-7a3a01f70015]
description = "more addition"

Expand Down
14 changes: 13 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-02-15
# File last updated on 2025-06-20

import unittest

Expand All @@ -13,9 +13,21 @@ class WordyTest(unittest.TestCase):
def test_just_a_number(self):
self.assertEqual(answer("What is 5?"), 5)

def test_just_a_zero(self):
self.assertEqual(answer("What is 0?"), 0)

def test_just_a_negative_number(self):
self.assertEqual(answer("What is -123?"), -123)

def test_addition(self):
self.assertEqual(answer("What is 1 plus 1?"), 2)

def test_addition_with_a_left_hand_zero(self):
self.assertEqual(answer("What is 0 plus 2?"), 2)

def test_addition_with_a_right_hand_zero(self):
self.assertEqual(answer("What is 3 plus 0?"), 3)

def test_more_addition(self):
self.assertEqual(answer("What is 53 plus 2?"), 55)

Expand Down
Loading