From: John Benediktsson Date: Tue, 4 Apr 2023 20:58:48 +0000 (-0700) Subject: memoize: add another test case, only ( -- ) was broken X-Git-Tag: 0.99~441 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=52a03bbd0276cf3c0578f845cc27d1e459f67746 memoize: add another test case, only ( -- ) was broken --- diff --git a/core/memoize/memoize-tests.factor b/core/memoize/memoize-tests.factor index 8125f1237c..809cae2794 100644 --- a/core/memoize/memoize-tests.factor +++ b/core/memoize/memoize-tests.factor @@ -38,7 +38,7 @@ SYMBOL: foo-counter MEMO: foo ( -- ) foo-counter counter drop ; -[ 0 1 1 1 ] [ +{ 0 1 1 1 } [ foo-counter get-global foo foo-counter get-global @@ -47,3 +47,15 @@ MEMO: foo ( -- ) foo-counter counter drop ; foo foo-counter get-global ] unit-test + +SYMBOL: bar-counter +0 bar-counter set-global + +MEMO: bar ( -- x ) bar-counter counter ; + +{ 0 1 1 1 } [ + bar-counter get-global + bar + bar + bar +] unit-test