Simple example of unit testing in Matlab. Run with
>>run(test_add_one);
More info here.
Simple example of how to write unit tests in Matlab