Re: [racket-users] Re: rackunit and logging

2020-05-24 Thread David Storrs
On Sat, May 23, 2020 at 9:54 AM Shriram Krishnamurthi wrote: > Thank you all! > > *Dave*, the documentation style is fine, it's sometimes easier to read > the doc right next to the implementation. (-: > > However, I'm not quite sure how even your example works. Maybe someone can > check my

Re: [racket-users] Re: rackunit and logging

2020-05-23 Thread Alex Harsanyi
As I mentioned in my previous post, the "unit" that can succeed or fail is the "test case", and this will work: #lang racket (require rackunit) (define-test-suite hw (test-case "one" (check-equal? 1 1)) (test-case "two" (check-equal? 1 (/ 1 0))) (test-case "three" (check-equal? 1 2)))

Re: [racket-users] Re: rackunit and logging

2020-05-23 Thread Alex Harsanyi
On Saturday, May 23, 2020 at 10:25:07 PM UTC+8, sk wrote: > > Thank you, Alex, this seems to have just the right set of information. I'm > curious why you use `foldts-test-suite` instead of `fold-test-results`, > whose documentation says "Hence it should be used in preference to >

Re: [racket-users] Re: rackunit and logging

2020-05-23 Thread Shriram Krishnamurthi
Thanks to a helpful reply from Matthias I came across this posting https://github.com/racket/rackunit/pull/107#issuecomment-480808330 which pointed out "The *test* forms are the things that wrap evaluation, catch errors and continue, etc." If I rewrite the above as (define-test-suite hw

Re: [racket-users] Re: rackunit and logging

2020-05-23 Thread Shriram Krishnamurthi
Sorry to be thinking out loud hereā€¦ I thought the reason Alex might be using `foldts-test-suite` instead of `fold-test-results` is because the latter automatically runs each test but the former leaves that in programmatic control. I thought this would enable me to catch exceptions, thus (using

Re: [racket-users] Re: rackunit and logging

2020-05-23 Thread Shriram Krishnamurthi
Thank you, Alex, this seems to have just the right set of information. I'm curious why you use `foldts-test-suite` instead of `fold-test-results`, whose documentation says "Hence it should be used in preference to foldts-test-suite

Re: [racket-users] Re: rackunit and logging

2020-05-23 Thread Shriram Krishnamurthi
Thank you all! *Alexis*, thanks for the explanation. *Alex*, thanks for that information. I'm going to go investigate that next. *Dave*, the documentation style is fine, it's sometimes easier to read the doc right next to the implementation. (-: However, I'm not quite sure how even your

[racket-users] Re: rackunit and logging

2020-05-22 Thread Alex Harsanyi
You can use foldts-test-suite (part of the rackunit package) to write your own test runner which collects and reports on the tests according to your