notjack
2020-12-15 03:46:23

I’m adding some test cases to the existing test files in racket-test-core. I’ve only used rackunit before though, which these tests don’t use. How does this test framework work?


samth
2020-12-15 03:49:11

Creatively



samth
2020-12-15 03:50:26

That means that (equal? ’a “a”) is supposed to produce #f



samth
2020-12-15 03:52:40

The actual test harness is defined here: https://github.com/racket/racket/blob/master/pkgs/racket-test-core/tests/racket/testing.rktl and is older than all of my students


shu--hung
2020-12-15 03:56:54

To run them: raco test -l tests/racket/test or run the same test.rkt file.


shu--hung
2020-12-15 03:57:44

and fwiw some test files may also define their own wrapper over test, e.g. https://github.com/racket/racket/blob/master/pkgs/racket-test-core/tests/racket/control.rktl#L15


notjack
2020-12-15 03:59:47

whispering quietly to myself one refactoring at a time, jack, one refactoring at a time


notjack
2020-12-15 04:06:01

When (test expected f x y) checks that (f x y) produces expected, does it do so with eq? or with equal?


notjack
2020-12-15 04:07:23

ah I see in the comments for testing.rktl that it uses equal?


samth
2020-12-15 04:55:33

Rewriting that isn’t likely — believe me I’ve thought about it


samth
2020-12-15 04:56:47

And to run them I recommend racket -f quiet.rktl basic.rktl or whatever file instead of basic you’re modifying


notjack
2020-12-15 04:57:22

I uh, don’t actually build racket from source on my machine. I still have 7.8 installed. When I edit stuff in core racket I just rely on the pull request CI.