X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=tests%2Fpowell1_tests.m;fp=tests%2Fpowell1_tests.m;h=dbcf71e9493beb5b060f5073cbc152e44249bf93;hb=c5435604f6ca4774b729d2b209bc32df4420aa69;hp=0000000000000000000000000000000000000000;hpb=48d11337432c25a75eb1d0c72dac604e3cd0b788;p=octave.git diff --git a/tests/powell1_tests.m b/tests/powell1_tests.m new file mode 100644 index 0000000..dbcf71e --- /dev/null +++ b/tests/powell1_tests.m @@ -0,0 +1,16 @@ +## Test the optimal point. + +unit_test_equals("powell1([0;0;0;0]) == 0", ... + 0, ... + powell1([0;0;0;0])); + +## It should fail with the wrong number of coordinates. +f = powell1([1;2;3]); +unit_test_equals("powell1 fails with too few coordinates", ... + true, ... + isna(f)); + +f = powell1([1;2;3;4;5]); +unit_test_equals("powell1 fails with too many coordinates", ... + true, ... + isna(f));