chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH][5] Use more descriptive names in typematch-tes


From: megane
Subject: [Chicken-hackers] [PATCH][5] Use more descriptive names in typematch-tests.scm
Date: Fri, 30 Mar 2018 10:55:32 +0300
User-agent: mu4e 0.9.18; emacs 25.1.1

Hello,

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.

Cheers,

Attachment: refactor-typematch-tests.patch
Description: patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]