You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>> doctest src/matlab/+myPackage/getVersion.m
Doctest v0.7.0+: this is Free Software without warranty, see source.
src/matlab/+myPackage/getVersion.m ...................... PASS 2/2
Summary:
PASS 2/2
1/1 targets passed, 0 without tests.
However, when being called on a parent folder doctest suddenly does not find the tests:
>> doctest src/matlab/+myPackage -nonrecursive
Doctest v0.7.0+: this is Free Software without warranty, see source.
src/matlab/+myPackage/
getVersion.m ......................................... NO TESTS
Summary:
PASS 0/0
1/1 targets passed, 1 without tests.
I'm using Matlab and the latest octave-doctest from master:
MATLAB Version: 9.7.0.1190202 (R2019b)
Operating System: Mac OS X Version: 10.14.6 Build: 18G95
The text was updated successfully, but these errors were encountered:
skycaptain
changed the title
Doctest does not find test with folder passed
Doctest does not find test within folder
Sep 26, 2019
I expected this to be the case although, the issue is the namespacing of Matlab, which is used here. In the end, doctest calls help on each file. However, when being called on a file its path (src/matlab/+myPackage/getVersion.m) gets passed to extract_docstring; when being called on a folder, only the function name (getVersion) is being passed. When using namespaces help expects the full namespace path, i.e. myPackage.getVersion. Also, stupid help does not raise an error when being called on an unknown function; it just returns an empty char array.
I'm not sure about what should happen with +apkg/subdir/...: I don't see anything about that in Matlab's docs. Maybe we should just traverse whatever Matlab gives us from what('+apkg') and not mess around with dir +apkg?
Calling
doctest
directly on a file works fine:However, when being called on a parent folder
doctest
suddenly does not find the tests:I'm using Matlab and the latest
octave-doctest
from master:The text was updated successfully, but these errors were encountered: