octave-maintainers
[Top][All Lists]
Advanced

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

Re: Octave-maintainers Digest, Vol 140, Issue 32


From: Daniel J Sebald
Subject: Re: Octave-maintainers Digest, Vol 140, Issue 32
Date: Fri, 24 Nov 2017 14:10:31 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 11/23/2017 04:33 PM, Rik wrote:
On 11/23/2017 09:00 AM, address@hidden wrote:
Subject:
Re: 4.2.2 release
From:
Daniel J Sebald <address@hidden>
Date:
11/22/2017 12:30 PM

To:
"John W. Eaton" <address@hidden>, Octave Maintainers List <address@hidden>

List-Post:
<mailto:address@hidden>
Content-Transfer-Encoding:
7bit
Precedence:
list
MIME-Version:
1.0
References:
<address@hidden> <address@hidden>
In-Reply-To:
<address@hidden>
Message-ID:
<address@hidden>
Content-Type:
text/plain; charset=utf-8; format=flowed
Message:
3


On 11/22/2017 02:19 PM, Daniel J Sebald wrote:

the latter of which has a patch. textscan() is fairly popular so it might be nice to address those before a release in order to avoid redundant bug reports, unless it doesn't really reach critical status for minor releases.

PS: Are there no tests for built-in functions?

octave:5> test textscan
????? textscan is a built-in function

Dan

Built-in functions often do have tests, but the tests are in the file where the built-in function resides. So try this

octave: 1> which textscan
'textscan' is a built-in function from the file libinterp/corefcn/file-io.cc
octave: 2> test file-io.cc
PASSES 83 out of 83 tests

OK.  I would think there are some tests.

Looking at the file-io.cc example with regard to textscan, I wonder why these textscan tests couldn't be associated with the help comments, i.e., placed at the end, in a fashion similar to the format of the script files? For example, in file-io.cc if it were:

DEFMETHOD (textscan, interp, args, ,
           doc: /*## -*- texinfo -*-
## @deftypefn  {} address@hidden =} textscan (@var{fid}, @var{format})
## @deftypefnx {} address@hidden =} textscan (@var{fid}, @var{format}, @var{repeat}) ## @deftypefnx {} address@hidden =} textscan (@var{fid}, @var{format}, @var{param}, @var{value}, @dots{}) ## @deftypefnx {} address@hidden =} textscan (@var{fid}, @var{format}, @var{repeat}, @var{param}, @var{value}, @dots{})
## @deftypefnx {} address@hidden =} textscan (@var{str}, @dots{})
[snip]
## @seealso{dlmread, fscanf, load, strread, textread}
## @end deftypefn

%!test
%! str = "1,  2,  3,  4\n 5,  ,  ,  8\n 9, 10, 11, 12";
%! fmtstr = "%f %d %f %s";
%! c = textscan (str, fmtstr, 2, "delimiter", ",", "emptyvalue", -Inf);
%! assert (c{1}, [1;5]);
%! assert (c{3}, [3; -Inf]);
%! assert (iscellstr (c{4}));
[snip] */

Then that text between the comment is pretty much the same as the text that appears in the script files except there is no code between the help and the tests. I would think that the same script/function that processes the script files for documentation and tests could also work with the above text.

Dan



reply via email to

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