Re: Unit-testing in same file
- Posted by petelomax Jul 29, 2012
- 996 views
I would normally rework such code as:
constant cc_numbers = { "49927398716",1, "49927398717",0, "1234567812345678",0, "1234567812345670",1 } for i = 1 to length(cc_numbers) by 2 do if luhn(cc_numbers[i])!=cc_numbers[i+1] then ?9/0 end if end for
and just leave it on permanently. If (and only if) I noticed a performance lag, I would add
constant TEST=0 if TEST then ... end if
Pete