Mercurial > hg > octave-nkf
comparison scripts/strings/strchr.m @ 11260:fd18ba11af57
Extra tests in strchr
author | Kim Hansen <kim@ange.dk> |
---|---|
date | Wed, 17 Nov 2010 04:16:59 -0500 |
parents | be55736a0783 |
children | 9c19b450b254 |
comparison
equal
deleted
inserted
replaced
11259:fe11e2b9d48a | 11260:fd18ba11af57 |
---|---|
55 varargout = cell (1, nargout); | 55 varargout = cell (1, nargout); |
56 varargout{1} = []; | 56 varargout{1} = []; |
57 [varargout{:}] = find (mask, varargin{:}); | 57 [varargout{:}] = find (mask, varargin{:}); |
58 endfunction | 58 endfunction |
59 | 59 |
60 %!assert(strchr("Octave is the best software",""),zeros(1,0)) | |
60 %!assert(strchr("Octave is the best software","best"),[3, 6, 9, 11, 13, 15, 16, 17, 18, 20, 23, 27]) | 61 %!assert(strchr("Octave is the best software","best"),[3, 6, 9, 11, 13, 15, 16, 17, 18, 20, 23, 27]) |
62 %!assert(strchr("Octave is the best software","software"),[3, 4, 6, 9, 11, 13, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27]) | |
63 |