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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Rik-4
On 11/23/2017 09:00 AM, [hidden email] wrote:
Subject:
Re: 4.2.2 release
From:
Daniel J Sebald [hidden email]
Date:
11/22/2017 12:30 PM
To:
"John W. Eaton" [hidden email], Octave Maintainers List [hidden email]
List-Post:
[hidden email]
Content-Transfer-Encoding:
7bit
Precedence:
list
MIME-Version:
1.0
References:
[hidden email] [hidden email]
In-Reply-To:
[hidden email]
Message-ID:
[hidden email]
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

--Rik
Reply | Threaded
Open this post in threaded view
|

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

Daniel Sebald
On 11/23/2017 04:33 PM, Rik wrote:

> On 11/23/2017 09:00 AM, [hidden email] wrote:
>> Subject:
>> Re: 4.2.2 release
>> From:
>> Daniel J Sebald <[hidden email]>
>> Date:
>> 11/22/2017 12:30 PM
>>
>> To:
>> "John W. Eaton" <[hidden email]>, Octave Maintainers List
>> <[hidden email]>
>>
>> List-Post:
>> <mailto:[hidden email]>
>> Content-Transfer-Encoding:
>> 7bit
>> Precedence:
>> list
>> MIME-Version:
>> 1.0
>> References:
>> <[hidden email]>
>> <[hidden email]>
>> In-Reply-To:
>> <[hidden email]>
>> Message-ID:
>> <[hidden email]>
>> 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  {} {@var{C} =} textscan (@var{fid}, @var{format})
## @deftypefnx {} {@var{C} =} textscan (@var{fid}, @var{format},
@var{repeat})
## @deftypefnx {} {@var{C} =} textscan (@var{fid}, @var{format},
@var{param}, @var{value}, @dots{})
## @deftypefnx {} {@var{C} =} textscan (@var{fid}, @var{format},
@var{repeat}, @var{param}, @var{value}, @dots{})
## @deftypefnx {} {@var{C} =} 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