X-Git-Url: http://gitweb.michael.orlitzky.com/?p=octave.git;a=blobdiff_plain;f=tests%2Fadvection_matrix_tests.m;fp=tests%2Fadvection_matrix_tests.m;h=7509b07c12f0ce0e0d84bd4409d4fbe2e90bd1b0;hp=0000000000000000000000000000000000000000;hb=b39006334c16dcd7256cb7c36e88996229863e6b;hpb=9ecd26a43862541b1c341cb318472d56ad0b382b diff --git a/tests/advection_matrix_tests.m b/tests/advection_matrix_tests.m new file mode 100644 index 0000000..7509b07 --- /dev/null +++ b/tests/advection_matrix_tests.m @@ -0,0 +1,13 @@ +## Try a 4x4 advection matrix. See the docstring in advection_matrix.m +## for an explanation of the expected result. + +expected = (1/2) * [ 0, 1, 0, -1; ... + -1, 0, 1, 0; ... + 0, -1, 0, 1; ... + 1, 0, -1, 0 ]; + +actual = advection_matrix(4, 0, 1); + +unit_test_equals("4x4 advection matrix is correct", ... + true, ... + expected == actual);