view test/line-continue.tst @ 28942:fc4bb4bd1d5e

maint: Use '##' as lead-in for full-line comments. * condeig.m, mustBeMember.m, runge_kutta_interpolate.m, lsqnonneg.m, pqpnonneg.m, sqp.m, pkg.m, fplot.m, isosurface.m, __gnuplot_draw_axes__.m, profexport.m, bicgstab.m, factorial.m, movmad.m, movmax.m, movmean.m, movmedian.m, movmin.m, movprod.m, movstd.m, movsum.m, movvar.m, fA.m, fB.m, fC.m, one.m, two.m, df_vr.m, u_vr.m, myclass2.m, foo_subsref_subsasgn.m, Blork.m, CPrecedenceTester1.m, Cork.m, display.m, display.m, get.m, set.m, display.m, Sneetch.m, Snork.m, Spork.m, jit.tst, line-continue.tst, mk_bc_overloads_expected.m, arg_nest.m, no_closure.m, persistent_nest.m, recursive_nest.m, recursive_nest2.m, scope0.m, scope1.m, scope2.m, scope3.m, script_nest.m, script_nest_2.m, script_nest_script.m, script_nest_script_2.m, pkg.tst: Use '##' as lead-in for full-line comments.
author Rik <rik@octave.org>
date Thu, 15 Oct 2020 14:30:01 -0700
parents bd51beb6205e
children 7854d5752dd2
line wrap: on
line source

########################################################################
##
## Copyright (C) 2006-2020 The Octave Project Developers
##
## See the file COPYRIGHT.md in the top-level directory of this
## distribution or <https://octave.org/copyright/>.
##
## This file is part of Octave.
##
## Octave is free software: you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING.  If not, see
## <https://www.gnu.org/licenses/>.
##
########################################################################

%!shared x, a, b
%! x = [1,2];
%! a = 1;
%! b = 2;

%!test
%! y = [a... # comments here ok
%! b];
%! assert (y, x);

## FIXME: Next 3 tests use '\' continuation outside of a double-quoted string
##        This behavior is deprecated and will be removed at some point.
##        When it does these
%!test
%! x = [1;2];
%! y = [a... # comments here ok
%! ;\
%!
%! b];
%! assert (y, x);

%!assert (1 + ...
%! 2 - \# comments here ok
%! 3 / ... # comments here ok
%! -1,6);

%!function y = f (a,...
%!                b,  ...
%!                c,  ...   % comments ok
%!                x,  # continuation characters not required in parens
%!                y,  \# but they should work too.
%!                z)
%!
%!  y = 1;
%!endfunction
%!
%!assert (f (), 1)

## String continuation using '\'
%!assert (["abc\
%! def"], "abc def")

%!test
%!assert (1 == 1
%! && 2 == 2
%! || 3 == 5);

%!test
%! x = [1, ...
%!
%! ...
%!
%! 2];
%! y = [1;2];
%! assert (y, x);

%!test
%! x = [1 ,...
%! 2];
%! y = [1,2];
%! assert (y, x);

%!test
%! x = [ 1 , ...
%! 2];
%! y = [1,2];
%! assert  (y, x);

%!test
%! x = [ 1 , ...anything after the ... is ignored
%! 2];
%! y = [1,2];
%! assert  (y, x);