diff options
Diffstat (limited to 'tests')
34 files changed, 1890 insertions, 859 deletions
diff --git a/tests/Makefile b/tests/Makefile index 1082665..af083a8 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,14 +1,11 @@ # Makefile for testing Icon -# The default is to run all tests, using icont. +# The default is to run all tests. Test Test-icont: ; cd general; $(MAKE) Test Samples Samples-icont: ; cd general; $(MAKE) Samples -Test-iconc: ; cd general; $(MAKE) Test-iconc -Samples-iconc: ; cd general; $(MAKE) Samples-iconc - # Clean up. diff --git a/tests/README b/tests/README index ce7ac17..9b1c30b 100644 --- a/tests/README +++ b/tests/README @@ -1,5 +1,4 @@ -The sub-directories here contain various test material for -Version 9.4 of Icon. +The sub-directories here contain various test material for Version 9.5 of Icon. bench benchmarking suite general main test suite, including quick "samples" subset diff --git a/tests/bench/Comp-iconc b/tests/bench/Comp-iconc deleted file mode 100755 index eb5dafe..0000000 --- a/tests/bench/Comp-iconc +++ /dev/null @@ -1,5 +0,0 @@ -for i in $* -do - echo compiling $i - ../../bin/iconc -s -o $i-c $i -done diff --git a/tests/bench/Run-icont b/tests/bench/Execute-icont index e81defd..e81defd 100755 --- a/tests/bench/Run-icont +++ b/tests/bench/Execute-icont diff --git a/tests/bench/Makefile b/tests/bench/Makefile index d0e4b6f..00afb52 100644 --- a/tests/bench/Makefile +++ b/tests/bench/Makefile @@ -1,25 +1,13 @@ -what: - @echo "What do you want to make?" +default: benchmark -benchmark: - $(MAKE) benchmark-icont - - -benchmark-iconc: - $(MAKE) compile-iconc run-iconc check-iconc - -compile-iconc: - sh Comp-iconc concord deal ipxref queens rsg -run-iconc: - sh Run-iconc - -rerun-iconc: - sh ReRun-iconc - -check-iconc: - grep elapsed *-c.out +micro microbench microbenchmark: + ../../bin/icon micro.icn >micro.out + ../../bin/icon micsum.icn micro.out >micro.sum + cat micro.sum +benchmark: + $(MAKE) benchmark-icont benchmark-icont: $(MAKE) translate-icont compile-icont run-icont check-icont @@ -31,7 +19,7 @@ compile-icont: sh Comp-icont concord deal ipxref queens rsg run-icont: - sh Run-icont + sh Execute-icont rerun-icont: sh ReRun-icont @@ -40,5 +28,4 @@ check-icont: grep elapsed *-t.out Clean: - rm -f *.out concord-[ct] deal-[ct] ipxref-[ct] queens-[ct] \ - rsg-[ct] *.u? + rm -f *.out *.sum *-t *.u? diff --git a/tests/bench/ReRun-iconc b/tests/bench/ReRun-iconc deleted file mode 100755 index 1695aa2..0000000 --- a/tests/bench/ReRun-iconc +++ /dev/null @@ -1,10 +0,0 @@ -echo Running concord ... -./concord-c <concord.dat >>concord-c.out -echo Running deal ... -./deal-c -h 500 >>deal-c.out -echo Running ipxref ... -./ipxref-c <ipxref.icn >>ipxref-c.out -echo Running queens ... -./queens-c -n9 >>queens-c.out -echo Running rsg ... -./rsg-c <rsg.dat >>rsg-c.out diff --git a/tests/bench/Run-iconc b/tests/bench/Run-iconc deleted file mode 100755 index 4a8c58d..0000000 --- a/tests/bench/Run-iconc +++ /dev/null @@ -1,10 +0,0 @@ -echo Running concord ... -./concord-c <concord.dat >concord-c.out -echo Running deal ... -./deal-c -h 500 >deal-c.out -echo Running ipxref ... -./ipxref-c <ipxref.icn >ipxref-c.out -echo Running queens ... -./queens-c -n9 >queens-c.out -echo Running rsg ... -./rsg-c <rsg.dat >rsg-c.out diff --git a/tests/bench/micro.icn b/tests/bench/micro.icn new file mode 100644 index 0000000..7654b7a --- /dev/null +++ b/tests/bench/micro.icn @@ -0,0 +1,976 @@ +# micro.icn -- microbenchmark timings of Icon operations +# +# From the Jcon distribution: +# 14-feb-98/gmt +# 13-mar-98/gmt +# 25-mar-98/gmt +# 2-apr-98/gmt +# 3-apr-98/gmt +# Revised for Icon v9: +# 5-nov-09/gmt +# +# usage: icon micro.icn interval +# +# Various Icon operations are executed inside an "every 1 to n" loop, +# with n scaled to execute the loop for at least <interval> seconds. +# Timings are based on &time, which must be meaningful or all bets are off. +# +# For each operation, execution time per iteration is given in nanoseconds. +# Automatic calibration produces a delay of a few seconds before the +# first line is output. This first line reports the measured overhead +# of an empty loop, which is subtracted from subsequent values. +# +# Timings labeled "nothing" are remeasurements of the empty loop. +# They should ideally be zero; deviations indicate inaccuracies +# and inconsistencies in the timing measurements. + + +$define DefaultTime 1.0 # default measurement interval, in seconds +$define MinOvhTime 1.0 # minimum interval for overhead measurement +$define NumOvhLoops 5 # number of overhead measurements to take + +global looptime # expected loop time, in msec +global overhead # measured loop overhead, in nsec + +global sink # output file for I/O tests + + +procedure main(args) + local olist, ovhtime + + looptime := integer(1000 * (args[1] | DefaultTime)) + sink := open("/dev/null", "w") + + # use median of five tries for overhead value + ovhtime := looptime + ovhtime <:= integer(1000 * MinOvhTime) + olist := list() + every 1 to NumOvhLoops do { + writes(&errout,".") + put(olist, measure(nothing, ovhtime)) + } + overhead := sort(olist)[1 + (*olist - 1) / 2] # median + write(right(overhead, 10), " overhead") + + report(nothing) + report(nothing) + report(nothing) + + report(globasgn) + report(statasgn) + report(loclasgn) + + report(if0) + report(case3) + report(nulltest) + report(typef) + report(imagef) + report(everyto) + report(everyalt) + report(conj5) + report(nullfunc) + report(listcall) + report(marshal) + report(evsusp) + + report(tointeger) + report(intcoerce) + report(uplus) + report(tostring) + report(strcoerce) + report(absf) + report(intadd) + report(addfunc) + report(intpow) + report(intcmp) + report(rfact0) + report(rfact10) + report(rfib5) + report(prslow) + + report(toreal) + report(realcoerce) + report(uplusr) + report(rtostring) + report(strcoercer) + report(realcmp) + report(sqrtf) + report(cosf) + report(logf) + + report(charf) + report(ordf) + report(strsize) + report(strpick) + report(strbang) + report(strsub) + report(substr) + report(subsasg) + report(strcmp) + report(strident) + report(concat) + + report(reversef) + report(trimf) + report(replf) + report(leftf) + report(centerf) + report(rightf) + report(entabf) + report(detabf) + report(mapf) + + report(nullscan) + report(movef) + report(tabf) + report(matchf) + report(tabmat) + report(posf) + report(anyf) + report(manyf) + report(uptof) + report(findf) + report(balf) + + report(tocset) + report(cssize) + report(cscompl) + + report(lcreate) + report(lconst) + report(lcopy) + report(lsort) + report(lsize) + report(lpick) + report(lbang) + report(lsubscr) + report(putget) + report(putget12) + report(pushpop) + report(pushpop12) + + report(setcreate) + report(setcopy) + report(setmember) + report(setinsert) + report(setinsdel) + report(setbang) + report(setpick) + + report(tblcreate) + report(tblsub) + report(tblasgn) + + report(recconstr) + report(reccopy) + report(recfield) + report(bigfield) + + report(readz) + report(writecon) + report(writestr) + + report(cxcreate) + report(cxget) + + report(nothing) + report(nothing) + report(nothing) + + write(&errout) +end + +procedure report(proc) + local label + label := proc() + writes(&errout, ".") # progress indicator + write(right(measure(proc, looptime) - overhead, 10), " ", label) + return +end + +procedure measure(proc, looptime) + local n, t1, t2, dt, nsec + + proc(1) # prime the pump -- load classes etc. + n := 1 + t2 := &time + + repeat { + n *:= 10 + t1 := t2 + proc(n) # call proc n times + t2 := &time # get ending time + dt := integer(t2 - t1) + if dt >= looptime / 20 then # if close enough to estimate + break + } + + n := integer(1.1 * n * looptime / real(dt)) # calc final loop count + collect() # clean up accumulated garbage + + t1 := &time + until t1 ~=:= &time # await next tick + proc(n) # run timing loop for real + t2 := &time # calculate elapsed time + dt := integer(t2 - t1) + + t1 := dt / real(n) + nsec := integer(t1 * 1000000 + 0.5) + return nsec +end + + + +####################### microbenchmark procedures ##################### + + + +procedure nothing(n) + if /n then return "nothing" + every 1 to n do + 0 +end + + + +procedure uplus(n) + if /n then return "+407" + every 1 to n do + +407 +end + +procedure uplusr(n) + if /n then return "+7.25" + every 1 to n do + +7.25 +end + +procedure absf(n) + if /n then return "abs(-3)" + every 1 to n do + abs(-3) +end + +procedure intadd(n) + if /n then return "4 + 7" + every 1 to n do + 4 + 7 +end + +procedure intcmp(n) + if /n then return "4 < 7" + every 1 to n do + 4 < 7 +end + +procedure intpow(n) + if /n then return "4 ^ 7" + every 1 to n do + 4 ^ 7 +end + +procedure realcmp(n) + if /n then return "1.6 < 2.7" + every 1 to n do + 1.6 < 2.7 +end + +procedure cosf(n) + if /n then return "cos(0.2)" + every 1 to n do + cos(0.2) +end + +procedure sqrtf(n) + if /n then return "sqrt(7.4)" + every 1 to n do + sqrt(7.4) +end + +procedure logf(n) + if /n then return "log(25.,17.)" + every 1 to n do + log(25.,17.) +end + + + + + + +procedure nullfunc(n) + if /n then return "p()" + every 1 to n do + nullf() +end + + procedure nullf() + end + +procedure listcall(n) + static L + initial L := [] + if /n then return "p ! L" + every 1 to n do + nullf ! L +end + +procedure addfunc(n) + if /n then return "add(4, 7)" + every 1 to n do + add(4, 7) +end + procedure add(a, b) + return a + b + end + + +procedure rfact0(n) + if /n then return "rfact(0)" + every 1 to n do + rfact(0) +end + +procedure rfact10(n) + if /n then return "rfact(10)" + every 1 to n do + rfact(10) +end + +procedure rfact(n) # makes n recursive calls + if n < 1 then return 1 + else return n * rfact(n - 1) +end + + +procedure rfib5(n) + if /n then return "rfib(5)" + every 1 to n do + rfib(5) +end + +procedure rfib(n) # slow, recursive Fibonacci + if n < 3 then + return 1 + else + return rfib(n - 2) + rfib(n - 1) +end + + +procedure prslow(n) # slow prime number counting + local i, k + if /n then return "prslow(7)" + every 1 to n do { + k := 0 + every i := 2 to 7 do { + if i % (2 to i - 1) = 0 then + next + k +:= 1 + } + } +end + + +procedure if0(n) + if /n then return "if 0 then 1" + every 1 to n do + if 0 then 1 +end + +procedure case3(n) + if /n then return "case 3 of..." + every 1 to n do + case 3 of { + 1 : 1 + 2 : 2 + 3 : 3 + 4 : 4 + default : 0 + } +end + +procedure nulltest(n) + if /n then return "\\8" + every 1 to n do + \8 +end + +procedure typef(n) + if /n then return "type(s)" + every 1 to n do + type("abcde") +end + +procedure imagef(n) + if /n then return "image(s)" + every 1 to n do + image("ab\tcd") +end + + +procedure marshal(n) + if /n then return "2(3,1,4,1,6)" + every 1 to n do + 2 (3, 1, 4, 1, 6) +end + + +procedure conj5(n) + if /n then return "1&2&3&4&5" + every 1 to n do + 1 & 2 & 3 & 4 & 5 +end + +procedure everyalt(n) + if /n then return "1|2|3|4|5" + every 1 to n do + every 1 | 2 | 3 | 4 | 5 +end + +procedure everyto(n) + if /n then return "1 to 5" + every 1 to n do + every 1 to 5 +end + +procedure evsusp(n) + if /n then return "suspend i" + every susproc(n) +end + procedure susproc(n) + suspend 1 to n + end + + +procedure intcoerce(n) + if /n then return "+\"407\"" + every 1 to n do + +"407" +end + +procedure realcoerce(n) + if /n then return "+\"7.25\"" + every 1 to n do + +"7.25" +end + +procedure strcoerce(n) + if /n then return "*407" + every 1 to n do + *407 +end + +procedure strcoercer(n) + if /n then return "*7.25" + every 1 to n do + *7.25 +end + + + +procedure tointeger(n) + if /n then return "integer(\"407\")" + every 1 to n do + integer("407") +end + +procedure toreal(n) + if /n then return "real(\"7.25\")" + every 1 to n do + real("407") +end + +procedure tostring(n) + if /n then return "string(407)" + every 1 to n do + string(407) +end + +procedure rtostring(n) + if /n then return "string(7.25)" + every 1 to n do + string(7.25) +end + +procedure tocset(n) + if /n then return "cset(\"407\")" + every 1 to n do + cset("407") +end + + + +procedure charf(n) + if /n then return "char(65)" + every 1 to n do + char(65) +end + +procedure ordf(n) + if /n then return "ord(\"A\")" + every 1 to n do + ord("A") +end + +procedure strsize(n) + if /n then return "*\"abcde\"" + every 1 to n do + *"abcde" +end + +procedure concat(n) + if /n then return "\"a\" || \"b\"" + every 1 to n do + "a" || "b" +end + +procedure strpick(n) + if /n then return "?\"abcde\"" + every 1 to n do + ?"abcde" +end + +procedure strbang(n) + if /n then return "!\"12345\"" + every 1 to n do + every !"12345" +end + +procedure strsub(n) + if /n then return "\"abcde\"[3]" + every 1 to n do + "abcde"[3] +end + +procedure substr(n) + if /n then return "\"abcde\"[2:5]" + every 1 to n do + "abcde"[2:5] +end + +procedure subsasg(n) + local s + if /n then return "s[2:5] := \"x\"" + every 1 to n do + (s := "abcde")[2:5] := "x" +end + +procedure strcmp(n) + if /n then return "\"abc\">>\"aaa\"" + every 1 to n do + "abc" >> "aaa" +end + +procedure strident(n) + if /n then return "\"abc\"===\"aaa\"" + every 1 to n do + "abc" === "aaa" +end + +procedure replf(n) + if /n then return "repl(\"-\",20)" + every 1 to n do + repl("-", 20) +end + +procedure reversef(n) + if /n then return "reverse(\"a...z\")" + every 1 to n do + reverse("abcdefghijklmnopqrstuvwxyz") +end + +procedure leftf(n) + if /n then return "left(\"a\",10)" + every 1 to n do + left("a",10) +end + +procedure centerf(n) + if /n then return "center(\"a\",10)" + every 1 to n do + center("a",10) +end + +procedure rightf(n) + if /n then return "right(\"a\",10)" + every 1 to n do + right("a",10) +end + +procedure trimf(n) + if /n then return "trim(\"a ...\")" + every 1 to n do + trim("a ") +end + +procedure entabf(n) + if /n then return "entab(\"a ...\")" + every 1 to n do + entab("a ") +end + +procedure detabf(n) + if /n then return "detab(\"a\\tb\\tc\")" + every 1 to n do + detab("a\tb\tc") +end + +procedure mapf(n) + if /n then return "map(s1,s2,s3)" + every 1 to n do + map("abcde", "bcdef", "cdefg") +end + + +procedure nullscan(n) + if /n then return "s ? 0" + every 1 to n do + "abc" ? 0 +end + +procedure movef(n) + if /n then return "move(0)" + "abcde" ? every 1 to n do + move(0) +end + +procedure tabf(n) + if /n then return "tab(3)" + "abcde" ? every 1 to n do + tab(3) +end + +procedure matchf(n) + if /n then return "match(\"abc\")" + "abcde" ? every 1 to n do + match("abc") +end + +procedure tabmat(n) + if /n then return "s1 ? =s2" + "abcde" ? every 1 to n do + ="abd" +end + +procedure posf(n) + if /n then return "pos(-1)" + "abcde" ? every 1 to n do + pos(-1) +end + +procedure anyf(n) + if /n then return "any('aeiou')" + "abcde" ? every 1 to n do + any('aeiou') +end + +procedure manyf(n) + if /n then return "many(&lcase)" + "abcde" ? every 1 to n do + many(&lcase) +end + +procedure uptof(n) + if /n then return "upto('d')" + "abcde" ? every 1 to n do + upto('d') +end + +procedure findf(n) + if /n then return "find(\"de\")" + "abcde" ? every 1 to n do + find("de") +end + +procedure balf(n) + if /n then return "bal('+')" + "(a*b)+(c/d)" ? every 1 to n do + upto('+') +end + + +procedure cssize(n) + if /n then return "*&digits" + every 1 to n do + *&digits +end + +procedure cscompl(n) + if /n then return "~&digits" + every 1 to n do + ~&digits +end + + + +procedure lcreate(n) + if /n then return "list(5,0)" + every 1 to n do + list(5,0) +end + +procedure lconst(n) + local x + if /n then return "[1,2,3,4,5]" + every 1 to n do + x := [1,2,3,4,5] # must store, else jcont suppresses +end + +procedure lcopy(n) + static L + initial L := [1,2,3,4,5] + if /n then return "copy(L)" + every 1 to n do + copy(L) +end + +procedure lsort(n) + static L + initial L := [2,7,1,8,3] + if /n then return "sort(L)" + every 1 to n do + sort(L) +end + +procedure lsize(n) + static L + initial L := [1,2,3,4,5] + if /n then return "*L" + every 1 to n do + *L +end + +procedure lpick(n) + static L + initial L := [1,2,3,4,5] + if /n then return "?L" + every 1 to n do + ?L +end + +procedure lsubscr(n) + static L + initial L := [1,2,3,4,5] + if /n then return "L[3]" + every 1 to n do + L[3] +end + +procedure lbang(n) + static L + initial L := [1,2,3,4,5] + if /n then return "!L" + every 1 to n do + every !L +end + +procedure putget(n) + static L + initial L := [] + if /n then return "get(put(L,0))" + every 1 to n do + get(put(L,0)) +end + +procedure pushpop(n) + static L + initial L := [] + if /n then return "pop(push(L,0))" + every 1 to n do + pop(push(L,0)) +end + +procedure putget12(n) + static L + initial L := [3,1,4,1,5,9,2,6,5,3,5,8] + if /n then return "get(put(L12,0))" + every 1 to n do + get(put(L,0)) +end + +procedure pushpop12(n) + static L + initial L := [3,1,4,1,5,9,2,6,5,3,5,8] + if /n then return "pop(push(L12,0))" + every 1 to n do + pop(push(L,0)) +end + + + +procedure setcreate(n) + if /n then return "set()" + every 1 to n do + set() +end + +procedure setcopy(n) + static S + initial insert(S := set(), 5) + if /n then return "copy(S)" + every 1 to n do + copy(S) +end + +procedure setinsert(n) + static S + initial insert(S := set(), 5) + if /n then return "insert(S,5)" + every 1 to n do + insert(S,5) +end + +procedure setmember(n) + static S + initial insert(S := set(), 5) + if /n then return "member(S,5)" + every 1 to n do + member(S,5) +end + +procedure setinsdel(n) + static S + initial S := set() + if /n then return "insert+delete" + every 1 to n do + delete(insert(S,5),5) +end + +procedure setpick(n) + static S + initial insert(S := set(), 5) + if /n then return "?S" + every 1 to n do + ?S +end + +procedure setbang(n) + static S + initial every insert(S := set(), 1 to 5) + if /n then return "!S" + every 1 to n do + every !S +end + + + +procedure tblcreate(n) + if /n then return "table()" + every 1 to n do + table() +end + +procedure tblasgn(n) + static T + initial (T := table())[5] := 1 + if /n then return "T[5] := 1" + every 1 to n do + T[5] := 1 +end + +procedure tblsub(n) + static T + initial (T := table())[5] := 1 + if /n then return "T[5]" + every 1 to n do + T[5] +end + + + +record point(x,y) +record bigrec(alpha, beta, gamma, delta, epsilon, figaro, guido, horatio) + +procedure recconstr(n) + if /n then return "record(4,7)" + every 1 to n do + point(4,7) +end + +procedure reccopy(n) + static R + initial R := point(4,7) + if /n then return "copy(R)" + every 1 to n do + copy(R) +end + +procedure recfield(n) + static R + initial R := point(4,7) + if /n then return "R.f" + every 1 to n do + R.y +end + +procedure bigfield(n) + static R + initial R := bigrec() + if /n then return "R2.f" + every 1 to n do + R.horatio +end + + + +global ggg + +procedure globasgn(n) + if /n then return "global := 1" + every 1 to n do + ggg := 1 +end + +procedure loclasgn(n) + local i + if /n then return "local := 1" + every 1 to n do + i := 1 +end + +procedure statasgn(n) + static i + if /n then return "static := 1" + every 1 to n do + i := 1 +end + + + +procedure readz(n) + static f + initial f := open("/dev/zero","ru") + if /n then return "reads(zero,8)" + every 1 to n do + reads(f, 8) +end + +procedure writecon(n) + if /n then return "write(\"a...z\")" + every 1 to n do + write(sink, "abcdefghijklmnopqrstuvwxyz") +end + +procedure writestr(n) + static s + initial s := "abcdefghijklmnopqrstuvwxyz" + if /n then return "write(s)" + every 1 to n do + write(sink, s) +end + + +procedure cxcreate(n) + if /n then return "create |\"a\"" + every 1 to n do + create |"a" +end + +procedure cxget(n) + static C + initial C := create |"a" + if /n then return "@C" + every 1 to n do + @C +end + diff --git a/tests/bench/micsum.icn b/tests/bench/micsum.icn new file mode 100644 index 0000000..75bd8b6 --- /dev/null +++ b/tests/bench/micsum.icn @@ -0,0 +1,76 @@ +# micsum.icn -- summarize micro.icn outputs +# +# 24-dec-09/gmt +# +# usage: icon micsum.icn file... +# +# Reads one or more output files created by micro.icn and summarizes the +# contents. Overhead and "nothing" lines are treated specially. Remaining +# lines are considered true microbenchmarks. Output columns are: +# +# N number of microbenchmarks +# ovhead overhead measurement +# rmserr RMS average error from "nothing" lines +# median median microbenchmark time +# gmean geometric mean of microbenchmark times + + +procedure main(args) + local a, f + + write(" N ovhead rmserr median gmean filename") + if *args = 0 then + dofile(&input, "stdin") + else while a := get(args) do { + f := open(a) | stop("cannot open ", a) + dofile(f, a) + } +end + +procedure dofile(f, name) + local line, label, overhead, nothings, others, n, t, v + nothings := [] + others := [] + + while line := read(f) do line ? { + tab(many(' ')) + n := integer(tab(many('-0123456789'))) + tab(many(' ')) + label := tab(0) + if label == "overhead" then + overhead := n + else if label == "nothing" then + put(nothings, n) + else + put(others, n) + } + + # count of measurements + writes(*others) + + # overhead value + writes(right(overhead, 7)) + + # RMS error ("nothing" values) + t := 0 + every t +:= !nothings ^ 2 + t := integer(sqrt(t / *nothings) + 0.5) + writes(right(t, 7)) + + # median of other values + others := sort(others) + t := others[*others / 2 + 1] + writes(right(t, 7)) + + # geometric mean of other values + t := 0.0 + every v := !others do + t +:= (if v <= 0 then 0 else log(v)) + t := integer(&e ^ (t / *others) + 0.5) + writes(right(t, 7)) + + # file name + write(" ", name) + return + +end diff --git a/tests/bench/rsg.dat b/tests/bench/rsg.dat index 9b49b74..9b49b74 100755..100644 --- a/tests/bench/rsg.dat +++ b/tests/bench/rsg.dat diff --git a/tests/general/Makefile b/tests/general/Makefile index 56da471..78a4908 100644 --- a/tests/general/Makefile +++ b/tests/general/Makefile @@ -13,17 +13,10 @@ Test Test-icont: Test-programs Test-preproc Test-options # test programs Programs Programs-icont Test-programs: - IC=icont sh Test-icon + sh Test-icon Samples Samples-icont: - IC=icont sh Test-icon $(SAMPLES) - - -Test-iconc: - IC=iconc sh Test-icon - -Samples-iconc: - IC=iconc sh Test-icon $(SAMPLES) + sh Test-icon $(SAMPLES) # test preprocessor @@ -43,6 +36,15 @@ Test-options: : options test passed +# test garbage collection by forcing small region sizes +# (note: gc2 and kwds will fail) + +Test-tiny: + sh Test-icon 1000 1000 + + +# clean up + Clean: -rm -f *.u? *.c *.h foo.baz tmp1 tmp2 *.out *.err *.all -rm -f xx `find * -type f -perm -100 ! -name 'Test-*' -print` diff --git a/tests/general/Test-icon b/tests/general/Test-icon index 07ccb87..9c3b265 100755 --- a/tests/general/Test-icon +++ b/tests/general/Test-icon @@ -1,36 +1,37 @@ #!/bin/sh # -# Test-icont -- test the Icon translator and interpreter. +# Test-icon -- test the Icon translator and interpreter. # -# usage: Test-icont [file...] -# -# If $IC is set to iconc, the compiler will be used instead. +# usage: Test-icon [BLKSIZE [STRSIZE]] [file...] -IC=${IC-icont} -IC=../../bin/$IC +IC=../../bin/icont ICONX=../../bin/iconx unset IPATH LPATH FPATH unset BLKSIZE STRSIZE MSTKSIZE COEXPSIZE QLSIZE -# may be needed with Icon is built with BinaryHeader defined +# may be needed if Icon is built with BinaryHeader defined export ICONX +# check for BKLSIZE / STRSIZE arguments +case X$1 in + X[0-9]*) export BLKSIZE=$1; echo BLKSIZE=$1; shift;; +esac +case X$1 in + X[0-9]*) export STRSIZE=$1; echo STRSIZE=$1; shift;; +esac + # echo system environment echo "" uname -a # check that we have what we need -case $IC in - *icont) - ls ../../bin/icont ../../bin/iconx >/dev/null || exit 0 - echo "icont: `$IC -V 2>&1`" - echo "iconx: `$ICONX -V 2>&1`" - ;; - *iconc) - ls -l ../../bin/iconc ../../bin/rt.* || exit 0 - ;; -esac +ls ../../bin/icont ../../bin/iconx >/dev/null || exit 0 +echo "icont: `$IC -V 2>&1`" +echo "iconx: `$ICONX -V 2>&1`" + +# report enabled features +$IC -s features.icn -x # if no test files specified, run them all if [ $# = 0 ]; then diff --git a/tests/general/cfuncs.icn b/tests/general/cfuncs.icn index 40af8fe..4a1c856 100644 --- a/tests/general/cfuncs.icn +++ b/tests/general/cfuncs.icn @@ -1,33 +1,21 @@ -# A simple test of a few standard C functions -# for Unix platforms that implement loadfunc(). +# Test dynamic loading with a few standard cfuncs. -$ifdef _DYNAMIC_LOADING +link cfunc - link cfunc +procedure main() + local i - procedure main() - local i + every i := 500 to 513 do + gen(bitcount, i) - every i := 500 to 513 do - gen(bitcount, i) - gen(vword, 314159) - gen(lgconv, 10^30) - gen(unpack, "abcd") - gen(pack, 1684234849) - end + write() + gen(vword, 314159) + gen(lgconv, 10 ^ 30) + gen(unpack, "abcd") + gen(pack, 1684234849) +end - procedure gen(p, a) - write(image(p), "(", image(a), ") = ", p(a) | "[failed]") - return - end - -$else - - # fake the "passing" output when LoadFunc is not available, - # so that "make Tests" does not fail. - - procedure main() - every write(!open("cfuncs.std")) - end - -$endif +procedure gen(p, a) + write(image(p), "(", image(a), ") = ", p(a) | "[failed]") + return +end diff --git a/tests/general/cfuncs.std b/tests/general/cfuncs.std index de20183..6023894 100644 --- a/tests/general/cfuncs.std +++ b/tests/general/cfuncs.std @@ -12,6 +12,7 @@ function bitcount(510) = 8 function bitcount(511) = 9 function bitcount(512) = 1 function bitcount(513) = 2 + procedure vword(314159) = 314159 procedure lgconv(integer(~10^30)) = 1000000000000000000000000000000 procedure unpack("abcd") = 1684234849 diff --git a/tests/general/checkfpx.icn b/tests/general/checkfpx.icn deleted file mode 100644 index 947c4fe..0000000 --- a/tests/general/checkfpx.icn +++ /dev/null @@ -1,127 +0,0 @@ -procedure main() - write("This test of floating-point arithmetic is likely to show") - write("differences from platform to platform because of differences") - write("in floating-point precision and details of the routines that") - write("convert floating-point numbers to strings. If the values") - write("produced in local tests are approximately the same in magnitude") - write("as shown in the standard results, there's nothing to worry about.") - write("In addition, some platforms may show 0.0 as \"-0.0\". You can") - write("ignore this if you wish.") - p1() - p2() - p3() -end - -procedure p1() - write("every 1 to 10 do write(?0) ----> ",(every 1 to 10 do write(Image(?0))) | "none") - write("every i := 1 to 50 do write(real(repl(\"0\",i) || \"2.\")) ----> ",Image(every i := 1 to 50 do write(real(repl("0",i) || "2."))) | "none") - write("every i := 1 to 30 do write(integer(repl(\"0\",i) || \"2\")) ----> ",Image(every i := 1 to 30 do write(integer(repl("0",i) || "2"))) | "none") - write("2.0 ~=== +2.0 ----> ",Image(2.0 ~=== +2.0) | "none") - write("abs(3.0) ----> ",Image(abs(3.0)) | "none") - write("Image(2e13) ----> ",Image(Image(2e13)) | "none") - write("Image(0.0006) ----> ",Image(Image(0.0006)) | "none") - write("Image(2.0) ----> ",Image(Image(2.0)) | "none") - write("integer(2.0) ----> ",Image(integer(2.0)) | "none") - write("integer(2.7) ----> ",Image(integer(2.7)) | "none") - write("integer(\".\") ----> ",Image(integer(".")) | "none") - write("integer(\".3\") ----> ",Image(integer(".3")) | "none") - write("integer(\"0.3\") ----> ",Image(integer("0.3")) | "none") - write("integer(\" . 3\") ----> ",Image(integer(" . 3")) | "none") - write("integer(\"e2\") ----> ",Image(integer("e2")) | "none") - write("integer(\"3e500\") ----> ",Image(integer("3e500")) | "none") - write("numeric(2.0) ----> ",Image(numeric(2.0)) | "none") - write("numeric(2.7) ----> ",Image(numeric(2.7)) | "none") - write("numeric(\".\") ----> ",Image(numeric(".")) | "none") - write("numeric(\".3\") ----> ",Image(numeric(".3")) | "none") - write("numeric(\"0.3\") ----> ",Image(numeric("0.3")) | "none") -end - -procedure p2() - write("numeric(\" . 3\") ----> ",Image(numeric(" . 3")) | "none") - write("numeric(\"e2\") ----> ",Image(numeric("e2")) | "none") - write("numeric(\"3e500\") ----> ",Image(numeric("3e500")) | "none") - write("real(2) ----> ",Image(real(2)) | "none") - write("real(2.0) ----> ",Image(real(2.0)) | "none") - write("real(2.7) ----> ",Image(real(2.7)) | "none") - write("real(\"2\") ----> ",Image(real("2")) | "none") - write("real(\" 2\") ----> ",Image(real(" 2")) | "none") - write("real(\"2 \") ----> ",Image(real("2 ")) | "none") - write("real(\"+2\") ----> ",Image(real("+2")) | "none") - write("real(\"-2\") ----> ",Image(real("-2")) | "none") - write("real(\"- 2\") ----> ",Image(real("- 2")) | "none") - write("real(\" - 2 \") ----> ",Image(real(" - 2 ")) | "none") - write("real(\"\") ----> ",Image(real("")) | "none") - write("real(\"--2\") ----> ",Image(real("--2")) | "none") - write("real(\" \") ----> ",Image(real(" ")) | "none") - write("real(\"-\") ----> ",Image(real("-")) | "none") - write("real(\"+\") ----> ",Image(real("+")) | "none") - write("real(\".\") ----> ",Image(real(".")) | "none") - write("real(\".3\") ----> ",Image(real(".3")) | "none") - write("real(\"0.3\") ----> ",Image(real("0.3")) | "none") - write("real(\" . 3\") ----> ",Image(real(" . 3")) | "none") - write("real(\"e2\") ----> ",Image(real("e2")) | "none") - write("real(\"3e500\") ----> ",Image(real("3e500")) | "none") - write("real(\"7r4\") ----> ",Image(real("7r4")) | "none") - write("real(\"4r7\") ----> ",Image(real("4r7")) | "none") - write("real(\"4r 7\") ----> ",Image(real("4r 7")) | "none") - write("real(\"7r 4\") ----> ",Image(real("7r 4")) | "none") - write("real(\"16rff\") ----> ",Image(real("16rff")) | "none") - write("real(\"36rcat\") ----> ",Image(real("36rcat")) | "none") - write("real(\"36Rcat\") ----> ",Image(real("36Rcat")) | "none") - write("real(\"36rCAT\") ----> ",Image(real("36rCAT")) | "none") - write("real(\"1r1\") ----> ",Image(real("1r1")) | "none") - write("real(\"2r0\") ----> ",Image(real("2r0")) | "none") - write("real(\"22222222222222222222222222222\") ----> ",Image(real("22222222222222222222222222222")) | "none") - write("numeric(2.0) ----> ",Image(numeric(2.0)) | "none") - write("numeric(2.7) ----> ",Image(numeric(2.7)) | "none") - write("numeric(0.3) ----> ",Image(numeric(0.3)) | "none") - write("numeric(e2) ----> ",Image(numeric(e2)) | "none") - write("36. ^ 9 ----> ",Image(36. ^ 9) | "none") - write("36 ^ 9. ----> ",Image(36 ^ 9.) | "none") - write("36. ^ 9. ----> ",Image(36. ^ 9.) | "none") - write("-36. ^ 9 ----> ",Image(-36. ^ 9) | "none") - write("-36. ^ -9 ----> ",Image(-36. ^ -9) | "none") - write((every i := 1 to 37 do write(Image(real(repl("2",i) || ".")))) | "failed") - write((every i := 1 to 37 do write(Image(real(repl("2",i) || ".2")))) | "failed") - write((every i := 1 to 37 do write(Image((repl("2",i) || ".2") + 1))) | "failed") - write("2.0 === +2.0 ----> ",Image(2.0 === +2.0) | "none") - write("?30.0 ----> ",Image(?30.0) | "none") -end - -procedure p3() - write("copy(1.0) ----> ",Image(copy(1.0)) | "none") - write("trim(3.14159,58) ----> ",Image(trim(3.14159,58)) | "none") - write("Image(2e13) ----> ",Image(Image(2e13)) | "none") - write("Image(0.0006) ----> ",Image(Image(0.0006)) | "none") -end -procedure Image(x) - local head, tail, exp, span - - span := 9 - - if type(x) ~== "real" then return image(x) - else { - x ? { - if head := tab(upto('e')) - then { - tail := tab(0) - head ? return (tab(span | 0) || tail) - } - else { - head := tab(span - 1 | 0) - # - # if head is too small to include the ".", go to floating point - # format. - # - if exp := *tab(upto('.')) then - head ? return move(1) || "." || move(span - 3) || - "e+" || (span - 3 + exp) - else { - if head[-1] == "." then - head ||:= (move(1) | "0") - return head - } - } - } - } -end diff --git a/tests/general/checkfpx.std b/tests/general/checkfpx.std deleted file mode 100644 index 481dce3..0000000 --- a/tests/general/checkfpx.std +++ /dev/null @@ -1,283 +0,0 @@ -This test of floating-point arithmetic is likely to show -differences from platform to platform because of differences -in floating-point precision and details of the routines that -convert floating-point numbers to strings. If the values -produced in local tests are approximately the same in magnitude -as shown in the standard results, there's nothing to worry about. -In addition, some platforms may show 0.0 as "-0.0". You can -ignore this if you wish. -0.21132 -0.41242 -0.31579 -0.51044 -0.42173 -0.30569 -0.07960 -0.73752 -0.05072 -0.71694 -every 1 to 10 do write(?0) ----> none -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -2.0 -every i := 1 to 50 do write(real(repl("0",i) || "2.")) ----> none -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -every i := 1 to 30 do write(integer(repl("0",i) || "2")) ----> none -2.0 ~=== +2.0 ----> none -abs(3.0) ----> 3.0 -Image(2e13) ----> "2e+13" -Image(0.0006) ----> "0.0006" -Image(2.0) ----> "2.0" -integer(2.0) ----> 2 -integer(2.7) ----> 2 -integer(".") ----> none -integer(".3") ----> 0 -integer("0.3") ----> 0 -integer(" . 3") ----> none -integer("e2") ----> none -integer("3e500") ----> none -numeric(2.0) ----> 2.0 -numeric(2.7) ----> 2.7 -numeric(".") ----> none -numeric(".3") ----> 0.3 -numeric("0.3") ----> 0.3 -numeric(" . 3") ----> none -numeric("e2") ----> none -numeric("3e500") ----> none -real(2) ----> 2.0 -real(2.0) ----> 2.0 -real(2.7) ----> 2.7 -real("2") ----> 2.0 -real(" 2") ----> 2.0 -real("2 ") ----> 2.0 -real("+2") ----> 2.0 -real("-2") ----> -2.0 -real("- 2") ----> none -real(" - 2 ") ----> none -real("") ----> none -real("--2") ----> none -real(" ") ----> none -real("-") ----> none -real("+") ----> none -real(".") ----> none -real(".3") ----> 0.3 -real("0.3") ----> 0.3 -real(" . 3") ----> none -real("e2") ----> none -real("3e500") ----> none -real("7r4") ----> 4.0 -real("4r7") ----> none -real("4r 7") ----> none -real("7r 4") ----> none -real("16rff") ----> 255.0 -real("36rcat") ----> 15941.0 -real("36Rcat") ----> 15941.0 -real("36rCAT") ----> 15941.0 -real("1r1") ----> none -real("2r0") ----> 0.0 -real("22222222222222222222222222222") ----> 2.222222e+28 -numeric(2.0) ----> 2.0 -numeric(2.7) ----> 2.7 -numeric(0.3) ----> 0.3 -numeric(e2) ----> none -36. ^ 9 ----> 1.015599e+14 -36 ^ 9. ----> 1.015599e+14 -36. ^ 9. ----> 1.015599e+14 --36. ^ 9 ----> -1.01559e+14 --36. ^ -9 ----> -9.84640e-15 -2.0 -22.0 -222.0 -2222.0 -22222.0 -222222.0 -2.222222e+6 -2.222222e+7 -2.222222e+8 -2.222222e+9 -2.222222e+10 -2.222222e+11 -2.222222e+12 -2.222222e+13 -2.222222e+14 -2.222222e+15 -2.222222e+16 -2.222222e+17 -2.222222e+18 -2.222222e+19 -2.222222e+20 -2.222222e+21 -2.222222e+22 -2.222222e+23 -2.222222e+24 -2.222222e+25 -2.222222e+26 -2.222222e+27 -2.222222e+28 -2.222222e+29 -2.222222e+30 -2.222222e+31 -2.222222e+32 -2.222222e+33 -2.222222e+34 -2.222222e+35 -2.222222e+36 -failed -2.2 -22.2 -222.2 -2222.2 -22222.2 -222222.2 -2.222222e+6 -2.222222e+7 -2.222222e+8 -2.222222e+9 -2.222222e+10 -2.222222e+11 -2.222222e+12 -2.222222e+13 -2.222222e+14 -2.222222e+15 -2.222222e+16 -2.222222e+17 -2.222222e+18 -2.222222e+19 -2.222222e+20 -2.222222e+21 -2.222222e+22 -2.222222e+23 -2.222222e+24 -2.222222e+25 -2.222222e+26 -2.222222e+27 -2.222222e+28 -2.222222e+29 -2.222222e+30 -2.222222e+31 -2.222222e+32 -2.222222e+33 -2.222222e+34 -2.222222e+35 -2.222222e+36 -failed -3.2 -23.2 -223.2 -2223.2 -22223.2 -222223.2 -2.222223e+6 -2.222222e+7 -2.222222e+8 -2.222222e+9 -2.222222e+10 -2.222222e+11 -2.222222e+12 -2.222222e+13 -2.222222e+14 -2.222222e+15 -2.222222e+16 -2.222222e+17 -2.222222e+18 -2.222222e+19 -2.222222e+20 -2.222222e+21 -2.222222e+22 -2.222222e+23 -2.222222e+24 -2.222222e+25 -2.222222e+26 -2.222222e+27 -2.222222e+28 -2.222222e+29 -2.222222e+30 -2.222222e+31 -2.222222e+32 -2.222222e+33 -2.222222e+34 -2.222222e+35 -2.222222e+36 -failed -2.0 === +2.0 ----> 2.0 -?30.0 ----> 5 -copy(1.0) ----> 1.0 -trim(3.14159,58) ----> "3.14159" -Image(2e13) ----> "2e+13" -Image(0.0006) ----> "0.0006" diff --git a/tests/general/checkx.icn b/tests/general/checkx.icn deleted file mode 100644 index c1a8623..0000000 --- a/tests/general/checkx.icn +++ /dev/null @@ -1,182 +0,0 @@ -record array(a,b,c,d,e,f,g) - -procedure dummy(u,v,x,y,z) - suspend u | v - return x -end - -procedure main() - p1() - p2() - p3() - p4() - p5() - p6() - p7() - p8() - p9() -end - -procedure p1() - write("image(2) ----> ",image(image(2)) | "none") - write("image('cab') ----> ",image(image('cab')) | "none") - write("image(&lcase) ----> ",image(image(&lcase)) | "none") - write("image('abcdefghijklmnopqrstuvwxyz') ----> ",image(image('abcdefghijklmnopqrstuvwxyz')) | "none") - write("image(&input) ----> ",image(image(&input)) | "none") - write("image() ----> ",image(image()) | "none") - write("image(&null) ----> ",image(image(&null)) | "none") - write("image([1,2,3]) ----> ",image(image([1,2,3])) | "none") - write("image([]) ----> ",image(image([])) | "none") - write("image([,]) ----> ",image(image([,])) | "none") - write("image(table()) ----> ",image(image(table())) | "none") - write("image(table(3)) ----> ",image(image(table(3))) | "none") - write("image(list(0)) ----> ",image(image(list(0))) | "none") - write("image(repl) ----> ",image(image(repl)) | "none") - write("image(main) ----> ",image(image(main)) | "none") - write("image(repl(&lcase,10)) ----> ",image(image(repl(&lcase,10))) | "none") - write("image(array) ----> ",image(image(array)) | "none") - write("image(a) ----> ",image(image(a)) | "none") - write("image(array) ----> ",image(image(array)) | "none") - write("image(image) ----> ",image(image(image)) | "none") -end - -procedure p2() - write("integer(2) ----> ",image(integer(2)) | "none") - write("integer(\"2\") ----> ",image(integer("2")) | "none") - write("integer(\" 2\") ----> ",image(integer(" 2")) | "none") - write("integer(\"2 \") ----> ",image(integer("2 ")) | "none") - write("integer(\"+2\") ----> ",image(integer("+2")) | "none") - write("integer(\"-2\") ----> ",image(integer("-2")) | "none") - write("integer(\"- 2\") ----> ",image(integer("- 2")) | "none") - write("integer(\" - 2 \") ----> ",image(integer(" - 2 ")) | "none") - write("integer(\"\") ----> ",image(integer("")) | "none") - write("integer(\"--2\") ----> ",image(integer("--2")) | "none") - write("integer(\" \") ----> ",image(integer(" ")) | "none") - write("integer(\"-\") ----> ",image(integer("-")) | "none") - write("integer(\"+\") ----> ",image(integer("+")) | "none") - write("integer(\"7r4\") ----> ",image(integer("7r4")) | "none") - write("integer(\"4r7\") ----> ",image(integer("4r7")) | "none") - write("integer(\"4r 7\") ----> ",image(integer("4r 7")) | "none") - write("integer(\"7r 4\") ----> ",image(integer("7r 4")) | "none") - write("integer(\"16rff\") ----> ",image(integer("16rff")) | "none") - write("integer(\"36rcat\") ----> ",image(integer("36rcat")) | "none") - write("integer(\"36Rcat\") ----> ",image(integer("36Rcat")) | "none") - write("integer(\"36rCAT\") ----> ",image(integer("36rCAT")) | "none") - write("integer(\"1r1\") ----> ",image(integer("1r1")) | "none") - write("integer(\"2r0\") ----> ",image(integer("2r0")) | "none") - write("integer(integer) ----> ",image(integer(integer)) | "none") - write("integer := abs ----> ",image(integer := abs) | "none") -end - -procedure p3() - write("numeric(2) ----> ",image(numeric(2)) | "none") - write("numeric(\"2\") ----> ",image(numeric("2")) | "none") - write("numeric(\" 2\") ----> ",image(numeric(" 2")) | "none") - write("numeric(\"2 \") ----> ",image(numeric("2 ")) | "none") - write("numeric(\"+2\") ----> ",image(numeric("+2")) | "none") - write("numeric(\"-2\") ----> ",image(numeric("-2")) | "none") - write("numeric(\"- 2\") ----> ",image(numeric("- 2")) | "none") - write("numeric(\" - 2 \") ----> ",image(numeric(" - 2 ")) | "none") - write("numeric(\"\") ----> ",image(numeric("")) | "none") - write("numeric(\"--2\") ----> ",image(numeric("--2")) | "none") - write("numeric(\" \") ----> ",image(numeric(" ")) | "none") - write("numeric(\"-\") ----> ",image(numeric("-")) | "none") - write("numeric(\"+\") ----> ",image(numeric("+")) | "none") - write("numeric(\"7r4\") ----> ",image(numeric("7r4")) | "none") - write("numeric(\"4r7\") ----> ",image(numeric("4r7")) | "none") - write("numeric(\"4r 7\") ----> ",image(numeric("4r 7")) | "none") - write("numeric(\"7r 4\") ----> ",image(numeric("7r 4")) | "none") - write("numeric(\"16rff\") ----> ",image(numeric("16rff")) | "none") - write("numeric(\"36rcat\") ----> ",image(numeric("36rcat")) | "none") - write("numeric(\"36Rcat\") ----> ",image(numeric("36Rcat")) | "none") - write("numeric(\"36rCAT\") ----> ",image(numeric("36rCAT")) | "none") - write("numeric(\"1r1\") ----> ",image(numeric("1r1")) | "none") - write("numeric(\"2r0\") ----> ",image(numeric("2r0")) | "none") -end - -procedure p4() -end - -procedure p5() - write("numeric(2) ----> ",image(numeric(2)) | "none") - write("numeric(2) ----> ",image(numeric(2)) | "none") - write("numeric(+2) ----> ",image(numeric(+2)) | "none") - write("numeric(-2) ----> ",image(numeric(-2)) | "none") - write("numeric() ----> ",image(numeric()) | "none") - write("numeric(7r4) ----> ",image(numeric(7r4)) | "none") - write("numeric(16rff) ----> ",image(numeric(16rff)) | "none") - write("numeric(36rcat) ----> ",image(numeric(36rcat)) | "none") - write("numeric(36Rcat) ----> ",image(numeric(36Rcat)) | "none") - write("numeric(36rCAT) ----> ",image(numeric(36rCAT)) | "none") - write("numeric(2r0) ----> ",image(numeric(2r0)) | "none") - write("numeric(+-2) ----> ",image(numeric(+-2)) | "none") - write("numeric(++2) ----> ",image(numeric(++2)) | "none") - write("numeric(--2) ----> ",image(numeric(--2)) | "none") -end - -procedure p6() - write("36 ^ -9 ----> ",image(36 ^ -9) | "none") - write("-36 ^ -9 ----> ",image(-36 ^ -9) | "none") -end - -procedure p7() - write("f := open(\"foo.baz\",\"w\") ----> ",image(f := open("foo.baz","w")) | "none") - write("write(f,\"hello world\") ----> ",image(write(f,"hello world")) | "none") - write("close(f) ----> ",image(close(f)) | "none") -end - -procedure p8() - write("\ncset sizes and images:") - L := [ - '', - '<()>', - '\b\d\e\f\l\n\r\t\v', - &digits, - '0123456789', - '02468' ++ '13579', - ')!@#$%^&*(', - 'the icon programming language', - &lcase, - 'abcdefghijklmnopqrstuvwxyz', - &letters -- &ucase, - 'aBcDeFgHiJkLmNoPqRsTuVwXyZ', - &ucase, - 'ZYXWVUTSRQPONMLKJIHGFEDCBA', - &letters -- &lcase, - 'AbcdEfghIjklmnOpqrstUvwxyz', - 'The Quick Brown Fox Jumped Over The Lazy Gray Dog\'s Back', - &letters, - 'abcdefghijklmnopqrstuvwxyzZYXWVUTSRQPONMLKJIHGFEDCBA', - &lcase ++ &ucase, - 'abcdefghijk|mn.pqrstuvwxyz2YXWVUT5RQP0NMLKJ1HGFEDCBA', - &ascii, - &cset -- ~&ascii, - &cset, - &letters ++ ~&ucase, - &null] - pull(L) - every e := !L do { - s := image(e) # do this first to make image() calc the cset size - s[76:0] := "" - write (right(*e,3), " ", s) - } - write() -end - -procedure p9() - write(image(&ascii) | "failed") - write(image(&cset) | "failed") - write(image(&e) | "failed") - write(image(&fail) | "failed") - write(image(&input) | "failed") - write(image(&lcase) | "failed") - write(image(&null) | "failed") - write(image(&output) | "failed") - write(image(&phi) | "failed") - write(image(&pi) | "failed") - write(image(&pos) | "failed") - write(image(&random) | "failed") - write(image(&subject) | "failed") - write(image(&ucase) | "failed") - exit(abs(3.0)) -end diff --git a/tests/general/checkx.std b/tests/general/checkx.std deleted file mode 100644 index 15bd17f..0000000 --- a/tests/general/checkx.std +++ /dev/null @@ -1,129 +0,0 @@ -image(2) ----> "2" -image('cab') ----> "'abc'" -image(&lcase) ----> "&lcase" -image('abcdefghijklmnopqrstuvwxyz') ----> "&lcase" -image(&input) ----> "&input" -image() ----> "&null" -image(&null) ----> "&null" -image([1,2,3]) ----> "list_1(3)" -image([]) ----> "list_2(0)" -image([,]) ----> "list_3(2)" -image(table()) ----> "table_1(0)" -image(table(3)) ----> "table_2(0)" -image(list(0)) ----> "list_4(0)" -image(repl) ----> "function repl" -image(main) ----> "procedure main" -image(repl(&lcase,10)) ----> "\"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\"" -image(array) ----> "record constructor array" -image(a) ----> "&null" -image(array) ----> "record constructor array" -image(image) ----> "function image" -integer(2) ----> 2 -integer("2") ----> 2 -integer(" 2") ----> 2 -integer("2 ") ----> 2 -integer("+2") ----> 2 -integer("-2") ----> -2 -integer("- 2") ----> none -integer(" - 2 ") ----> none -integer("") ----> none -integer("--2") ----> none -integer(" ") ----> none -integer("-") ----> none -integer("+") ----> none -integer("7r4") ----> 4 -integer("4r7") ----> none -integer("4r 7") ----> none -integer("7r 4") ----> none -integer("16rff") ----> 255 -integer("36rcat") ----> 15941 -integer("36Rcat") ----> 15941 -integer("36rCAT") ----> 15941 -integer("1r1") ----> none -integer("2r0") ----> 0 -integer(integer) ----> none -integer := abs ----> function abs -numeric(2) ----> 2 -numeric("2") ----> 2 -numeric(" 2") ----> 2 -numeric("2 ") ----> 2 -numeric("+2") ----> 2 -numeric("-2") ----> -2 -numeric("- 2") ----> none -numeric(" - 2 ") ----> none -numeric("") ----> none -numeric("--2") ----> none -numeric(" ") ----> none -numeric("-") ----> none -numeric("+") ----> none -numeric("7r4") ----> 4 -numeric("4r7") ----> none -numeric("4r 7") ----> none -numeric("7r 4") ----> none -numeric("16rff") ----> 255 -numeric("36rcat") ----> 15941 -numeric("36Rcat") ----> 15941 -numeric("36rCAT") ----> 15941 -numeric("1r1") ----> none -numeric("2r0") ----> 0 -numeric(2) ----> 2 -numeric(2) ----> 2 -numeric(+2) ----> 2 -numeric(-2) ----> -2 -numeric() ----> none -numeric(7r4) ----> 4 -numeric(16rff) ----> 255 -numeric(36rcat) ----> 15941 -numeric(36Rcat) ----> 15941 -numeric(36rCAT) ----> 15941 -numeric(2r0) ----> 0 -numeric(+-2) ----> -2 -numeric(++2) ----> 2 -numeric(--2) ----> 2 -36 ^ -9 ----> 0 --36 ^ -9 ----> 0 -f := open("foo.baz","w") ----> file(foo.baz) -write(f,"hello world") ----> "hello world" -close(f) ----> file(foo.baz) - -cset sizes and images: - 0 '' - 4 '()<>' - 8 '\b\t\n\v\f\r\e\d' - 10 &digits - 10 &digits - 10 &digits - 10 '!#$%&()*@^' - 15 ' aceghilmnoprtu' - 26 &lcase - 26 &lcase - 26 &lcase - 26 'BDFHJLNPRTVXZacegikmoqsuwy' - 26 &ucase - 26 &ucase - 26 &ucase - 26 'AEIOUbcdfghjklmnpqrstvwxyz' - 31 ' \'BDFGJLOQTacdeghikmnoprsuvwxyz' - 52 &letters - 52 &letters - 52 &letters - 52 '.0125ABCDEFGHJKLMNPQRTUVWXYabcdefghijkmnpqrstuvwxyz|' -128 &ascii -128 &ascii -256 &cset -256 &cset - -&ascii -&cset -2.718281828 -failed -&input -&lcase -&null -&output -1.618033989 -3.141592654 -1 -0 -"" -&ucase diff --git a/tests/general/extlvals.icn b/tests/general/extlvals.icn new file mode 100644 index 0000000..0f394ba --- /dev/null +++ b/tests/general/extlvals.icn @@ -0,0 +1,71 @@ +# Test use of external values with dynamic loading, using demo cfunc. + +link cfunc + +record complex(r, i) + +procedure main() + local e, l, v1, v2, v3, v4 + local r1,r2,r3,r4, s1, s2, s3, s4 + + # test simple creation, type(), copy() + xwrite("v1", v1 := extxmin()) + xwrite("v2", v2 := extxmin()) + xwrite("v3", v3 := v1) + xwrite("v4", v4 := copy(v1)) + + # test string-based external example + xwrite("s1", s1 := extxstr("bite")) + xwrite("s2", s2 := extxstr("the")) + xwrite("s3", s3 := extxstr("wax")) + xwrite("s4", s4 := extxstr("tadpole")) + + # test real-based external example + xwrite("r1", r1 := extxreal(111.1)) + xwrite("r2", r2 := extxreal(222.2)) + xwrite("r3", r3 := extxreal(333.3)) + xwrite("r4", r4 := copy(r1)) + + # test === and ~=== + teqv(v1, v3, v2) + teqv(v1, v4, v2) + teqv(s2, copy(s2), s3) + teqv(r1, r1, copy(r1)) + teqv(s1, s1, s3) + teqv(r2, r2, r4) + teqv(s3, s3, r3) + + # test sorting + l := [ v1, s2, r3, v4, s1, r2, complex(8,9), v3, s4, r1, v2, s3, r4 ] + write() + every xwrite("before", !l) + write() + every xwrite("sorted", !sort(l)) + +end + + +# write label, type(xval), image(xval) + +procedure xwrite(label, xval) + write(label, ": ", type(xval), ": ",image(xval)) + return +end + + +# test equivalence of id1 and id2, and nonequivalence of diff + +procedure teqv(id1, id2, diff) + if id1 ~=== id2 then + write("nonequivalent: ", image(id1), " and ", image(id2)) + if id2 ~=== id1 then + write("nonequivalent: ", image(id2), " and ", image(id1)) + if not (id1 === id2) then + write("not equivalent: ", image(id1), " and ", image(id2)) + + if id1 === diff then + write("false equivalence: ", image(id1), " and ", image(diff)) + if id2 === diff then + write("false equivalence: ", image(id2), " and ", image(diff)) + return +end diff --git a/tests/general/extlvals.std b/tests/general/extlvals.std new file mode 100644 index 0000000..0141f3b --- /dev/null +++ b/tests/general/extlvals.std @@ -0,0 +1,40 @@ +v1: external: external_1(0) +v2: external: external_2(0) +v3: external: external_1(0) +v4: external: external_1(0) +s1: xstr: xstr_3(00324:bite) +s2: xstr: xstr_4(31681:the) +s3: xstr: xstr_5(35548:wax) +s4: xstr: xstr_6(46645:tadpole) +r1: xreal: xreal_7(111.1) +r2: xreal: xreal_8(222.2) +r3: xreal: xreal_9(333.3) +r4: xreal: xreal_10(111.1) + +before: external: external_1(0) +before: xstr: xstr_4(31681:the) +before: xreal: xreal_9(333.3) +before: external: external_1(0) +before: xstr: xstr_3(00324:bite) +before: xreal: xreal_8(222.2) +before: complex: record complex_1(2) +before: external: external_1(0) +before: xstr: xstr_6(46645:tadpole) +before: xreal: xreal_7(111.1) +before: external: external_2(0) +before: xstr: xstr_5(35548:wax) +before: xreal: xreal_10(111.1) + +sorted: complex: record complex_1(2) +sorted: external: external_1(0) +sorted: external: external_1(0) +sorted: external: external_1(0) +sorted: external: external_2(0) +sorted: xreal: xreal_7(111.1) +sorted: xreal: xreal_10(111.1) +sorted: xreal: xreal_8(222.2) +sorted: xreal: xreal_9(333.3) +sorted: xstr: xstr_3(00324:bite) +sorted: xstr: xstr_4(31681:the) +sorted: xstr: xstr_5(35548:wax) +sorted: xstr: xstr_6(46645:tadpole) diff --git a/tests/general/features.icn b/tests/general/features.icn new file mode 100644 index 0000000..2eb3f4f --- /dev/null +++ b/tests/general/features.icn @@ -0,0 +1,44 @@ +# Check and report configuration options +# as reported by preprocessor symbols and &features +# +# Compile WITHOUT using -u + +global error + +procedure main() + write("Features found:") + ckfeat(_UNIX, "UNIX") + ckfeat(_MACINTOSH, "Macintosh") + ckfeat(_CYGWIN, "Cygwin") + ckfeat(_MS_WINDOWS, "MS Windows") + ckfeat(_ASCII, "ASCII") + ckfeat(_CO_EXPRESSIONS, "co-expressions") + ckfeat(_DYNAMIC_LOADING, "dynamic loading") + ckfeat(_EXTERNAL_VALUES, "external values") + ckfeat(_KEYBOARD_FUNCTIONS, "keyboard functions") + ckfeat(_LARGE_INTEGERS, "large integers") + ckfeat(_PIPES, "pipes") + ckfeat(_SYSTEM_FUNCTION, "system function") + ckfeat(_GRAPHICS, "graphics") + ckfeat(_X_WINDOW_SYSTEM, "X Windows") + + if \error then exit(1) +end + +procedure ckfeat(ppval, fstring) + if ppval === 1 then + if &features == fstring then + write(" ", fstring) + else + error := write(" ", fstring, " (PREPROCESSOR SYMBOL ONLY)") + else if \ppval then + if &features == fstring then + error := write(" ", fstring, " (WITH BOGUS PREPROCESSOR SYMBOL: ", + image(ppval), ")") + else + error := write(" ", fstring, " (ONLY BOGUS PREPROCESSOR SYMBOL: ", + image(ppval), ")") + else if &features == fstring then + error := write(" ", fstring, " (WITHOUT PREPROCESSOR SYMBOL)") + return +end diff --git a/tests/general/ilib.icn b/tests/general/ilib.icn index eb019a0..bfdc1af 100644 --- a/tests/general/ilib.icn +++ b/tests/general/ilib.icn @@ -1,14 +1,16 @@ # a simple test of many of the core library procedures +# (and a few things outside the core) link core link options +link printf link rational $define LSIZE 16 $define GENLIMIT 25 procedure main() - local L, LR, T, r1, r2, r3, argv, SL + local L, LR, T, r1, r2, r3, argv, SL, vlist, v L := [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5] LR := lreverse(L) @@ -170,6 +172,15 @@ procedure main() every writes(" ", " argv " | !argv | "\n") write() + write("printf:") # printf (not part of core) + vlist := [ + "-1234.5678", -654.3209, -12.34567, -7.0486, -5, -3.9999, + -0.7032, -0.0028, -0.0009, -0.0003, 0.0, 0, 0.003, 0.0058, + 0.1234, 0.5678, &phi, &e, &pi, 718.93, 123456, 4.97e8 ] + every v := !vlist do + printf("%8.3d %06o %5x %8.3e %8.3r %.3r\n", v, v, v, v, v, v) + + write() write("random:") # random gen(rand_num) gen(rand_int, 20) diff --git a/tests/general/ilib.std b/tests/general/ilib.std index 83d82f1..c05ce85 100644 --- a/tests/general/ilib.std +++ b/tests/general/ilib.std @@ -159,6 +159,30 @@ options abc:- i:1 r:1 s:-v options a:bc i:42 r:1 s:1 v:1 argv - 98.6 -b x y +printf: + -1234 37777775456 fffffb2e -1.23e+3 -1234.568 -1234.568 + -654 37777776562 fffffd72 -6.54e+2 -654.321 -654.321 + -12 37777777764 fffffff4 -1.23e+1 -12.346 -12.346 + -7 37777777771 fffffff9 -7.049e0 -7.049 -7.049 + -5 37777777773 fffffffb -5.000e0 -5.000 -5.000 + -3 37777777775 fffffffd -4.000e0 -4.000 -4.000 + 0 000000 0 -7.03e-1 -0.703 -0.703 + 0 000000 0 -2.80e-3 -0.003 -0.003 + 0 000000 0 -9.00e-4 -0.001 -0.001 + 0 000000 0 -3.00e-4 -0.000 -0.000 + 0 000000 0 0.000e0 0.000 0.000 + 0 000000 0 0.000e0 0.000 0.000 + 0 000000 0 3.000e-3 0.003 0.003 + 0 000000 0 5.800e-3 0.006 0.006 + 0 000000 0 1.234e-1 0.123 0.123 + 0 000000 0 5.678e-1 0.568 0.568 + 1 000001 1 1.618e0 1.618 1.618 + 2 000002 2 2.718e0 2.718 2.718 + 3 000003 3 3.142e0 3.142 3.142 + 718 001316 2ce 7.189e+2 718.930 718.930 + 123456 361100 1e240 1.235e+5 123456.000 123456.000 +497000000 3547717100 1d9f9e40 4.970e+8 497000000.000 497000000.000 + random: rand_num 453816694 rand_int 9 diff --git a/tests/general/io.icn b/tests/general/io.icn index fec8522..826ef83 100644 --- a/tests/general/io.icn +++ b/tests/general/io.icn @@ -3,11 +3,10 @@ # I/O test -- writes ./tmp1 and ./tmp2 as well as stdout procedure main() - local L, f, m, n, t1, t2 + local L, f, n, t1, t2 L := [&input, &output, &errout, - m := open("/etc/motd") | stop("no /etc/motd"), - n := open("/dev/null", "w") | stop("no /dev/null")] + n := open("/dev/null", "w") | stop("no /dev/null")] L := sort(L) every f := !L do write(type(f), ": ", image(f)) @@ -21,12 +20,6 @@ procedure main() every write(!&input) \ 2 write() - write("flush /etc/motd: ", image(flush(m)) | "FAILED") - write("close /etc/motd: ", image(close(m)) | "FAILED") - write("close /etc/motd: ", image(close(m)) | "FAILED") - write("flush /etc/motd: ", image(flush(m)) | "FAILED") - - write() write("flush /dev/null: ", image(flush(n)) | "FAILED") write("close /dev/null: ", image(close(n)) | "FAILED") write("close /dev/null: ", image(close(n)) | "FAILED") @@ -103,8 +96,8 @@ procedure wfile(name, mode, s) writes(s) tab(many(' ')) while not pos(0) do { - write(f, tab(upto(' ') | 0)) - tab(many(' ')) + write(f, tab(upto(' ') | 0)) + tab(many(' ')) } write(" : ", where(f)) flush(f) diff --git a/tests/general/io.std b/tests/general/io.std index b512c97..ea70777 100644 --- a/tests/general/io.std +++ b/tests/general/io.std @@ -2,7 +2,6 @@ file: &errout file: &input file: &output file: file(/dev/null) -file: file(/etc/motd) aaa bbbb @@ -13,11 +12,6 @@ ffffffff ggggggggg hhhhhhhhhh -flush /etc/motd: file(/etc/motd) -close /etc/motd: file(/etc/motd) -close /etc/motd: file(/etc/motd) -flush /etc/motd: file(/etc/motd) - flush /dev/null: file(/dev/null) close /dev/null: file(/dev/null) close /dev/null: file(/dev/null) @@ -106,11 +100,11 @@ file(sed 's/^/=()= /' io.icn) > =()= # I/O test -- writes ./tmp1 and ./tmp2 as well as stdout > =()= > =()= procedure main() -> =()= local L, f, m, n, t1, t2 +> =()= local L, f, n, t1, t2 > =()= > =()= L := [&input, &output, &errout, -> =()= m := open("/etc/motd") | stop("no /etc/motd"), -> =()= n := open("/dev/null", "w") | stop("no /dev/null")] +> =()= n := open("/dev/null", "w") | stop("no /dev/null")] +> =()= L := sort(L) file(ls io.i?n io.d?t io.s?d) > io.dat diff --git a/tests/general/kwds.icn b/tests/general/kwds.icn index 3db341f..242a080 100644 --- a/tests/general/kwds.icn +++ b/tests/general/kwds.icn @@ -27,8 +27,9 @@ procedure main() every kw("fail", &fail | "[failed]") every insert(f := set(), &features) - every delete(f, "UNIX" | "MS Windows" | "Cygwin") # platform ID - every delete(f, "dynamic loading" | "graphics" | "X Windows") # may be absent + every delete(f, "UNIX" | "Macintosh" | "MS Windows" | "Cygwin") # platform ID + every delete(f, "dynamic loading" | "external values") # may be absent + every delete(f, "graphics" | "X Windows") # may be absent every kw("features", member(f, &features)) every kw("input", &input | "[failed]") diff --git a/tests/general/prepro.icn b/tests/general/prepro.icn index 0b9972a..262b460 100644 --- a/tests/general/prepro.icn +++ b/tests/general/prepro.icn @@ -64,6 +64,7 @@ procedure main() precheck(_EVENT_MONITOR, "event monitoring") precheck(_EXECUTABLE_IMAGES, "executable images") precheck(_EXTERNAL_FUNCTIONS,"external functions") + precheck(_EXTERNAL_VALUES, "external values") precheck(_KEYBOARD_FUNCTIONS,"keyboard functions") precheck(_LARGE_INTEGERS, "large integers") precheck(_MEMORY_MONITOR, "memory monitoring") diff --git a/tests/general/techo.icn b/tests/general/techo.icn new file mode 100644 index 0000000..aa6fe71 --- /dev/null +++ b/tests/general/techo.icn @@ -0,0 +1,63 @@ +global time, date, save, wombats + +# All variables passed to echo() must be: + +# Simple scalar variables, because echo() does not yet understand +# Icon keywords (such as &clock), arrays, records, or function +# calls. However, such entities may be assigned to simple global +# variables, as the main program below shows; and + +# Global, because echo() cannot accesss their values otherwise. + +# If a variable is undefined or null, echo() outputs nothing. + +link echo + +procedure main() + time := "12:34:56" # fake &clock for reproducible test + date := "2010/02/30" # fake &date for reproducible test + save := 47.23 + wombats := 22 + + # Usage method 1: + + "It is now $time on $date and you have savings of $$$save." ? echo() + "The number of wombats is $wombats." ? echo() + "It is now ${time} on ${date} and you have ${wombats} wombats." ? echo() + "There is no global variable named \"$foo\"." ? echo() + "This does not work: It is now ${&clock}." ? echo() + echo() + "The previous echo() example printed an empty line." ? echo() + echo() + "Here is another way to use echo()..." ? echo() + echo() + + # Usage method 2: + + "It is now $time on $date and you have savings of $$$save." | + "The number of wombats is $wombats." | + "It is now ${time} on ${date} and you have ${wombats} wombats." | + "There is no global variable named \"$foo\"." | + "This does not work: It is now ${&clock}." | + "" | + "The previous input line printed an empty output line." ? echo() + + # The value of &subject defaults to "", so echo() will print out an + # empty line if it is called without a `?'. + + echo() + + # The next test takes advantage of the fact that string + # concatenation has a higher precedence than alternation. It + # prints three lines: + + "Fee, " || + "fi, " || + "fo, " || + "fum, " | # 1st line + "I " || + "smell " || + "the blood " | # 2nd line + "of an Englishman!" ? echo() #3rd line + +end diff --git a/tests/general/techo.std b/tests/general/techo.std new file mode 100644 index 0000000..686830a --- /dev/null +++ b/tests/general/techo.std @@ -0,0 +1,21 @@ +It is now 12:34:56 on 2010/02/30 and you have savings of $47.23. +The number of wombats is 22. +It is now 12:34:56 on 2010/02/30 and you have 22 wombats. +There is no global variable named "". +This does not work: It is now . + +The previous echo() example printed an empty line. + +Here is another way to use echo()... + +It is now 12:34:56 on 2010/02/30 and you have savings of $47.23. +The number of wombats is 22. +It is now 12:34:56 on 2010/02/30 and you have 22 wombats. +There is no global variable named "". +This does not work: It is now . + +The previous input line printed an empty output line. + +Fee, fi, fo, fum, +I smell the blood +of an Englishman! diff --git a/tests/general/tpp.icn b/tests/general/tpp.icn index b2a7e82..c326c3c 100644 --- a/tests/general/tpp.icn +++ b/tests/general/tpp.icn @@ -74,8 +74,8 @@ $include"tpp3.icn"#likewise $line 0 "predef.tst" #== predef test == -should be defined as 1: _UNIX _ASCII _PIPES _SYSTEM_FUNCTION -should not be defined: _MACINTOSH _VMS _EBCDIC _DOS_FUNCTIONS +should be defined as 1: _ASCII _PIPES _SYSTEM_FUNCTION +should not be defined: _VMS _EBCDIC _DOS_FUNCTIONS it depends: _COMPILED _INTERPRETED $undef _PIPES $undef _ASCII diff --git a/tests/general/tpp.ok b/tests/general/tpp.ok index 004f79a..a309f8a 100644 --- a/tests/general/tpp.ok +++ b/tests/general/tpp.ok @@ -161,8 +161,8 @@ $( digraphs for EBCDIC $) #line 0 "predef.tst" #== predef test == -should be defined as 1: 1 1 1 1 -should not be defined: _MACINTOSH _VMS _EBCDIC _DOS_FUNCTIONS +should be defined as 1: 1 1 1 +should not be defined: _VMS _EBCDIC _DOS_FUNCTIONS it depends: _COMPILED _INTERPRETED @@ -560,6 +560,6 @@ c c c c c c c c c c c c c c c c c c c c c c c c c c c pipes:1 ascii:1 ebcdic:_EBCDIC # were redefined in tpp.icn -should be defined as 1: 1 1 1 1 -should not be defined: _MACINTOSH _VMS _EBCDIC _DOS_FUNCTIONS +should be defined as 1: 1 1 1 +should not be defined: _VMS _EBCDIC _DOS_FUNCTIONS it depends: _COMPILED _INTERPRETED diff --git a/tests/general/tpp9.icn b/tests/general/tpp9.icn index ee52472..5cc063f 100644 --- a/tests/general/tpp9.icn +++ b/tests/general/tpp9.icn @@ -3,6 +3,6 @@ pipes:_PIPES ascii:_ASCII ebcdic:_EBCDIC # were redefined in tpp.icn -should be defined as 1: _UNIX _ASCII _PIPES _SYSTEM_FUNCTION -should not be defined: _MACINTOSH _VMS _EBCDIC _DOS_FUNCTIONS +should be defined as 1: _ASCII _PIPES _SYSTEM_FUNCTION +should not be defined: _VMS _EBCDIC _DOS_FUNCTIONS it depends: _COMPILED _INTERPRETED diff --git a/tests/general/tprintf.icn b/tests/general/tprintf.icn new file mode 100644 index 0000000..2ea8eb3 --- /dev/null +++ b/tests/general/tprintf.icn @@ -0,0 +1,22 @@ +# test the library printf procedure +# +# also incidentally tests large integers, real arithmetic, etc. + +link printf + +procedure main() + local v, vlist + + vlist := [ -16r80000000, -16r7FFFFFFF, -16r40000000, -16r3FFFFFFF, + -16r10000, -16RFFFF, -20104, -719, -2, -1, 0, 1, 2, 7, 15, 47, 11213, + 16rFFFF, 16r10000, 16r7FFFFFFF, 16r80000000, 16rFFFFFFFF, 16r100000000, + 0.125, &phi, &e, &pi, "4.56789", 16.0, 1024.0, 65536.0, 5e12, 6.02e23 ] + + every v := !vlist | realseq() | -realseq() do + printf("%16s %15.3r %10.3e %11d %12o %9x\n", v, v, v, v, v, v) +end + +procedure realseq() + suspend 0.0 + suspend 10.0 ^ (-12 to 30) * (1.0 | 13./9 | 3./2 | 5./2. | 14./9 ) +end diff --git a/tests/general/tprintf.std b/tests/general/tprintf.std new file mode 100644 index 0000000..8893450 --- /dev/null +++ b/tests/general/tprintf.std @@ -0,0 +1,465 @@ + -2147483648 -2147483648.000 -2.147e+9 -2147483648 20000000000 80000000 + -2147483647 -2147483647.000 -2.147e+9 -2147483647 20000000001 80000001 + -1073741824 -1073741824.000 -1.074e+9 -1073741824 30000000000 c0000000 + -1073741823 -1073741823.000 -1.074e+9 -1073741823 30000000001 c0000001 + -65536 -65536.000 -6.554e+4 -65536 37777600000 ffff0000 + -65535 -65535.000 -6.554e+4 -65535 37777600001 ffff0001 + -20104 -20104.000 -2.010e+4 -20104 37777730570 ffffb178 + -719 -719.000 -7.190e+2 -719 37777776461 fffffd31 + -2 -2.000 -2.000e0 -2 37777777776 fffffffe + -1 -1.000 -1.000e0 -1 37777777777 ffffffff + 0 0.000 0.000e0 0 0 0 + 1 1.000 1.000e0 1 1 1 + 2 2.000 2.000e0 2 2 2 + 7 7.000 7.000e0 7 7 7 + 15 15.000 1.500e+1 15 17 f + 47 47.000 4.700e+1 47 57 2f + 11213 11213.000 1.121e+4 11213 25715 2bcd + 65535 65535.000 6.554e+4 65535 177777 ffff + 65536 65536.000 6.554e+4 65536 200000 10000 + 2147483647 2147483647.000 2.147e+9 2147483647 17777777777 7fffffff + 2147483648 2147483648.000 2.147e+9 2147483648 20000000000 80000000 + 4294967295 4294967295.000 4.295e+9 4294967295 37777777777 ffffffff + 4294967296 4294967296.000 4.295e+9 4294967296 40000000000 100000000 + 0.125 0.125 1.250e-1 0 0 0 + 1.618033989 1.618 1.618e0 1 1 1 + 2.718281828 2.718 2.718e0 2 2 2 + 3.141592654 3.142 3.142e0 3 3 3 + 4.56789 4.568 4.568e0 4 4 4 + 16.0 16.000 1.600e+1 16 20 10 + 1024.0 1024.000 1.024e+3 1024 2000 400 + 65536.0 65536.000 6.554e+4 65536 200000 10000 + 5e+12 5000000000000.000 5.000e+12 5000000000000 110604716250000 48c27395000 + 6.02e+23 602000000000000014596177.920 6.020e+23 601999999999999995805696 177364761025064660400000000 7f7a7c42a34d84000000 + 0.0 0.000 0.000e0 0 0 0 + 1e-12 0.000 1.000e-12 0 0 0 + 1.444444444e-12 0.000 1.444e-12 0 0 0 + 1.5e-12 0.000 1.500e-12 0 0 0 + 2.5e-12 0.000 2.500e-12 0 0 0 + 1.555555556e-12 0.000 1.556e-12 0 0 0 + 1e-11 0.000 1.000e-11 0 0 0 + 1.444444444e-11 0.000 1.444e-11 0 0 0 + 1.5e-11 0.000 1.500e-11 0 0 0 + 2.5e-11 0.000 2.500e-11 0 0 0 + 1.555555556e-11 0.000 1.556e-11 0 0 0 + 1e-10 0.000 1.000e-10 0 0 0 + 1.444444444e-10 0.000 1.444e-10 0 0 0 + 1.5e-10 0.000 1.500e-10 0 0 0 + 2.5e-10 0.000 2.500e-10 0 0 0 + 1.555555556e-10 0.000 1.556e-10 0 0 0 + 1e-09 0.000 1.000e-9 0 0 0 + 1.444444444e-09 0.000 1.444e-9 0 0 0 + 1.5e-09 0.000 1.500e-9 0 0 0 + 2.5e-09 0.000 2.500e-9 0 0 0 + 1.555555556e-09 0.000 1.556e-9 0 0 0 + 1e-08 0.000 1.000e-8 0 0 0 + 1.444444444e-08 0.000 1.444e-8 0 0 0 + 1.5e-08 0.000 1.500e-8 0 0 0 + 2.5e-08 0.000 2.500e-8 0 0 0 + 1.555555556e-08 0.000 1.556e-8 0 0 0 + 1e-07 0.000 1.000e-7 0 0 0 + 1.444444444e-07 0.000 1.444e-7 0 0 0 + 1.5e-07 0.000 1.500e-7 0 0 0 + 2.5e-07 0.000 2.500e-7 0 0 0 + 1.555555556e-07 0.000 1.556e-7 0 0 0 + 1e-06 0.000 1.000e-6 0 0 0 + 1.444444444e-06 0.000 1.444e-6 0 0 0 + 1.5e-06 0.000 1.500e-6 0 0 0 + 2.5e-06 0.000 2.500e-6 0 0 0 + 1.555555556e-06 0.000 1.556e-6 0 0 0 + 1e-05 0.000 1.000e-5 0 0 0 + 1.444444444e-05 0.000 1.444e-5 0 0 0 + 1.5e-05 0.000 1.500e-5 0 0 0 + 2.5e-05 0.000 2.500e-5 0 0 0 + 1.555555556e-05 0.000 1.556e-5 0 0 0 + 0.0001 0.000 1.000e-4 0 0 0 + 0.0001444444444 0.000 1.444e-4 0 0 0 + 0.00015 0.000 1.500e-4 0 0 0 + 0.00025 0.000 2.500e-4 0 0 0 + 0.0001555555556 0.000 1.556e-4 0 0 0 + 0.001 0.001 1.000e-3 0 0 0 + 0.001444444444 0.001 1.444e-3 0 0 0 + 0.0015 0.002 1.500e-3 0 0 0 + 0.0025 0.003 2.500e-3 0 0 0 + 0.001555555556 0.002 1.556e-3 0 0 0 + 0.01 0.010 1.000e-2 0 0 0 + 0.01444444444 0.014 1.444e-2 0 0 0 + 0.015 0.015 1.500e-2 0 0 0 + 0.025 0.025 2.500e-2 0 0 0 + 0.01555555556 0.016 1.556e-2 0 0 0 + 0.1 0.100 1.000e-1 0 0 0 + 0.1444444444 0.144 1.444e-1 0 0 0 + 0.15 0.150 1.500e-1 0 0 0 + 0.25 0.250 2.500e-1 0 0 0 + 0.1555555556 0.156 1.556e-1 0 0 0 + 1.0 1.000 1.000e0 1 1 1 + 1.444444444 1.444 1.444e0 1 1 1 + 1.5 1.500 1.500e0 1 1 1 + 2.5 2.500 2.500e0 2 2 2 + 1.555555556 1.556 1.556e0 1 1 1 + 10.0 10.000 1.000e+1 10 12 a + 14.44444444 14.444 1.444e+1 14 16 e + 15.0 15.000 1.500e+1 15 17 f + 25.0 25.000 2.500e+1 25 31 19 + 15.55555556 15.556 1.556e+1 15 17 f + 100.0 100.000 1.000e+2 100 144 64 + 144.4444444 144.444 1.444e+2 144 220 90 + 150.0 150.000 1.500e+2 150 226 96 + 250.0 250.000 2.500e+2 250 372 fa + 155.5555556 155.556 1.556e+2 155 233 9b + 1000.0 1000.000 1.000e+3 1000 1750 3e8 + 1444.444444 1444.444 1.444e+3 1444 2644 5a4 + 1500.0 1500.000 1.500e+3 1500 2734 5dc + 2500.0 2500.000 2.500e+3 2500 4704 9c4 + 1555.555556 1555.556 1.556e+3 1555 3023 613 + 10000.0 10000.000 1.000e+4 10000 23420 2710 + 14444.44444 14444.444 1.444e+4 14444 34154 386c + 15000.0 15000.000 1.500e+4 15000 35230 3a98 + 25000.0 25000.000 2.500e+4 25000 60650 61a8 + 15555.55556 15555.556 1.556e+4 15555 36303 3cc3 + 100000.0 100000.000 1.000e+5 100000 303240 186a0 + 144444.4444 144444.444 1.444e+5 144444 432074 2343c + 150000.0 150000.000 1.500e+5 150000 444760 249f0 + 250000.0 250000.000 2.500e+5 250000 750220 3d090 + 155555.5556 155555.556 1.556e+5 155555 457643 25fa3 + 1000000.0 1000000.000 1.000e+6 1000000 3641100 f4240 + 1444444.444 1444444.444 1.444e+6 1444444 5405134 160a5c + 1500000.0 1500000.000 1.500e+6 1500000 5561540 16e360 + 2500000.0 2500000.000 2.500e+6 2500000 11422640 2625a0 + 1555555.556 1555555.556 1.556e+6 1555555 5736143 17bc63 + 10000000.0 10000000.000 1.000e+7 10000000 46113200 989680 + 14444444.44 14444444.444 1.444e+7 14444444 67063634 dc679c + 15000000.0 15000000.000 1.500e+7 15000000 71160700 e4e1c0 + 25000000.0 25000000.000 2.500e+7 25000000 137274100 17d7840 + 15555555.56 15555555.556 1.556e+7 15555555 73255743 ed5be3 + 100000000.0 100000000.000 1.000e+8 100000000 575360400 5f5e100 + 144444444.4 144444444.444 1.444e+8 144444444 1047006034 89c0c1c + 150000000.0 150000000.000 1.500e+8 150000000 1074150600 8f0d180 + 250000000.0 250000000.000 2.500e+8 250000000 1671531200 ee6b280 + 155555555.6 155555555.556 1.556e+8 155555555 1121313343 94596e3 + 1000000000.0 1000000000.000 1.000e+9 1000000000 7346545000 3b9aca00 + 1444444444.0 1444444444.444 1.444e+9 1444444444 12606074434 5618791c + 1500000000.0 1500000000.000 1.500e+9 1500000000 13132027400 59682f00 + 2500000000.0 2500000000.000 2.500e+9 2500000000 22500574400 9502f900 + 1555555556.0 1555555555.556 1.556e+9 1555555555 13455762343 5cb7e4e3 + 1e+10 10000000000.000 1.000e+10 10000000000 112402762000 2540be400 + 1.444444444e+10 14444444444.444 1.444e+10 14444444444 153475135434 35cf4bb1c + 1.5e+10 15000000000.000 1.500e+10 15000000000 157604353000 37e11d600 + 2.5e+10 25000000000.000 2.500e+10 25000000000 272207335000 5d21dba00 + 1.555555556e+10 15555555555.556 1.556e+10 15555555555 163713570343 39f2ef0e3 + 1e+11 100000000000.000 1.000e+11 100000000000 1351035564000 174876e800 + 1.444444444e+11 144444444444.444 1.444e+11 144444444444 2064143647434 21a18f4f1c + 1.5e+11 150000000000.000 1.500e+11 150000000000 2135454456000 22ecb25c00 + 2.5e+11 250000000000.000 2.500e+11 250000000000 3506512242000 3a35294400 + 1.555555556e+11 155555555555.556 1.556e+11 155555555555 2206765264343 2437d568e3 + 1e+12 1000000000000.000 1.000e+12 1000000000000 16432451210000 e8d4a51000 + 1.444444444e+12 1444444444444.444 1.444e+12 1444444444444 25011746213434 1504f99171c + 1.5e+12 1500000000000.000 1.500e+12 1500000000000 25647675714000 15d3ef79800 + 2.5e+12 2500000000000.000 2.500e+12 2500000000000 44302347124000 246139ca800 + 1.555555556e+12 1555555555555.556 1.556e+12 1555555555555 26505625414343 16a2e5618e3 + 1e+13 10000000000000.000 1.000e+13 10000000000000 221411634520000 9184e72a000 + 1.444444444e+13 14444444444444.444 1.444e+13 14444444444444 322143376563434 d231bfae71c + 1.5e+13 15000000000000.000 1.500e+13 15000000000000 332216552770000 da475abf000 + 2.5e+13 25000000000000.000 2.500e+13 25000000000000 553630407510000 16bcc41e9000 + 1.555555556e+13 15555555555555.556 1.556e+13 15555555555555 342271727174343 e25cf5cf8e3 + 1e+14 100000000000000.000 1.000e+14 100000000000000 2657142036440000 5af3107a4000 + 1.444444444e+14 144444444444444.448 1.444e+14 144444444444444 4065742763203434 835f17cd071c + 1.5e+14 150000000000000.000 1.500e+14 150000000000000 4206623055660000 886c98b76000 + 2.5e+14 250000000000000.000 2.500e+14 250000000000000 7065765114320000 e35fa931a000 + 1.555555556e+14 155555555555555.552 1.556e+14 155555555555555 4327503150334343 8d7a19a1b8e3 + 1e+15 1000000000000000.000 1.000e+15 1000000000000000 34327724461500000 38d7ea4c68000 + 1.444444444e+15 1444444444444444.416 1.444e+15 1444444444444444 51033335600443434 521b6ee02471c + 1.5e+15 1500000000000000.000 1.500e+15 1500000000000000 52503676712340000 5543df729c000 + 2.5e+15 2500000000000000.000 2.500e+15 2500000000000000 107033623374040000 8e1bc9bf04000 + 1.555555556e+15 1555555555555555.584 1.556e+15 1555555555555555 54154240024234343 586c5005138e3 + 1e+16 10000000000000000.000 1.000e+16 10000000000000000 434157115760200000 2386f26fc10000 + 1.444444444e+16 14444444444444444.672 1.444e+16 14444444444444444 632422251405543434 3351254c16c71c + 1.5e+16 15000000000000000.000 1.500e+16 15000000000000000 652246564750300000 354a6ba7a18000 + 2.5e+16 25000000000000000.000 2.500e+16 25000000000000000 1306425702730500000 58d15e17628000 + 1.555555556e+16 15555555555555555.328 1.556e+16 15555555555555556 672073100313034344 3743b2032c38e4 + 1e+17 100000000000000000.000 1.000e+17 100000000000000000 5432127413542400000 16345785d8a0000 + 1.444444444e+17 144444444444444442.624 1.444e+17 144444444444444448 10011267237070743440 2012b74f8e3c720 + 1.5e+17 150000000000000000.000 1.500e+17 150000000000000000 10247203221423600000 214e8348c4f0000 + 2.5e+17 250000000000000000.000 2.500e+17 250000000000000000 15701332635166200000 3782dace9d90000 + 1.555555556e+17 155555555555555540.992 1.556e+17 155555555555555552 10505117203756434340 228a4f41fba38e0 + 1e+18 1000000000000000000.000 1.000e+18 1000000000000000000 67405553164731000000 de0b6b3a7640000 + 1.444444444e+18 1444444444444444327.936 1.444e+18 1444444444444444416 120135451067071343400 140bb291b8e5c700 + 1.5e+18 1500000000000000000.000 1.500e+18 1500000000000000000 123210440657305400000 14d1120d7b160000 + 2.5e+18 2500000000000000000.000 2.500e+18 2500000000000000000 212616214044236400000 22b1c8c1227a0000 + 1.555555556e+18 1555555555555555672.064 1.556e+18 1555555555555555584 126263430447521434400 159671893d463900 + 1e+19 10000000000000000000.000 1.000e+19 10000000000000000000 1053071060221172000000 8ac7230489e80000 + 1.444444444e+19 14444444444444445376.512 1.444e+19 14444444444444444672 1441647633047076344000 c874f9b138f9c800 + 1.5e+19 15000000000000000000.000 1.500e+19 15000000000000000000 1500525510331667000000 d02ab486cedc0000 + 2.5e+19 24999999999999997902.848 2.500e+19 25000000000000000000 2553616570553061000000 15af1d78b58c40000 + 1.555555556e+19 15555555555555554623.488 1.556e+19 15555555555555555328 1537403365614457434000 d7e06f5c64be3800 + 1e+20 99999999999999991611.392 1.000e+20 100000000000000000000 12657072742654304000000 56bc75e2d63100000 + 1.444444444e+20 144444444444444445376.512 1.444e+20 144444444444444442624 17522216016607160340000 7d491c0ec39c1c000 + 1.5e+20 150000000000000004194.304 1.500e+20 150000000000000000000 20206530324202446000000 821ab0d4414980000 + 2.5e+20 249999999999999995805.696 2.500e+20 250000000000000000000 33065623267056752000000 d8d726b7177a80000 + 1.555555556e+20 155555555555555579789.312 1.556e+20 155555555555555573760 20673042631575733500000 86ec4599bef6e8000 + 1e+21 999999999999999983222.784 1.000e+21 1000000000000000000000 154327115334273650000000 3635c9adc5dea00000 + 1.444444444e+21 1444444444444444420210.688 1.444e+21 1444444444444444327936 234466614223510144000000 4e4db1893a41900000 + 1.5e+21 1499999999999999974834.176 1.500e+21 1500000000000000000000 242502564112431574000000 5150ae84a8cdf00000 + 2.5e+21 2500000000000000226492.416 2.500e+21 2500000000000000000000 417031701446725444000000 878678326eac900000 + 1.555555556e+21 1555555555555555797893.120 1.556e+21 1555555555555555672064 250516534001353224000000 5453ab80175a500000 + 1e+22 10000000000000000905969.664 1.000e+22 10000000000000000000000 2074147406233526220000000 21e19e0c9bab2400000 + 1.444444444e+22 14444444444444443128365.056 1.444e+22 14444444444444443279360 3036043572704321750000000 30f08ef5c468fa00000 + 1.5e+22 15000000000000000285212.672 1.500e+22 15000000000000000000000 3132233211351401330000000 32d26d12e980b600000 + 2.5e+22 24999999999999996896215.040 2.500e+22 24999999999999997902848 5226402617605127540000000 54b40b1f852bd800000 + 1.555555556e+22 15555555555555557442060.288 1.556e+22 15555555555555556720640 3226422630016460710000000 34b44b300e987200000 + 1e+23 99999999999999987584860.160 1.000e+23 99999999999999991611392 25132013077024536600000000 152d02c7e14af6000000 + 1.444444444e+23 144444444444444422693715.968 1.444e+23 144444444444444428599296 36454545314654063400000000 1e9659599ac19c000000 + 1.5e+23 149999999999999981377290.240 1.500e+23 149999999999999987417088 37607020536437016100000000 1fc3842bd1f071000000 + 2.5e+23 250000000000000003321888.768 2.500e+23 249999999999999995805696 64741033635463555000000000 34f086f3b33b68000000 + 1.555555556e+23 155555555555555540060864.512 1.556e+23 155555555555555546234880 40741273760221750600000000 20f0aefe091f46000000 + 1e+24 1000000000000000013287555.072 1.000e+24 999999999999999983222784 323604157166316664000000000 d3c21bcecceda0000000 + 1.444444444e+24 1444444444444444433095589.888 1.444e+24 1444444444444444420210688 461676766000271004000000000 131df7d800b9020000000 + 1.5e+24 1499999999999999882492379.136 1.500e+24 1499999999999999974834176 475506246661466216000000000 13da329b6336470000000 + 2.5e+24 2499999999999999895779934.208 2.500e+24 2499999999999999689621504 1021312426050005100000000000 211654585005200000000 + 1.555555556e+24 1555555555555555606767075.328 1.556e+24 1555555555555555529457664 511315527542663430000000000 14966d5ec5b38c0000000 + 1e+25 10000000000000001782142992.384 1.000e+25 10000000000000000905969664 4105452130240024420000000000 845951614014880000000 + 1.444444444e+25 14444444444444444330955898.880 1.444e+25 14444444444444445275848704 5762565634003472060000000000 bf2bae70073a180000000 + 1.5e+25 15000000000000002673214488.576 1.500e+25 15000000000000002432696320 6150277204360036640000000000 c685fa11e01ed00000000 + 2.5e+25 25000000000000002256334225.408 2.500e+25 25000000000000001191182336 12255751334620063240000000000 14adf4b732033500000000 + 1.555555556e+25 15555555555555556617426567.168 1.556e+25 15555555555555557442060288 6336010554734403400000000000 cde045b3b903800000000 + 1e+26 100000000000000009025336901.632 1.000e+26 100000000000000004764729344 51267645563100315200000000000 52b7d2dcc80cd400000000 + 1.444444444e+26 144444444444444465299791544.320 1.444e+26 144444444444444457053454336 73573232030044105000000000000 777b4d0604845000000000 + 1.5e+26 150000000000000013538005352.448 1.500e+26 150000000000000015737028608 76023570454540464000000000000 7c13bc4b2c134000000000 + 2.5e+26 250000000000000004971156209.664 2.500e+26 250000000000000003321888768 147313436237641001000000000000 cecb8f27f4201000000000 + 1.555555556e+26 155555555555555579368405204.992 1.556e+26 155555555555555574420602880 100254127101235043000000000000 80ac2b9053a23000000000 + 1e+27 1000000000000000019884624838.656 1.000e+27 1000000000000000013287555072 635456171177204004000000000000 33b2e3c9fd0804000000000 + 1.444444444e+27 1444444444444444441891682910.208 1.444e+27 1444444444444444433095589888 1125321004360551260000000000000 4aad1023c2d2b0000000000 + 1.5e+27 1500000000000000170564425613.312 1.500e+27 1500000000000000157370286080 1154305265676706010000000000000 4d8c55aefb8c08000000000 + 2.5e+27 2499999999999999908974073741.312 2.500e+27 2499999999999999895779934208 2011763457076112010000000000000 813f3978f89408000000000 + 1.555555556e+27 1555555555555555617762191605.760 1.556e+27 1555555555555555606767075328 1203271547215042534000000000000 506b9b3a34455c000000000 + 1e+28 9999999999999999635896294965.248 1.000e+28 9999999999999999583119736832 10047716274370450040000000000000 204fce5e3e25020000000000 + 1.444444444e+28 14444444444444444418916829102.080 1.444e+28 14444444444444444330955898880 13526052054547035340000000000000 2eac2a1659c3ae0000000000 + 1.5e+28 14999999999999999453844442447.872 1.500e+28 15000000000000000474191233024 14073665432564674100000000000000 3077b58d5d37840000000000 + 2.5e+28 24999999999999996837940923727.872 2.500e+28 24999999999999997858287714304 24143603727155344100000000000000 50c783eb9b5c840000000000 + 1.555555556e+28 15555555555555554488772055793.664 1.556e+28 15555555555555554418403311616 14441501010602532600000000000000 3243410460ab580000000000 + 1e+29 99999999999999987351763694911.488 1.000e+29 99999999999999991433150857216 120617017534665620400000000000000 1431e0fae6d72100000000000 + 1.444444444e+29 144444444444444426174769781538.816 1.444e+29 144444444444444430115419455488 164534644677006446000000000000000 1d2b9a4df81a4c00000000000 + 1.5e+29 149999999999999999042044051849.216 1.500e+29 149999999999999995945819308032 171126427413220531000000000000000 1e4ad1785a42b200000000000 + 2.5e+29 249999999999999986393807746760.704 2.500e+29 249999999999999969786784120832 311745447150106351000000000000000 327cb2734119d200000000000 + 1.555555556e+29 155555555555555535880521303195.648 1.556e+29 155555555555555544184033116160 175520212127432613400000000000000 1f6a08a2bc6b1700000000000 + 1e+30 1000000000000000089690419062898.688 1.000e+30 1000000000000000019884624838656 1447626234640431650000000000000000 c9f2c9cd04675000000000000 + 1.444444444e+30 1444444444444444333805291853316.096 1.444e+30 1444444444444444441891682910208 2216640160566101600000000000000000 123b4070bb1070000000000000 + 1.5e+30 1500000000000000206593222632275.968 1.500e+30 1500000000000000170564425613312 2273541353160646600000000000000000 12eec2eb3869b0000000000000 + 2.5e+30 2499999999999999863938077467607.040 2.500e+30 2499999999999999908974073741312 3743367610021300440000000000000000 1f8def8808b024000000000000 + 1.555555556e+30 1555555555555555502920401107812.352 1.556e+30 1555555555555555617762191605760 2350442545553413570000000000000000 13a24565b5c2ef000000000000 + 0.0 0.000 0.000e0 0 0 0 + -1e-12 -0.000 -1.000e-12 0 0 0 +-1.444444444e-12 -0.000 -1.444e-12 0 0 0 + -1.5e-12 -0.000 -1.500e-12 0 0 0 + -2.5e-12 -0.000 -2.500e-12 0 0 0 +-1.555555556e-12 -0.000 -1.556e-12 0 0 0 + -1e-11 -0.000 -1.000e-11 0 0 0 +-1.444444444e-11 -0.000 -1.444e-11 0 0 0 + -1.5e-11 -0.000 -1.500e-11 0 0 0 + -2.5e-11 -0.000 -2.500e-11 0 0 0 +-1.555555556e-11 -0.000 -1.556e-11 0 0 0 + -1e-10 -0.000 -1.000e-10 0 0 0 +-1.444444444e-10 -0.000 -1.444e-10 0 0 0 + -1.5e-10 -0.000 -1.500e-10 0 0 0 + -2.5e-10 -0.000 -2.500e-10 0 0 0 +-1.555555556e-10 -0.000 -1.556e-10 0 0 0 + -1e-09 -0.000 -1.000e-9 0 0 0 +-1.444444444e-09 -0.000 -1.444e-9 0 0 0 + -1.5e-09 -0.000 -1.500e-9 0 0 0 + -2.5e-09 -0.000 -2.500e-9 0 0 0 +-1.555555556e-09 -0.000 -1.556e-9 0 0 0 + -1e-08 -0.000 -1.000e-8 0 0 0 +-1.444444444e-08 -0.000 -1.444e-8 0 0 0 + -1.5e-08 -0.000 -1.500e-8 0 0 0 + -2.5e-08 -0.000 -2.500e-8 0 0 0 +-1.555555556e-08 -0.000 -1.556e-8 0 0 0 + -1e-07 -0.000 -1.000e-7 0 0 0 +-1.444444444e-07 -0.000 -1.444e-7 0 0 0 + -1.5e-07 -0.000 -1.500e-7 0 0 0 + -2.5e-07 -0.000 -2.500e-7 0 0 0 +-1.555555556e-07 -0.000 -1.556e-7 0 0 0 + -1e-06 -0.000 -1.000e-6 0 0 0 +-1.444444444e-06 -0.000 -1.444e-6 0 0 0 + -1.5e-06 -0.000 -1.500e-6 0 0 0 + -2.5e-06 -0.000 -2.500e-6 0 0 0 +-1.555555556e-06 -0.000 -1.556e-6 0 0 0 + -1e-05 -0.000 -1.000e-5 0 0 0 +-1.444444444e-05 -0.000 -1.444e-5 0 0 0 + -1.5e-05 -0.000 -1.500e-5 0 0 0 + -2.5e-05 -0.000 -2.500e-5 0 0 0 +-1.555555556e-05 -0.000 -1.556e-5 0 0 0 + -0.0001 -0.000 -1.000e-4 0 0 0 +-0.0001444444444 -0.000 -1.444e-4 0 0 0 + -0.00015 -0.000 -1.500e-4 0 0 0 + -0.00025 -0.000 -2.500e-4 0 0 0 +-0.0001555555556 -0.000 -1.556e-4 0 0 0 + -0.001 -0.001 -1.000e-3 0 0 0 + -0.001444444444 -0.001 -1.444e-3 0 0 0 + -0.0015 -0.002 -1.500e-3 0 0 0 + -0.0025 -0.003 -2.500e-3 0 0 0 + -0.001555555556 -0.002 -1.556e-3 0 0 0 + -0.01 -0.010 -1.000e-2 0 0 0 + -0.01444444444 -0.014 -1.444e-2 0 0 0 + -0.015 -0.015 -1.500e-2 0 0 0 + -0.025 -0.025 -2.500e-2 0 0 0 + -0.01555555556 -0.016 -1.556e-2 0 0 0 + -0.1 -0.100 -1.000e-1 0 0 0 + -0.1444444444 -0.144 -1.444e-1 0 0 0 + -0.15 -0.150 -1.500e-1 0 0 0 + -0.25 -0.250 -2.500e-1 0 0 0 + -0.1555555556 -0.156 -1.556e-1 0 0 0 + -1.0 -1.000 -1.000e0 -1 37777777777 ffffffff + -1.444444444 -1.444 -1.444e0 -1 37777777777 ffffffff + -1.5 -1.500 -1.500e0 -1 37777777777 ffffffff + -2.5 -2.500 -2.500e0 -2 37777777776 fffffffe + -1.555555556 -1.556 -1.556e0 -1 37777777777 ffffffff + -10.0 -10.000 -1.000e+1 -10 37777777766 fffffff6 + -14.44444444 -14.444 -1.444e+1 -14 37777777762 fffffff2 + -15.0 -15.000 -1.500e+1 -15 37777777761 fffffff1 + -25.0 -25.000 -2.500e+1 -25 37777777747 ffffffe7 + -15.55555556 -15.556 -1.556e+1 -15 37777777761 fffffff1 + -100.0 -100.000 -1.000e+2 -100 37777777634 ffffff9c + -144.4444444 -144.444 -1.444e+2 -144 37777777560 ffffff70 + -150.0 -150.000 -1.500e+2 -150 37777777552 ffffff6a + -250.0 -250.000 -2.500e+2 -250 37777777406 ffffff06 + -155.5555556 -155.556 -1.556e+2 -155 37777777545 ffffff65 + -1000.0 -1000.000 -1.000e+3 -1000 37777776030 fffffc18 + -1444.444444 -1444.444 -1.444e+3 -1444 37777775134 fffffa5c + -1500.0 -1500.000 -1.500e+3 -1500 37777775044 fffffa24 + -2500.0 -2500.000 -2.500e+3 -2500 37777773074 fffff63c + -1555.555556 -1555.556 -1.556e+3 -1555 37777774755 fffff9ed + -10000.0 -10000.000 -1.000e+4 -10000 37777754360 ffffd8f0 + -14444.44444 -14444.444 -1.444e+4 -14444 37777743624 ffffc794 + -15000.0 -15000.000 -1.500e+4 -15000 37777742550 ffffc568 + -25000.0 -25000.000 -2.500e+4 -25000 37777717130 ffff9e58 + -15555.55556 -15555.556 -1.556e+4 -15555 37777741475 ffffc33d + -100000.0 -100000.000 -1.000e+5 -100000 37777474540 fffe7960 + -144444.4444 -144444.444 -1.444e+5 -144444 37777345704 fffdcbc4 + -150000.0 -150000.000 -1.500e+5 -150000 37777333020 fffdb610 + -250000.0 -250000.000 -2.500e+5 -250000 37777027560 fffc2f70 + -155555.5556 -155555.556 -1.556e+5 -155555 37777320135 fffda05d + -1000000.0 -1000000.000 -1.000e+6 -1000000 37774136700 fff0bdc0 + -1444444.444 -1444444.444 -1.444e+6 -1444444 37772372644 ffe9f5a4 + -1500000.0 -1500000.000 -1.500e+6 -1500000 37772216240 ffe91ca0 + -2500000.0 -2500000.000 -2.500e+6 -2500000 37766355140 ffd9da60 + -1555555.556 -1555555.556 -1.556e+6 -1555555 37772041635 ffe8439d + -10000000.0 -10000000.000 -1.000e+7 -10000000 37731664600 ff676980 + -14444444.44 -14444444.444 -1.444e+7 -14444444 37710714144 ff239864 + -15000000.0 -15000000.000 -1.500e+7 -15000000 37706617100 ff1b1e40 + -25000000.0 -25000000.000 -2.500e+7 -25000000 37640503700 fe8287c0 + -15555555.56 -15555555.556 -1.556e+7 -15555555 37704522035 ff12a41d + -100000000.0 -100000000.000 -1.000e+8 -100000000 37202417400 fa0a1f00 + -144444444.4 -144444444.444 -1.444e+8 -144444444 36730771744 f763f3e4 + -150000000.0 -150000000.000 -1.500e+8 -150000000 36703627200 f70f2e80 + -250000000.0 -250000000.000 -2.500e+8 -250000000 36106246600 f1194d80 + -155555555.6 -155555555.556 -1.556e+8 -155555555 36656464435 f6ba691d + -1000000000.0 -1000000000.000 -1.000e+9 -1000000000 30431233000 c4653600 + -1444444444.0 -1444444444.444 -1.444e+9 -1444444444 25171703344 a9e786e4 + -1500000000.0 -1500000000.000 -1.500e+9 -1500000000 24645750400 a697d100 + -2500000000.0 -2500000000.000 -2.500e+9 -2500000000 55277203400 6afd0700 + -1555555556.0 -1555555555.556 -1.556e+9 -1555555555 24322015435 a3481b1d + -1e+10 -10000000000.000 -1.000e+10 -10000000000 665375016000 dabf41c00 +-1.444444444e+10 -14444444444.444 -1.444e+10 -14444444444 624302642344 ca30b44e4 + -1.5e+10 -15000000000.000 -1.500e+10 -15000000000 620173425000 c81ee2a00 + -2.5e+10 -25000000000.000 -2.500e+10 -25000000000 505570443000 a2de24600 +-1.555555556e+10 -15555555555.556 -1.556e+10 -15555555555 614064207435 c60d10f1d + -1e+11 -100000000000.000 -1.000e+11 -100000000000 6426742214000 e8b7891800 +-1.444444444e+11 -144444444444.444 -1.444e+11 -144444444444 5713634130344 de5e70b0e4 + -1.5e+11 -150000000000.000 -1.500e+11 -150000000000 5642323322000 dd134da400 + -2.5e+11 -250000000000.000 -2.500e+11 -250000000000 4271265536000 c5cad6bc00 +-1.555555556e+11 -155555555555.556 -1.556e+11 -155555555555 5571012513435 dbc82a971d + -1e+12 -1000000000000.000 -1.000e+12 -1000000000000 61345326570000 172b5af000 +-1.444444444e+12 -1444444444444.444 -1.444e+12 -1444444444444 52766031564344 eafb066e8e4 + -1.5e+12 -1500000000000.000 -1.500e+12 -1500000000000 52130102064000 ea2c1086800 + -2.5e+12 -2500000000000.000 -2.500e+12 -2500000000000 33475430654000 db9ec635800 +-1.555555556e+12 -1555555555555.556 -1.556e+12 -1555555555555 51272152363435 e95d1a9e71d + -1e+13 -10000000000000.000 -1.000e+13 -10000000000000 556366143260000 6e7b18d6000 +-1.444444444e+13 -14444444444444.444 -1.444e+13 -14444444444444 455634401214344 2dce40518e4 + -1.5e+13 -15000000000000.000 -1.500e+13 -15000000000000 445561225010000 25b8a541000 + -2.5e+13 -25000000000000.000 -2.500e+13 -25000000000000 224147370270000 e9433be17000 +-1.555555556e+13 -15555555555555.556 -1.556e+13 -15555555555555 435506050603435 1da30a3071d + -1e+14 -100000000000000.000 -1.000e+14 -100000000000000 5120635741340000 a50cef85c000 +-1.444444444e+14 -144444444444444.448 -1.444e+14 -144444444444444 3712035014574344 7ca0e832f8e4 + -1.5e+14 -150000000000000.000 -1.500e+14 -150000000000000 3571154722120000 77936748a000 + -2.5e+14 -250000000000000.000 -2.500e+14 -250000000000000 0712012663460000 1ca056ce6000 +-1.555555556e+14 -155555555555555.552 -1.556e+14 -155555555555555 3450274627443435 7285e65e471d + -1e+15 -1000000000000000.000 -1.000e+15 -1000000000000000 43450053316300000 c72815b398000 +-1.444444444e+15 -1444444444444444.416 -1.444e+15 -1444444444444444 26744442177334344 ade4911fdb8e4 + -1.5e+15 -1500000000000000.000 -1.500e+15 -1500000000000000 25274101065440000 aabc208d64000 + -2.5e+15 -2500000000000000.000 -2.500e+15 -2500000000000000 670744154403740000 71e43640fc000 +-1.555555556e+15 -1555555555555555.584 -1.556e+15 -1555555555555555 23623537753543435 a793affaec71d + -1e+16 -10000000000000000.000 -1.000e+16 -10000000000000000 343620662017600000 dc790d903f0000 +-1.444444444e+16 -14444444444444444.672 -1.444e+16 -14444444444444444 145355526372234344 ccaedab3e938e4 + -1.5e+16 -15000000000000000.000 -1.500e+16 -15000000000000000 125531213027500000 cab594585e8000 + -2.5e+16 -25000000000000000.000 -2.500e+16 -25000000000000000 6471352075047300000 a72ea1e89d8000 +-1.555555556e+16 -15555555555555555.328 -1.556e+16 -15555555555555556 105704677464743434 c8bc4dfcd3c71c + -1e+17 -100000000000000000.000 -1.000e+17 -100000000000000000 2345650364235400000 e9cba87a2760000 +-1.444444444e+17 -144444444444444442.624 -1.444e+17 -144444444444444448 67766510540707034340 dfed48b071c38e0 + -1.5e+17 -150000000000000000.000 -1.500e+17 -150000000000000000 67530574556354200000 deb17cb73b10000 + -2.5e+17 -250000000000000000.000 -2.500e+17 -250000000000000000 62076445142611600000 c87d25316270000 +-1.555555556e+17 -155555555555555540.992 -1.556e+17 -155555555555555552 67272660574021343440 dd75b0be045c720 + -1e+18 -1000000000000000000.000 -1.000e+18 -1000000000000000000 10372224613047000000 21f494c589c0000 +-1.444444444e+18 -1444444444444444327.936 -1.444e+18 -1444444444444444416 657642326710706434400 ebf44d6e471a3900 + -1.5e+18 -1500000000000000000.000 -1.500e+18 -1500000000000000000 654567337120472400000 eb2eedf284ea0000 + -2.5e+18 -2500000000000000000.000 -2.500e+18 -2500000000000000000 565161563733541400000 dd4e373edd860000 +-1.555555556e+18 -1555555555555555672.064 -1.556e+18 -1555555555555555584 651514347330256343400 ea698e76c2b9c700 + -1e+19 -10000000000000000000.000 -1.000e+19 -10000000000000000000 6724706717556606000000 7538dcfb76180000 +-1.444444444e+19 -14444444444444445376.512 -1.444e+19 -14444444444444444672 6336130144730701434000 378b064ec7063800 + -1.5e+19 -15000000000000000000.000 -1.500e+19 -15000000000000000000 6277252267446111000000 2fd54b7931240000 + -2.5e+19 -24999999999999997902.848 -2.500e+19 -25000000000000000000 5224161207224717000000 ea50e2874a73c0000 +-1.555555556e+19 -15555555555555554623.488 -1.556e+19 -15555555555555555328 6240374412163320344000 281f90a39b41c800 + -1e+20 -99999999999999991611.392 -1.000e+20 -100000000000000000000 65120705035123474000000 a9438a1d29cf00000 +-1.444444444e+20 -144444444444444445376.512 -1.444e+20 -144444444444444442624 60255561761170617440000 82b6e3f13c63e4000 + -1.5e+20 -150000000000000004194.304 -1.500e+20 -150000000000000000000 57571247453575332000000 7de54f2bbeb680000 + -2.5e+20 -249999999999999995805.696 -2.500e+20 -250000000000000000000 44712154510721026000000 2728d948e88580000 +-1.555555556e+20 -155555555555555579789.312 -1.556e+20 -155555555555555573760 57104735146202044300000 7913ba66410918000 + -1e+21 -999999999999999983222.784 -1.000e+21 -1000000000000000000000 623450662443504130000000 c9ca36523a21600000 +-1.444444444e+21 -1444444444444444420210.688 -1.444e+21 -1444444444444444327936 543311163554267634000000 b1b24e76c5be700000 + -1.5e+21 -1499999999999999974834.176 -1.500e+21 -1500000000000000000000 535275213665346204000000 aeaf517b5732100000 + -2.5e+21 -2500000000000000226492.416 -2.500e+21 -2500000000000000000000 360746076331052334000000 787987cd9153700000 +-1.555555556e+21 -1555555555555555797893.120 -1.556e+21 -1555555555555555672064 527261243776424554000000 abac547fe8a5b00000 + -1e+22 -10000000000000000905969.664 -1.000e+22 -10000000000000000000000 5703630371544251560000000 de1e61f36454dc00000 +-1.444444444e+22 -14444444444444443128365.056 -1.444e+22 -14444444444444443279360 4741734205073456030000000 cf0f710a3b970600000 + -1.5e+22 -15000000000000000285212.672 -1.500e+22 -15000000000000000000000 4645544566426376450000000 cd2d92ed167f4a00000 + -2.5e+22 -24999999999999996896215.040 -2.500e+22 -24999999999999997902848 2551375160172650240000000 ab4bf4e07ad42800000 +-1.555555556e+22 -15555555555555557442060.288 -1.556e+22 -15555555555555556720640 4551355147761317070000000 cb4bb4cff1678e00000 + -1e+23 -99999999999999987584860.160 -1.000e+23 -99999999999999991611392 52645764700753241200000000 ead2fd381eb50a000000 +-1.444444444e+23 -144444444444444422693715.968 -1.444e+23 -144444444444444428599296 41323232463123714400000000 e169a6a6653e64000000 + -1.5e+23 -149999999999999981377290.240 -1.500e+23 -149999999999999987417088 40170757241340761700000000 e03c7bd42e0f8f000000 + -2.5e+23 -250000000000000003321888.768 -2.500e+23 -249999999999999995805696 13036744142314223000000000 cb0f790c4cc498000000 +-1.555555556e+23 -155555555555555540060864.512 -1.556e+23 -155555555555555546234880 37036504017556027200000000 df0f5101f6e0ba000000 + -1e+24 -1000000000000000013287555.072 -1.000e+24 -999999999999999983222784 454173620611461114000000000 2c3de431331260000000 +-1.444444444e+24 -1444444444444444433095589.888 -1.444e+24 -1444444444444444420210688 316101011777506774000000000 ece20827ff46fe0000000 + -1.5e+24 -1499999999999999882492379.136 -1.500e+24 -1499999999999999974834176 302271531116311562000000000 ec25cd649cc9b90000000 + -2.5e+24 -2499999999999999895779934.208 -2.500e+24 -2499999999999999689621504 6756465351727772700000000000 dee9aba7affae00000000 +-1.555555556e+24 -1555555555555555606767075.328 -1.556e+24 -1555555555555555529457664 266462250235114350000000000 eb6992a13a4c740000000 + -1e+25 -10000000000000001782142992.384 -1.000e+25 -10000000000000000905969664 3672325647537753360000000000 7ba6ae9ebfeb780000000 +-1.444444444e+25 -14444444444444444330955898.880 -1.444e+25 -14444444444444445275848704 2015212143774305720000000000 40d4518ff8c5e80000000 + -1.5e+25 -15000000000000002673214488.576 -1.500e+25 -15000000000000002432696320 1627500573417741140000000000 397a05ee1fe1300000000 + -2.5e+25 -25000000000000002256334225.408 -2.500e+25 -25000000000000001191182336 65522026443157714540000000000 eb520b48cdfccb00000000 +-1.555555556e+25 -15555555555555556617426567.168 -1.556e+25 -15555555555555557442060288 1441767223043374400000000000 321fba4c46fc800000000 + -1e+26 -100000000000000009025336901.632 -1.000e+26 -100000000000000004764729344 26510132214677462600000000000 ad482d2337f32c00000000 +-1.444444444e+26 -144444444444444465299791544.320 -1.444e+26 -144444444444444457053454336 04204545747733673000000000000 8884b2f9fb7bb000000000 + -1.5e+26 -150000000000000013538005352.448 -1.500e+26 -150000000000000015737028608 01754207323237314000000000000 83ec43b4d3ecc000000000 + -2.5e+26 -250000000000000004971156209.664 -2.500e+26 -250000000000000003321888768 630464341540136777000000000000 313470d80bdff000000000 +-1.555555556e+26 -155555555555555579368405204.992 -1.556e+26 -155555555555555574420602880 677523650676542735000000000000 7f53d46fac5dd000000000 + -1e+27 -1000000000000000019884624838.656 -1.000e+27 -1000000000000000013287555072 142321606600573774000000000000 cc4d1c3602f7fc000000000 +-1.444444444e+27 -1444444444444444441891682910.208 -1.444e+27 -1444444444444444433095589888 6652456773417226520000000000000 b552efdc3d2d50000000000 + -1.5e+27 -1500000000000000170564425613.312 -1.500e+27 -1500000000000000157370286080 6623472512101071770000000000000 b273aa510473f8000000000 + -2.5e+27 -2499999999999999908974073741.312 -2.500e+27 -2499999999999999895779934208 5766014320701665770000000000000 7ec0c687076bf8000000000 +-1.555555556e+27 -1555555555555555617762191605.760 -1.556e+27 -1555555555555555606767075328 6574506230562735244000000000000 af9464c5cbbaa4000000000 + -1e+28 -9999999999999999635896294965.248 -1.000e+28 -9999999999999999583119736832 67730061503407327740000000000000 dfb031a1c1dafe0000000000 +-1.444444444e+28 -14444444444444444418916829102.080 -1.444e+28 -14444444444444444330955898880 64251725723230742440000000000000 d153d5e9a63c520000000000 + -1.5e+28 -14999999999999999453844442447.872 -1.500e+28 -15000000000000000474191233024 63704112345213103700000000000000 cf884a72a2c87c0000000000 + -2.5e+28 -24999999999999996837940923727.872 -2.500e+28 -24999999999999997858287714304 53634174050622433700000000000000 af387c1464a37c0000000000 +-1.555555556e+28 -15555555555555554488772055793.664 -1.556e+28 -15555555555555554418403311616 63336276767175245200000000000000 cdbcbefb9f54a80000000000 + -1e+29 -99999999999999987351763694911.488 -1.000e+29 -99999999999999991433150857216 657160760243112157400000000000000 ebce1f051928df00000000000 +-1.444444444e+29 -144444444444444426174769781538.816 -1.444e+29 -144444444444444430115419455488 613243133100771332000000000000000 e2d465b207e5b400000000000 + -1.5e+29 -149999999999999999042044051849.216 -1.500e+29 -149999999999999995945819308032 606651350364557247000000000000000 e1b52e87a5bd4e00000000000 + -2.5e+29 -249999999999999986393807746760.704 -2.500e+29 -249999999999999969786784120832 466032330627671427000000000000000 cd834d8cbee62e00000000000 +-1.555555556e+29 -155555555555555535880521303195.648 -1.556e+29 -155555555555555544184033116160 602257565650345164400000000000000 e095f75d4394e900000000000 + -1e+30 -1000000000000000089690419062898.688 -1.000e+30 -1000000000000000019884624838656 6330151543137346130000000000000000 360d3632fb98b000000000000 +-1.444444444e+30 -1444444444444444333805291853316.096 -1.444e+30 -1444444444444444441891682910208 5561137617211676200000000000000000 edc4bf8f44ef90000000000000 + -1.5e+30 -1500000000000000206593222632275.968 -1.500e+30 -1500000000000000170564425613312 5504236424617131200000000000000000 ed113d14c79650000000000000 + -2.5e+30 -2499999999999999863938077467607.040 -2.500e+30 -2499999999999999908974073741312 4034410167756477340000000000000000 e0721077f74fdc000000000000 +-1.555555556e+30 -1555555555555555502920401107812.352 -1.556e+30 -1555555555555555617762191605760 5427335232224364210000000000000000 ec5dba9a4a3d11000000000000 |