help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TDD in Octave, guidance/tutorial?


From: IainIsm
Subject: TDD in Octave, guidance/tutorial?
Date: Mon, 4 Feb 2013 09:29:05 -0800 (PST)

I am trying out some test driven development in Octave as a precursor to
trying it elsewhere.  However I have come slightly unstuck in trying to test
for expected errors/failures.

For example I have started to write a function which requires two parameters
and then can accept optional parameters, provided as a pair:

getAccelData(required1, required2)
getAccelData(required1, required2, optional1, optional2)

optional1, if provided must be 'endAccel', and optional2 must be one of
'zero', last' or 'mean'.

Following the help at
http://www.gnu.org/software/octave/doc/interpreter/Test-Functions.html I
have got as far as:

%!test % Check optional values - part one, expected failures
%!  error(getAccelData(tStep, vRamp, 'test', 'zero'));

But on running my tests I get:

!!!!! test failed
No matching property found for: test

Which is the expected error message!

How do I write the test to pass i.e. successfully see the error message
please?  (Or alternatively is there a guide anywhere to TDD in Octave please
that covers this?  I've STFW but only seem to be able to find examples of
testing for success, i.e. assert(...))

Thanks!

Iain





--
View this message in context: 
http://octave.1599824.n4.nabble.com/TDD-in-Octave-guidance-tutorial-tp4649480.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]