octave-maintainers
[Top][All Lists]
Advanced

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

Re: doctest-for-matlab


From: Colin Macdonald
Subject: Re: doctest-for-matlab
Date: Sun, 22 Feb 2015 12:38:21 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 20/02/15 17:18, Rik wrote:
> Yes, all of the documentation is written assuming a Texinfo environment. 
> This means @result{} is a valid macro and is preferred because it can
> insert a true result arrow in TeX output.  We don't want to undo all of that.

I've played with extracting just the text between "@example" and "@end
example".  This removes the "2 blank lines" requirement.  I also strip
the @result{} and @group.  This is WIP merge request at
https://github.com/catch22/doctest-for-matlab/pull/7/

I still require ">>" at the start of each command, that's how it tells
the difference between input and output.

Probably this is undesirable for the larger Octave code base!
Presumably one could refactor as follows:
  1. execute the first line it finds.
  2. check if expected n lines of output matches the actual next n lines
  3. if so skip ahead n lines and repeat
(with some fuzz for whitespace flexibility as in current code)

This is a bit more work as current code finds all tests as a
preprocessing step.

And as I think Oliver Heimlich pointed out, Octave core @example blocks
are rather free-form...

Colin

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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