Re: Unit-testing in same file

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu