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

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

[Octave-bug-tracker] [bug #52852] a small regression in example code in


From: anonymous
Subject: [Octave-bug-tracker] [bug #52852] a small regression in example code in Appendix Test Functions
Date: Tue, 9 Jan 2018 23:56:25 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

URL:
  <http://savannah.gnu.org/bugs/?52852>

                 Summary: a small regression in example code in Appendix Test
Functions
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Wed 10 Jan 2018 04:56:24 AM UTC
                Category: Documentation
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Documentation
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.1
        Operating System: Any

    _______________________________________________________

Details:

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} = address@hidden;
 %!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





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52852>

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




reply via email to

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