# HG changeset patch # User Thomas Weber # Date 1265101668 -3600 # Node ID 4f93c55f6382906a7cdddff35a5b72b1c957bab2 # Parent 4ea0bda308b7e79bcc69eb7b7703a2151843abee Add test case for empty argument in filter() diff --git a/src/DLD-FUNCTIONS/filter.cc b/src/DLD-FUNCTIONS/filter.cc --- a/src/DLD-FUNCTIONS/filter.cc +++ b/src/DLD-FUNCTIONS/filter.cc @@ -735,6 +735,12 @@ %! y0 = zeros(4,4,2); y0(1:2,1:4,1) = +1; y0(1:2,1:4,2) = -1; %! y = filter(b, [1], x); %! assert(all(all(all(y==y0)))) +%! +%!test % test for empty X +%! a = 1; b = ones(10,1)/10; +%! result = filter(b,a,[]); +%! expected = []; +%! assert(result, expected); %% Should put some tests of the "DIM" parameter in here.