Rename the unit test script.
Check for satisfaction of all elements in unit_test_equals.m.
##
## * ``dd`` - The divided difference f[xs(1), xs(2),...]
##
- addpath('../homework1/src');
+ if (exist('../homework1/src', 'dir'))
+ addpath('../homework1/src');
+ end
+
order = length(xs) - 1;
if (order < 0)
unit_test_equals("sin[0, pi] == 0", ...
0, ...
divided_difference(@sin, [0,pi]));
+
+unit_test_equals("sin[0, pi, 2*pi] == 0", ...
+ 0, ...
+ divided_difference(@sin, [0,pi,2*pi]));
function unit_test_equals(test_title, result_A, result_B)
tol = 0.0001;
err = abs(result_A - result_B);
- unit_test(test_title, 1, all(err < tol));
+ unit_test(test_title, 1, all(all(err < tol)));
endfunction