Days -> spent looking for a job and packing/sorting/etc
Nights -> Scheme both using PLT and PocketScheme on my ipaq.
However, since I spent the last year in the middle of a programming culture where the first thing one was to do was develop a test for the function you wanted to write, I began to feel a little uneasy about my code until I figured out what it was: I had no unit testing ability.
So, I wrote a small little function called "assert" and it goes like this:
(define (assert test result)which then has a unit test for the list-join function described above as:
(if (equal? test result)
(display ".")
(display "F")
)
)
(assert (list-join (list 1 2 3) #\,) "1,2,3")While I was waiting at the doctor's office, I coded up a half dozen tests for my little framework and it wasn't until I googled "unit testing Scheme" that I found this gem: http://www.neilvandyke.org/testeez/ which is Unit Testing for R5RS.
Ah well.
No comments:
Post a Comment