1 |
|
2 |
|
3 |
|
4 | ok_tests = 0
|
5 | ko_tests = 0
|
6 |
|
7 | selftest = ->
|
8 |
|
9 | test_low_level()
|
10 |
|
11 | test_multiply()
|
12 | test_scan()
|
13 | test_power()
|
14 | test_factor_number();
|
15 | test_test()
|
16 | test_tensor()
|
17 | test_bake()
|
18 | test_abs()
|
19 | test_adj()
|
20 | test_arg()
|
21 | test_besselj()
|
22 | test_bessely()
|
23 | test_ceiling()
|
24 | test_choose()
|
25 | test_circexp()
|
26 | test_clock()
|
27 | test_cofactor()
|
28 | test_condense()
|
29 | test_contract()
|
30 | test_defint();
|
31 | test_denominator()
|
32 | test_derivative()
|
33 | test_dirac()
|
34 | test_erf()
|
35 | test_erfc()
|
36 | test_expand()
|
37 | test_expcos()
|
38 | test_expsin()
|
39 | test_factorpoly()
|
40 | test_float()
|
41 | test_floor()
|
42 | test_gamma()
|
43 | test_gcd()
|
44 | test_imag()
|
45 | test_inner()
|
46 | test_lcm()
|
47 | test_log()
|
48 | test_mag()
|
49 | test_mod()
|
50 | test_nroots()
|
51 | test_numerator()
|
52 | test_outer()
|
53 | test_polar()
|
54 | test_quotient()
|
55 | test_rationalize()
|
56 | test_real()
|
57 | test_rect()
|
58 | test_sgn()
|
59 | test_taylor()
|
60 | test_transpose()
|
61 | test_zero()
|
62 | test_hermite()
|
63 | test_laguerre()
|
64 | test_legendre()
|
65 | test_binomial()
|
66 | test_divisors()
|
67 | test_coeff()
|
68 | test_sin()
|
69 | test_cos()
|
70 | test_tan()
|
71 | test_sinh()
|
72 | test_cosh()
|
73 | test_tanh()
|
74 | test_arcsin()
|
75 | test_arcsinh()
|
76 | test_arccos()
|
77 | test_arccosh()
|
78 | test_arctan()
|
79 | test_arctanh()
|
80 | test_index()
|
81 | test_isprime()
|
82 | test_integral()
|
83 | test_simplify()
|
84 | test_roots()
|
85 | test_eigen()
|
86 | mini_test()
|
87 |
|
88 |
|
89 |
|
90 | return
|
91 |
|
92 |
|
93 | logout = (s) ->
|
94 | console.log s
|
95 |
|
96 |
|
97 | run_test = (s) ->
|
98 | i = 0
|
99 | t = ""
|
100 |
|
101 | test_flag = 1
|
102 |
|
103 | run("clear")
|
104 |
|
105 | run("e=quote(e)")
|
106 |
|
107 | for i in [0...s.length] by 2
|
108 |
|
109 | console.log("starting example: " + s[i])
|
110 |
|
111 |
|
112 |
|
113 |
|
114 | out_count = 0
|
115 |
|
116 | try
|
117 | resultFromRun = run(s[i])
|
118 | catch error
|
119 | console.log error
|
120 | init()
|
121 |
|
122 |
|
123 | if (resultFromRun == s[i+1])
|
124 |
|
125 | console.log("ok example: " + s[i])
|
126 |
|
127 | ok_tests++
|
128 | continue
|
129 |
|
130 | ko_tests++
|
131 |
|
132 | console.log("\n")
|
133 | console.log("test failed: " + s[i])
|
134 |
|
135 | console.log("expected: " + s[i+1])
|
136 |
|
137 | console.log("obtained: " + resultFromRun)
|
138 | console.log("\n")
|
139 |
|
140 |
|
141 |
|
142 |
|
143 | test_flag = 0
|
144 |
|
145 |
|
146 |
|
147 |
|
148 | test_low_level = ->
|
149 | run("clear");
|
150 |
|
151 | test_signs_in_rationals()
|
152 | test_madd()
|
153 | test_msub()
|
154 | test_mmul()
|
155 | test_mdiv()
|
156 | test_mmod()
|
157 | test_mprime()
|
158 | test_mgcd()
|
159 | test_mpow()
|
160 | test_mroot()
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 | selftest()
|