bugGNU Octave - Bugs: bug #52852, a small regression in example code...

 
 

bug #52852: a small regression in example code in Appendix Test Functions

Submitter:  None
Submitted:  Wed 10 Jan 2018 04:56:24 AM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.2.1
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 10 Jan 2018 05:53:04 AM UTC, comment #1: 
Rik <rik5>
Group administrator
Wed 10 Jan 2018 04:56:24 AM UTC, original submission:  

Note the first change in the following patch, the space between '%!' and 'assert' is intended.
This is a regression @ 21317:a4faec57f4c8 https://hg.savannah.gnu.org/hgweb/octave/diff/a4faec57f4c8/doc/interpreter/testfun.txi


diff -ru7 a/doc/interpreter/testfun.txi b/doc/interpreter/testfun.txi
--- a/doc/interpreter/testfun.txi
+++ b/doc/interpreter/testfun.txi
@@ -207,15 +207,15 @@
 The following is nearly identical to the example above, but does nothing.

 @example
 @group
 %!function @var{a} = fn (@var{b})
 %!  @var{a} = 2*@var{b};
 %!endfunction
-%!assert (fn(2), 4)
+%! assert (fn(2), 4)
 @end group
 @end example

 @noindent
 Because there is a space after @samp{%!} the @code{assert} statement does
 not begin a new block and this line is treated as a comment.

@@ -291,19 +291,19 @@

 @noindent
 The following trivial code snippet provides examples for the use of
 fail, assert, error, and xtest:

 @example
 @group
-function output = must_be_zero (@var{input})
+function @var{output} = must_be_zero (@var{input})
   if (@var{input} != 0)
     error ("Nonzero input!")
   endif
-  output = input;
+  @var{output} = @var{input};
 endfunction

 %!fail ("must_be_zero (1)")
 %!assert (must_be_zero (0), 0)
 %!error <Nonzero> must_be_zero (1)
 %!xtest error ("This code generates an error")
 @end group


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-01-10 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code