From: Leo Liu Date: Sat, 25 May 2013 02:03:03 +0000 (+0800) Subject: * indent/octave.m: Add tests for %!, # and ### comments X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~189 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cce6beebb7cb519dc710e15c5e677a671c098fef;p=emacs.git * indent/octave.m: Add tests for %!, # and ### comments --- diff --git a/test/ChangeLog b/test/ChangeLog index 2343ce49dbc..2142208f7ae 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2013-05-25 Leo Liu + + * indent/octave.m: Add tests for %!, # and ### comments. + 2013-05-23 Kenichi Handa * automated/decoder-tests.el: New file. diff --git a/test/indent/octave.m b/test/indent/octave.m index 98be02acd74..55f8cc045f4 100644 --- a/test/indent/octave.m +++ b/test/indent/octave.m @@ -1,5 +1,5 @@ ## -*- mode: octave; coding: utf-8 -*- - +0; # Don't make this a function file function res = tcomp (fn) %% res = tcomp (fn) %% imports components and rearranges them. @@ -2310,7 +2310,9 @@ function dep = is_architecture_dependent (nm) isglob = true; ext(end) = []; else - isglob = false; + isglob = false; # I am a test + # me too +### I shall align to column 0 endif pos = findstr (nm, ext); if (pos) @@ -2322,3 +2324,17 @@ function dep = is_architecture_dependent (nm) endif endfor endfunction + +%!assert(norm(logm([1 -1;0 1]) - [0 -1; 0 0]) < 1e-5); +%!assert(norm(expm(logm([-1 2 ; 4 -1])) - [-1 2 ; 4 -1]) < 1e-5); +%!assert(logm([1 -1 -1;0 1 -1; 0 0 1]), [0 -1 -1.5; 0 0 -1; 0 0 0], 1e-5); +%!assert (logm (expm ([0 1i; -1i 0])), [0 1i; -1i 0], 10 * eps) + +%% Test input validation +%!error logm (); +%!error logm (1, 2, 3); +%!error logm([1 0;0 1; 2 2]); + +%!assert (logm (10), log (10)) +%!assert (full (logm (eye (3))), logm (full (eye (3)))) +%!assert (full (logm (10*eye (3))), logm (full (10*eye (3))), 8*eps)