From eb25a54ee958b532c02259895b4b1435f9163b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Wed, 16 Oct 2013 13:07:41 +0200 Subject: [PATCH] Added unitary tests for the dates class' constructor. --- matlab/@dates/dates.m | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/matlab/@dates/dates.m b/matlab/@dates/dates.m index 695b75994..f7c611332 100644 --- a/matlab/@dates/dates.m +++ b/matlab/@dates/dates.m @@ -201,4 +201,42 @@ end %$ t(3) = dyn_assert(d.time,[1950 2]); %$ end %$ T = all(t); -%@eof:4 \ No newline at end of file +%@eof:4 + +%@test:5 +%$ % Define a dates object +%$ B = dates(4,1950,1):dates(4,1960,3); +%$ +%$ % Call the tested routine. +%$ d = B(2); +%$ if isa(d,'dates') +%$ t(1) = 1; +%$ else +%$ t(1) = 0; +%$ end +%$ +%$ if t(1) +%$ t(2) = dyn_assert(d.freq,B.freq); +%$ t(3) = dyn_assert(d.time,[1950 2]); +%$ end +%$ T = all(t); +%@eof:5 + +%@test:6 +%$ % Define a dates object +%$ B = dates(4,[1950 1]):dates(4,[1960 3]); +%$ +%$ % Call the tested routine. +%$ d = B(2); +%$ if isa(d,'dates') +%$ t(1) = 1; +%$ else +%$ t(1) = 0; +%$ end +%$ +%$ if t(1) +%$ t(2) = dyn_assert(d.freq,B.freq); +%$ t(3) = dyn_assert(d.time,[1950 2]); +%$ end +%$ T = all(t); +%@eof:6 \ No newline at end of file