Mercurial > hg > octave-lojdl
changeset 2735:7c4b540299d5
[project @ 1997-02-25 03:38:24 by jwe]
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/abs-1.m @@ -0,0 +1,1 @@ +abs (1) == 1 && abs (-3.5) == 3.5 && abs (3+4i) == 5 && abs (3-4i) == 5
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/abs-2.m @@ -0,0 +1,1 @@ +all (all (abs ([1.1, 3i; 3+4i; -3-4i]) == [1.1, 3; 5, 5]))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/arg-1.m @@ -0,0 +1,1 @@ +arg (1) == 0 && arg (i) == pi/2 && arg (-1) == pi && arg (-i) == -pi/2
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/arg-2.m @@ -0,0 +1,1 @@ +all (all (arg ([1, i; -1, -i]) == [0, pi/2; pi, -pi/2]))
--- a/test/octave.test/arith/arith.exp +++ b/test/octave.test/arith/arith.exp @@ -1,26 +1,254 @@ -# ceil -# exp -# fix -# floor +set test ceil-1 +set prog_output "ans = 1" +do_test ceil-1.m + +set test ceil-2 +set prog_output "ans = 1" +do_test ceil-2.m + +set test ceil-3 +set prog_output "error:.*" +do_test ceil-3.m + +set test ceil-4 +set prog_output "error:.*" +do_test ceil-4.m + +set test exp-1 +set prog_output "ans = 1" +do_test exp-1.m + +set test exp-2 +set prog_output "ans = 1" +do_test exp-2.m + +set test exp-3 +set prog_output "error:.*" +do_test exp-3.m + +set test exp-4 +set prog_output "error:.*" +do_test exp-4.m + +set test fix-1 +set prog_output "ans = 1" +do_test fix-1.m + +set test fix-2 +set prog_output "ans = 1" +do_test fix-2.m + +set test fix-3 +set prog_output "error:.*" +do_test fix-3.m + +set test fix-4 +set prog_output "error:.*" +do_test fix-4.m + +set test floor-1 +set prog_output "ans = 1" +do_test floor-1.m + +set test floor-2 +set prog_output "ans = 1" +do_test floor-2.m + +set test floor-3 +set prog_output "error:.*" +do_test floor-3.m + +set test floor-4 +set prog_output "error:.*" +do_test floor-4.m + # gcd # lcm # log # log10 # log2 -# max -# min + +set test max-1 +set prog_output "ans = 1" +do_test max-1.m + +set test max-2 +set prog_output "ans = 1" +do_test max-2.m + +set test max-3 +set prog_output "error:.*" +do_test max-3.m + +set test max-4 +set prog_output "error:.*" +do_test max-4.m + +set test min-1 +set prog_output "ans = 1" +do_test min-1.m + +set test min-2 +set prog_output "ans = 1" +do_test min-2.m + +set test min-3 +set prog_output "error:.*" +do_test min-3.m + +set test min-4 +set prog_output "error:.*" +do_test min-4.m + # nexpow2 # pow2 + # rem -# round -# sign -# sqrt -# xor -# abs -# arg -# conj -# imag -# real + +set test round-1 +set prog_output "ans = 1" +do_test round-1.m + +set test round-2 +set prog_output "ans = 1" +do_test round-2.m + +set test round-3 +set prog_output "error:.*" +do_test round-3.m + +set test round-4 +set prog_output "error:.*" +do_test round-4.m + +set test sign-1 +set prog_output "ans = 1" +do_test sign-1.m + +set test sign-2 +set prog_output "ans = 1" +do_test sign-2.m + +set test sign-3 +set prog_output "error:.*" +do_test sign-3.m + +set test sign-4 +set prog_output "error:.*" +do_test sign-4.m + +set test sqrt-1 +set prog_output "ans = 1" +do_test sqrt-1.m + +set test sqrt-2 +set prog_output "ans = 1" +do_test sqrt-2.m + +set test sqrt-3 +set prog_output "error:.*" +do_test sqrt-3.m + +set test sqrt-4 +set prog_output "error:.*" +do_test sqrt-4.m + +set test abs-1 +set prog_output "ans = 1" +do_test abs-1.m + +set test abs-2 +set prog_output "ans = 1" +do_test abs-2.m + +set test abs-3 +set prog_output "error:.*" +do_test abs-3.m + +set test abs-4 +set prog_output "error:.*" +do_test abs-4.m + +set test xor-1 +set prog_output "ans = 1" +do_test xor-1.m + +set test xor-2 +set prog_output "ans = 1" +do_test xor-2.m + +set test xor-3 +set prog_output "error:.*" +do_test xor-3.m + +set test xor-4 +set prog_output "error:.*" +do_test xor-4.m + +set test arg-1 +set prog_output "ans = 1" +do_test arg-1.m + +set test arg-2 +set prog_output "ans = 1" +do_test arg-2.m + +set test arg-3 +set prog_output "error:.*" +do_test arg-3.m + +set test arg-4 +set prog_output "error:.*" +do_test arg-4.m + +set test conj-1 +set prog_output "ans = 1" +do_test conj-1.m + +set test conj-2 +set prog_output "ans = 1" +do_test conj-2.m + +set test conj-3 +set prog_output "error:.*" +do_test conj-3.m + +set test conj-4 +set prog_output "error:.*" +do_test conj-4.m + +set test imag-1 +set prog_output "ans = 1" +do_test imag-1.m + +set test imag-2 +set prog_output "ans = 1" +do_test imag-2.m + +set test imag-3 +set prog_output "error:.*" +do_test imag-3.m + +set test imag-4 +set prog_output "error:.*" +do_test imag-4.m + +set test real-1 +set prog_output "ans = 1" +do_test real-1.m + +set test real-2 +set prog_output "ans = 1" +do_test real-2.m + +set test real-3 +set prog_output "error:.*" +do_test real-3.m + +set test real-4 +set prog_output "error:.*" +do_test real-4.m + # sin # cos # tan @@ -45,11 +273,13 @@ # acsch # acoth # atan2 + # sum # prod # cumsum # cumprod # sumsq + # beta # betai # bincoeff
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/ceil-1.m @@ -0,0 +1,1 @@ +all (ceil ([2, 1.1, -1.1, -1]) == [2, 2, -1, -1])
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/ceil-2.m @@ -0,0 +1,1 @@ +all (ceil ([2+2i, 1.1+1.1i, -1.1-1.1i, -1-i]) == [2+2i, 2+2i, -1-i, -1-i])
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/ceil-4.m @@ -0,0 +1,1 @@ +ceil (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/conj-1.m @@ -0,0 +1,1 @@ +conj (1) == 1 && conj (i) == -1 && conj (1+i) == 1-i && conj (1-i) == 1+i
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/conj-2.m @@ -0,0 +1,1 @@ +all (all (conj ([-1, -i; -1+i, -1-i]) == [-1, i; -1-i, -1+i]))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/conj-4.m @@ -0,0 +1,1 @@ +conj (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/exp-1.m @@ -0,0 +1,1 @@ +all (exp ([0, 1, -1, 1000, -1000]) == [1, e, 1/e, Inf, 0])
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/exp-2.m @@ -0,0 +1,1 @@ +abs (exp (1+i) - e * (cos (1) + sin (1) * i)) < eps
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/fix-1.m @@ -0,0 +1,1 @@ +all (fix ([1.1, 1, -1.1, -1]) == [1, 1, -1, -1])
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/fix-2.m @@ -0,0 +1,1 @@ +all (fix ([1.1+1.1i, 1+i, -1.1-1.1i, -1-i]) == [1+i, 1+i, -1-i, -1-i])
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/floor-1.m @@ -0,0 +1,1 @@ +all (floor ([2, 1.1, -1.1, -1]) == [2, 1, -2, -1])
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/floor-2.m @@ -0,0 +1,1 @@ +all (floor ([2+2i, 1.1+1.1i, -1.1-1.1i, -1-i]) == [2+2i, 1+i, -2-2i, -1-i])
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/floor-4.m @@ -0,0 +1,1 @@ +floor (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/imag-1.m @@ -0,0 +1,1 @@ +imag (1) == 0 && imag (i) == 1 && imag (1+i) == 1
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/imag-2.m @@ -0,0 +1,1 @@ +all (all (imag ([i, 1; 1, i]) == eye (2)))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/imag-4.m @@ -0,0 +1,1 @@ +imag (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/max-1.m @@ -0,0 +1,1 @@ +max ([1, 4, 2, 3]) == 4 && max ([1; -10; 5; -2]) == 5
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/max-2.m @@ -0,0 +1,1 @@ +all (max ([4, i 4.999; -2, 2, 3+4i]) == [4, 2, 3+4i])
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/min-1.m @@ -0,0 +1,1 @@ +min ([1, 4, 2, 3]) == 1 && min ([1; -10; 5; -2]) == -10
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/min-2.m @@ -0,0 +1,1 @@ +all (min ([4, i; -2, 2]) == [-2, i])
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/real-1.m @@ -0,0 +1,1 @@ +real (1) == 1 && real (i) == 0 && real (1+i) == 1
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/real-2.m @@ -0,0 +1,1 @@ +all (all (real ([1, i; i, 1]) == eye (2)))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/real-3.m @@ -0,0 +1,1 @@ +real () \ No newline at end of file
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/real-4.m @@ -0,0 +1,1 @@ +real (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/round-1.m @@ -0,0 +1,2 @@ +(round (1) == 1 && round (1.1) = 1 && round (5.5) == 6 + && round (i) == i && round (2.5+3.5i) == 3+4i && round (-2.6) == -3)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/round-2.m @@ -0,0 +1,1 @@ +all (all (round ([1.1, -2.4; -3.7, 7.1]) == [1, -2; -4, 7]))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/round-4.m @@ -0,0 +1,1 @@ +round (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/sign-1.m @@ -0,0 +1,1 @@ +sign (-2) == -1 && sign (3) == 1 && sign (0) == 0
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/sign-2.m @@ -0,0 +1,1 @@ +all (all (sign ([1, -pi; e, 0]) == [1, -1; 1, 0]))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/sign-4.m @@ -0,0 +1,1 @@ +sign (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/sqrt-1.m @@ -0,0 +1,1 @@ +sqrt (4) == 2 && sqrt (-1) == i && sqrt (1+i) == exp (0.5 * log (1+i))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/sqrt-2.m @@ -0,0 +1,2 @@ +all (all (sqrt ([4, -4; i, 1-i]) + == [2, -2i; exp (0.5 * log (i)), exp (0.5 * log (1-i))]))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/sqrt-4.m @@ -0,0 +1,1 @@ +sqrt (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/xor-1.m @@ -0,0 +1,2 @@ +(xor ([1, 1, 0, 0], [0, 1, 0, 1]) == [1, 0, 0, 1] + && xor ([i, i, 0, 0], [1, 0, 1, 0]) == [1, 0, 0, 1])