From b244a3d6531b1e67df0877df2083b18ba6e2df06 Mon Sep 17 00:00:00 2001 From: Pavel Date: Fri, 24 Feb 2023 23:10:53 +0400 Subject: [PATCH] add test and fix solution --- forth/eval_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/forth/eval_test.go b/forth/eval_test.go index eca76d3..6f20226 100644 --- a/forth/eval_test.go +++ b/forth/eval_test.go @@ -244,6 +244,11 @@ var testCases = []testCase{ input: []string{": SWAP DUP Dup dup ;", "1 swap"}, expected: []int{1, 1, 1, 1}, }, + { + description: "redefine of builtin after define user function on it", + input: []string{": foo dup ;", ": dup 1 ;", "2 foo"}, + expected: []int{2, 2}, + }, } func TestEval(t *testing.T) {