[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] [PATCH] Use more descriptive names in typematch-tes
[Chicken-hackers] [PATCH] Use more descriptive names in typematch-tests.scm
Fri, 30 Mar 2018 10:55:32 +0300
mu4e 0.9.18; emacs 25.1.1
while I was reading the file I decided to refactor the tests a bit.
The macro checkp wasn't quite doing what it was supposed to.
Checkp tests that predicates work. The statement (checkp PRED TYPE
VALUE) tries to assert that in a branch where (PRED VALUE) is true the
type of VALUE is TYPE.
There were these two tests that passed (with new checkp argument order) :
(checkp boolean? true #t)
(checkp boolean? false #f)
I replaced them with:
(checkp boolean? boolean #t)
(checkp boolean? boolean #f)
Then these three:
(checkp real? number (+ n))
(checkp exact? fixnum '1)
(checkp inexact? float '1.2)
The types in successful branches are *, number and number,
respectively. Indeed, none of those functions are declared predicates.
Maybe they should be?
I commented the originals and added tests that pass.
|[Prev in Thread]
||[Next in Thread]|
- [Chicken-hackers] [PATCH] Use more descriptive names in typematch-tests.scm,