octave-patch-tracker
[Top][All Lists]
Advanced

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

[Octave-patch-tracker] [patch #9241] More verbose information when input


From: Kai Torben Ohlhus
Subject: [Octave-patch-tracker] [patch #9241] More verbose information when inputParser fails validating argument
Date: Wed, 8 Feb 2017 05:39:02 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Follow-up Comment #4, patch #9241 (project octave):

Just for the files: The test script before the patch with less verbose
information what to do:


>> p = inputParser();
>> p.addParameter('Para1',{},@ischar);
>> p.addParameter('Para2',[],@isnumeric);
>> p.parse('Para1','this is a valid argument for Para1','Para2',[1,2,3]);
>> p.parse('Para1',1);

error: failed validation of PARA1
error: called from
    error at line 539 column 7
    validate_arg at line 506 column 11
    parse at line 454 column 11

>> p.parse('Para2','abc');
error: failed validation of PARA2
error: called from
    error at line 539 column 7
    validate_arg at line 506 column 11
    parse at line 454 column 11


After the patch the last two statements with the same input:


>> p.parse('Para1',1);
error: failed validation of PARA1 with @(x) ischar (x)
error: called from
    error at line 541 column 7
    validate_arg at line 507 column 11
    parse at line 455 column 11

>> p.parse('Para2','abc');
error: failed validation of PARA2 with isnumeric
error: called from
    error at line 541 column 7
    validate_arg at line 507 column 11
    parse at line 455 column 11




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?9241>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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