Re: bigatom in The Archive

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

thanks for posting the code and to _Tom too.

I have started a test file that doesn't have much in it now but you might find this is a good way to check nothing is broken as you work on the lib.

you could add more tests as you add to bigatom and see if anything fails, without needing to look through dozens of pages output by bigatom-test.ex

unittest is part of the stdlib of euphoria.

--t_bigatom.e  some tests for bigatom from bigatom-text.ex 
 
include std/unittest.e 
include std/sequence.e 
include std/text.e 
include std/types.e 
include std/math.e 
include std/sort.e 
 
include bigatom.e as B --default namespace is bigatom 
 
 
sequence s, t 
 
sequence sc = scale() 
sc = scale(9,0) 
sc = scale() 
test_equal("set scale1 9,0", {9,0}, sc ) 
sc = scale(9,0) 
test_equal("set scale2 9,0", {9,0}, sc ) 
 
 
 
sequence fmt  = "%24.7cB <==\n" -- sin zdecs (0.0000000) si no es cero 
sequence fmt2 = "%24.07cB <== " -- con zdecs (+/-0.0000000) 
sequence fmt3 = "%B\n"          -- con todos los d?gitos 
 
 
sc = scale(50) 
test_equal("previous scale", {40,0}, sc ) 
sc = scale() 
test_equal("current scale", {50,0}, sc ) 
   
 
 
-- more to be converted from bigatom-test.ex 
 
 
ba_printf(1,"ba_logb(\"9999.99999\", 10) = %B\n", ba_logb("9999.99999", 10)) 
--ba_printf(1,"ba_log10(\"9999.99999\") = %B\n", ba_log10("9999.99999")) 
 
--trace(1) 
 
s = "__ -231.2345 e-12e++..--Eholae" 
t = { 
  -1, 
  -10, 
  {2,3,1,2,3,4,5} 
} 
test_equal("ba_new("&s, t, ba_new(s)) 
 
s = "__ -231.2345e-12e++..--Eholae" 
test_equal("ba_new("&s, t, ba_new(s)) 
 
 
-- ? ba_new("")   
test_equal("ba_new('') ", {-2,0,{}}, ba_new("")  ) 
 
test_report() 
 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu