[mercury-users] qcheck custom non-DU generators?

doug.auclair at logicaltypes.com doug.auclair at logicaltypes.com
Wed Mar 15 16:52:01 AEDT 2006


Dear all,

Hi!  I have a qcheck unit test for the tautology:

init battery to X, Y = battery_power, X === Y

for :- func battery_power = float.

The problem is that X === Y is rare for floats. So, I've
embarked on an adventure of writing a custom generator
for floats which returns the first generated float for 
the second 50% of the time.

My problem is that qcheck's documentation describes
custom DU (discriminated union) generators fine, so long
as the rnd type is unused, but my generator is for a float
(which is not a DU) that does use the rnd type.

Does someone have a sample of doing something like
this for qcheck testing?

Sincerely,
Doug Auclair

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list