Arc Forumnew | comments | leaders | submitlogin
2 points by conanite 5991 days ago | link | parent

In arctap.arc

  (def not (c) (if c nil 1))
I think (no c) does what you want here?

Rainbow has a fairly comprehensive test suite for the arc foundation (260 tests) - see http://github.com/conanite/rainbow/tree/master/src/java/arc/... - please feel free to steal tests :)

It has a very simple runner - http://github.com/conanite/rainbow/tree/master/src/java/arc/... - somewhat inspired by junit, it supports the concept of nested tests nested inside test suites (in fact the tests started life in junit)

The test runner is still a bit limited - I haven't thought about how to test sockets or threads yet, for example.

It would be great to have a complete suite for arc so we can play spot-the-difference more easily when the next version comes out.

In fact, it might even be useful, for each test, to declare which implementations and versions it should pass for, so that we can run the suite and say with confidence "this conforms to Anarki 3.14, and to arc17", for example.



1 point by shlomif 5991 days ago | link

(no c) indeed does what I want, but I find its name counter-intuitive and not psychologically sound. Saying (if (no x)) does not sound as natural as (if (not x). I could define not by saying

  (= not no)
Or:

  (def (not x) (no x))
Etc. I recall searching for not in the arc sources and getting nothing because "no" was used instead. It's "not" in Perl 5, Ruby, etc. - not "no", so I assumed Graham would use it, but he didn't.

Regarding the tests - I can integrate them into my own test suite, but I only accept code that is under the MIT X11 licence, so I may not be able to copy-paste code like that. (I still don't know what licence the original Arc code is under).

Regarding your suggestion for implementation/version declaration, this seems interesting and is supported in TAP using TODO and SKIP tests, but will naturally require more logic and complexity.

-----

1 point by conanite 5991 days ago | link

see "copyright" in Arc distribution:

  This software is copyright (c) Paul Graham and Robert Morris.  Permission to use it is granted under the Perl Foundations's Artistic License 2.0.
Rainbow, ditto. In any case, you would need to adapt my tests to fit your framework, so it wouldn't exactly be copy-paste.

-----

1 point by absz 5991 days ago | link

The reason it's called no is that that is, in fact, what you're asking: the value representing false is the empty list, so there is (no c) there.

I'm not convinced I like the choice, but it is consistent, and does make sense.

-----