From: Michael Orlitzky Date: Mon, 15 Oct 2012 19:07:18 +0000 (-0400) Subject: Add a test for the poisson_matrix function. X-Git-Url: http://gitweb.michael.orlitzky.com/?p=octave.git;a=commitdiff_plain;h=9fb5a1527f1ea90f9074b6e318791e0cc43e18f7 Add a test for the poisson_matrix function. --- diff --git a/run-tests.m b/run-tests.m index 1f6d561..1682d18 100755 --- a/run-tests.m +++ b/run-tests.m @@ -42,3 +42,12 @@ unit_test_equals("2 is not odd", ... unit_test_equals("2 is even", ... true, ... even(2)); + +expected_A = [1, 0, 0, 0, 0; ... + 16, -32, 16, 0, 0; ... + 0, 16, -32, 16, 0; ... + 0, 0, 16, -32, 16; ... + 0, 0, 0, 0, 1]; +unit_test_equals("Homework #1 problem #1 Poisson matrix is correct", ... + true, ... + expected_A == poisson_matrix(4, 0, 1));