[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r112724: * indent/octave.m: Add tests
From: |
Leo Liu |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r112724: * indent/octave.m: Add tests for %!, # and ### comments |
Date: |
Sat, 25 May 2013 10:03:03 +0800 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 112724
committer: Leo Liu <address@hidden>
branch nick: trunk
timestamp: Sat 2013-05-25 10:03:03 +0800
message:
* indent/octave.m: Add tests for %!, # and ### comments
modified:
test/ChangeLog
test/indent/octave.m
=== modified file 'test/ChangeLog'
--- a/test/ChangeLog 2013-05-23 11:18:43 +0000
+++ b/test/ChangeLog 2013-05-25 02:03:03 +0000
@@ -1,3 +1,7 @@
+2013-05-25 Leo Liu <address@hidden>
+
+ * indent/octave.m: Add tests for %!, # and ### comments.
+
2013-05-23 Kenichi Handa <address@hidden>
* automated/decoder-tests.el: New file.
=== modified file 'test/indent/octave.m'
--- a/test/indent/octave.m 2013-05-24 19:37:55 +0000
+++ b/test/indent/octave.m 2013-05-25 02:03:03 +0000
@@ -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 @@
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 @@
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: A must be a square matrix> 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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r112724: * indent/octave.m: Add tests for %!, # and ### comments,
Leo Liu <=