Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

unit test words

76 views
Skip to first unread message

axtens

unread,
May 25, 2022, 12:16:04 AM5/25/22
to
With the thought of writing a track on Exercism.org for 8th, are there any unit test words for Forth-family languages?

-- Bruce

minf...@arcor.de

unread,
May 25, 2022, 1:41:11 AM5/25/22
to
axtens schrieb am Mittwoch, 25. Mai 2022 um 06:16:04 UTC+2:
> With the thought of writing a track on Exercism.org for 8th, are there any unit test words for Forth-family languages?
>

There is a test suite for _standard_ Forth wordsets. I would say 8th is non-standard.

Anton Ertl

unread,
May 25, 2022, 1:49:36 AM5/25/22
to
axtens <bruce....@gmail.com> writes:
>With the thought of writing a track on Exercism.org for 8th, are there any unit test words for Forth-family languages?

The Hayes tester and its descendent, ttester. Gerry Jackson maintains
a suite of unit tests for the standard words:

https://github.com/gerryjackson/forth2012-test-suite

where you can see usage examples.

- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2021: https://euro.theforth.net/2021

axtens

unread,
May 25, 2022, 2:33:39 AM5/25/22
to
On Wednesday, 25 May 2022 at 1:41:11 pm UTC+8, minf...@arcor.de wrote:
> . I would say 8th is non-standard.
Agreed. However, unless someone takes on the challenge of writing a standard Forth track at Exercism, the only example of a forth-ish language there will be 8th.

axtens

unread,
May 25, 2022, 3:35:55 AM5/25/22
to
On Wednesday, 25 May 2022 at 2:33:39 pm UTC+8, axtens wrote:
> On Wednesday, 25 May 2022 at 1:41:11 pm UTC+8, minf...@arcor.de wrote:
> > . I would say 8th is non-standard.
The other problem is finding a Forth standard that everyone will, if not "agree to", at least will consent to.

minf...@arcor.de

unread,
May 25, 2022, 4:19:45 AM5/25/22
to
IMO the Forth core wordset and its associated test programs tester.fr and core.fr
should run on any Forth system. It is the "agreed" bare minimum.

If it does not, the system is incomplete or presents a diverging dialect.

Bear in mind that more complete Forths are practically always full of
very individual (application domain specific) language extensions.

axtens

unread,
May 25, 2022, 5:22:44 AM5/25/22
to
On Wednesday, 25 May 2022 at 4:19:45 pm UTC+8, minf...@arcor.de wrote:
> IMO the Forth core wordset and its associated test programs tester.fr and core.fr
> should run on any Forth system. It is the "agreed" bare minimum.

What I was after originally was not a "test suite" but a "unit test library". I'm not really interested in establishing whether the Forth is compliant with a Forth standard. I'm more interested in working within the pedagogical framework of Exercism.

> Bear in mind that more complete Forths are practically always full of
> very individual (application domain specific) language extensions.

No disagreement there.

minf...@arcor.de

unread,
May 25, 2022, 5:40:07 AM5/25/22
to
axtens schrieb am Mittwoch, 25. Mai 2022 um 11:22:44 UTC+2:
> On Wednesday, 25 May 2022 at 4:19:45 pm UTC+8, minf...@arcor.de wrote:
> > IMO the Forth core wordset and its associated test programs tester.fr and core.fr
> > should run on any Forth system. It is the "agreed" bare minimum.
> What I was after originally was not a "test suite" but a "unit test library". I'm not really interested in establishing whether the Forth is compliant with a Forth standard. I'm more interested in working within the pedagogical framework of Exercism.

Sorry, I was not after compliance but after "unit testing".
So tester.fr provides Forth code for assertions in the form of
T{ ... -> ... }T

axtens

unread,
May 25, 2022, 5:48:29 AM5/25/22
to
On Wednesday, 25 May 2022 at 5:40:07 pm UTC+8, minf...@arcor.de wrote:
> Sorry, I was not after compliance but after "unit testing".
> So tester.fr provides Forth code for assertions in the form of
> T{ ... -> ... }T
My apologies. Okay, that's very interesting. I shall look into it further.

Thank you.
--Bruce

axtens

unread,
May 25, 2022, 6:09:04 AM5/25/22
to
And an example of its use in the documentation on question-dupe at http://lars.nocrew.org/forth2012/core/qDUP.html

Gerry Jackson

unread,
May 26, 2022, 2:36:03 AM5/26/22
to
There are many examples of the use of T{ ... }T in the Forth 2012
standard in the specifications for standard words. Also in Annex F Test
Suite.
See https://forth-standard.org/standard/testsuite

--
Gerry
0 new messages