From 9b65f28572b2c653c678fd15f146e029a6fcda86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Thu, 12 Nov 2026 12:12:18 +0200 Subject: [PATCH] forth: add tests for definitions that use built-in words The existing tests check that a definition keeps the meaning its words had when it was defined, but only for user-defined words. Add the same checks for built-in words. Co-Authored-By: Claude Fable 5.2 --- exercises/forth/canonical-data.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/exercises/forth/canonical-data.json b/exercises/forth/canonical-data.json index 38389cdc28..07ac4b2e83 100644 --- a/exercises/forth/canonical-data.json +++ b/exercises/forth/canonical-data.json @@ -519,6 +519,31 @@ }, "expected": [11] }, + { + "uuid": "3ce7a6d1-8a01-48f3-9ee8-66ae48a7dac6", + "description": "can use built-in words as they were when the word was defined", + "property": "evaluate", + "input": { + "instructions": [ + ": sum + ;", + ": + * ;", + "2 3 sum" + ] + }, + "expected": [5] + }, + { + "uuid": "9972320e-dc7c-496e-a880-f09ea5009559", + "description": "can define word that uses built-in word with the same name", + "property": "evaluate", + "input": { + "instructions": [ + ": dup dup dup ;", + "1 dup" + ] + }, + "expected": [1, 1, 1] + }, { "uuid": "35958cee-a976-4a0f-9378-f678518fa322", "description": "cannot redefine non-negative numbers",