From f447ea8feb29af5ac99b32124b3461c5b537701b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Fri, 12 Apr 2013 15:59:19 +0200 Subject: [PATCH] Added unitary test in dynSeries/extract method. --- matlab/@dynSeries/extract.m | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/matlab/@dynSeries/extract.m b/matlab/@dynSeries/extract.m index 3cf10b091..a22c211f6 100644 --- a/matlab/@dynSeries/extract.m +++ b/matlab/@dynSeries/extract.m @@ -181,7 +181,7 @@ function b = isnotempty_cell(CellArray) %@eof:1 -%@test:1 +%@test:2 %$ % Define a data set. %$ A = rand(10,24); %$ @@ -200,4 +200,30 @@ function b = isnotempty_cell(CellArray) %$ end %$ %$ T = all(t); -%@eof:1 +%@eof:2 + + +%@test:3 +%$ % Define a data set. +%$ A = rand(10,24); +%$ +%$ % Define names +%$ A_name = {'GDP_1';'GDP_2';'GDP_3'; 'GDP_4'; 'GDP_5'; 'GDP_6'; 'GDP_7'; 'GDP_8'; 'GDP_9'; 'GDP_10'; 'GDP_11'; 'GDP_12'; 'HICP_1';'HICP_2';'HICP_3'; 'HICP_4'; 'HICP_5'; 'HICP_6'; 'HICP_7'; 'HICP_8'; 'HICP_9'; 'HICP_10'; 'HICP_11'; 'HICP_12';}; +%$ +%$ % Instantiate a time series object. +%$ ts1 = dynSeries(A,[],A_name,[]); +%$ +%$ % Call the tested method. +%$ try +%$ a = ts1{'@GDP,HICP@_@1,2,3,4,5@'}; +%$ t = 1; +%$ catch +%$ t = 0; +%$ end +%$ +%$ if t(1) +%$ t(2) = dyn_assert(a.name,{'GDP_1';'GDP_2';'GDP_3';'GDP_4';'GDP_5';'HICP_1';'HICP_2';'HICP_3';'HICP_4';'HICP_5'}); +%$ end +%$ +%$ T = all(t); +%@eof:3