octave-maintainers
[Top][All Lists]
Advanced

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

Re: testing error messages with functions needing a file id


From: PhilipNienhuis
Subject: Re: testing error messages with functions needing a file id
Date: Sun, 17 Mar 2013 03:37:18 -0700 (PDT)

Daniel Sebald wrote
> On 03/16/2013 06:07 PM, PhilipNienhuis wrote:
>> In textscan.m I'd like to have a test like:
>>
>> %!error
> <missing or illegal value for>
>   textscan (fid, "%s", "headerlines")
>>
>> but there are a few stumbling blocks:
>>
>> 1. I wouldn't know how to supply a valid file identifier to textscan so
>> that
>> the test can be made to work (apparently the error message test is
>> self-contained (left-adjusted against "%!") and cannot comprise multiple
>> lines).
> 
> I'm not completely understanding what the issue is.  

Sorry to be so vague. Another try:

1. Octave's error message tests seem to be exclusively one-liners only. See
the last 3 lines in textscan's test suite.
2. I want to check an error message that textscan.m only emits when reading
from file.
3. textscan.m doesn't accept file names but rather file identifiers
previously made with fopen()
4. I wouldn't know how to squeeze an fopen and an fclose statement plus a
call to textscan in one line.

Or does the error message test accept <statement> ; <statement> ;
constructs? (with semicolons) (hmm didn't try that)


> However, the second 
> last sample test in that file creates a temporary file, writes some data 
> to it, then rewinds the file and passes the FID onto the textscan test.

Yes, I wrote that test myself a few days ago:-)

Thanks,

Philip



--
View this message in context: 
http://octave.1599824.n4.nabble.com/testing-error-messages-with-functions-needing-a-file-id-tp4650879p4650890.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

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