aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2013-05-25 10:03:03 +0800
committerLeo Liu2013-05-25 10:03:03 +0800
commitcce6beebb7cb519dc710e15c5e677a671c098fef (patch)
tree7555b2e31ba4e1c778d4d1b8e45918415e1ba428
parent38cd43ebed34c8198c5427d6607121620f8ddacf (diff)
downloademacs-cce6beebb7cb519dc710e15c5e677a671c098fef.tar.gz
emacs-cce6beebb7cb519dc710e15c5e677a671c098fef.zip
* indent/octave.m: Add tests for %!, # and ### comments
-rw-r--r--test/ChangeLog4
-rw-r--r--test/indent/octave.m20
2 files changed, 22 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 2343ce49dbc..2142208f7ae 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
12013-05-25 Leo Liu <sdl.web@gmail.com>
2
3 * indent/octave.m: Add tests for %!, # and ### comments.
4
12013-05-23 Kenichi Handa <handa@gnu.org> 52013-05-23 Kenichi Handa <handa@gnu.org>
2 6
3 * automated/decoder-tests.el: New file. 7 * 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 @@
1## -*- mode: octave; coding: utf-8 -*- 1## -*- mode: octave; coding: utf-8 -*-
2 20; # Don't make this a function file
3function res = tcomp (fn) 3function res = tcomp (fn)
4 %% res = tcomp (fn) 4 %% res = tcomp (fn)
5 %% imports components and rearranges them. 5 %% imports components and rearranges them.
@@ -2310,7 +2310,9 @@ function dep = is_architecture_dependent (nm)
2310 isglob = true; 2310 isglob = true;
2311 ext(end) = []; 2311 ext(end) = [];
2312 else 2312 else
2313 isglob = false; 2313 isglob = false; # I am a test
2314 # me too
2315### I shall align to column 0
2314 endif 2316 endif
2315 pos = findstr (nm, ext); 2317 pos = findstr (nm, ext);
2316 if (pos) 2318 if (pos)
@@ -2322,3 +2324,17 @@ function dep = is_architecture_dependent (nm)
2322 endif 2324 endif
2323 endfor 2325 endfor
2324endfunction 2326endfunction
2327
2328%!assert(norm(logm([1 -1;0 1]) - [0 -1; 0 0]) < 1e-5);
2329%!assert(norm(expm(logm([-1 2 ; 4 -1])) - [-1 2 ; 4 -1]) < 1e-5);
2330%!assert(logm([1 -1 -1;0 1 -1; 0 0 1]), [0 -1 -1.5; 0 0 -1; 0 0 0], 1e-5);
2331%!assert (logm (expm ([0 1i; -1i 0])), [0 1i; -1i 0], 10 * eps)
2332
2333%% Test input validation
2334%!error logm ();
2335%!error logm (1, 2, 3);
2336%!error <logm: A must be a square matrix> logm([1 0;0 1; 2 2]);
2337
2338%!assert (logm (10), log (10))
2339%!assert (full (logm (eye (3))), logm (full (eye (3))))
2340%!assert (full (logm (10*eye (3))), logm (full (10*eye (3))), 8*eps)