From 48d11337432c25a75eb1d0c72dac604e3cd0b788 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 6 Mar 2013 20:04:53 -0500 Subject: [PATCH] Add tests for wood1(). --- tests/wood1_tests.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/wood1_tests.m diff --git a/tests/wood1_tests.m b/tests/wood1_tests.m new file mode 100644 index 0000000..98a17dd --- /dev/null +++ b/tests/wood1_tests.m @@ -0,0 +1,15 @@ +## Test the optimal point. +unit_test_equals("wood1([1;1;1;1]) == 0", ... + 0, ... + wood1([1;1;1;1])); + +## It should fail with the wrong number of coordinates. +f = wood1([1;2;3]); +unit_test_equals("wood1 fails with too few coordinates", ... + true, ... + isna(f)); + +f = wood1([1;2;3;4;5]); +unit_test_equals("wood1 fails with too many coordinates", ... + true, ... + isna(f)); -- 2.43.2