Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Unittests?

From: robert:muench:robertmuench at: 2-Nov-2002 10:25

> -----Original Message----- > From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]] > On Behalf Of Gregg Irwin > Sent: Friday, November 01, 2002 8:05 PM > To: [rebol-list--rebol--com] > Subject: [REBOL] Re: Unittests? > Have you seen David Vydra's REBOL-Unit scripts?
Hi, no I haven't. Where can I find it?
> I don't know that you need it built into the language, since > you could just specify some special argument your scripts > look for. E.g. some folks load libraries with something like > "do/args %mylib.r 'as-lib" and the library itself checks to > see if it gets any args.
IMO this is a sub-optimal solution because you will need a special loader put into your source-code. IMO it's better to just have a 'unititest [] block or something like this, which gets executed before the normal script execution starts. So unit-tests are not executed by inserting special trigger code instead it's done automatically. I have thought about something like this several times now: 1. I would like to be able to run a script before the normal script is executed. Something like a preprocessor, a prolog for the actual script. This epilog should get some datastructures it can traverse like: - forall functions, forall blocks, forall unittests etc. With this you could do anything with the actual script. At the moment I find it quite hard to parse rebol-code. Maybe I haven't seen the right trick at the moment. I want to analyze the script that should be executed. 2. The same can be done for an epilog that get's executed after the script run. With this I could get all unittest blocks and execute these. I hope you understand where I want to go. Robert