From e82399c840c15f2bfb185eb98f6894cc6a327682 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Wed, 1 Mar 2017 10:12:52 +0100
Subject: [PATCH] Allow uncommented blocks for unit tests.

In this case the unit tests blocks must be preceeded by a return
statement.
---
 src/mtest.m | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/mtest.m b/src/mtest.m
index 2689d61..fd076e3 100644
--- a/src/mtest.m
+++ b/src/mtest.m
@@ -86,8 +86,17 @@ for i=1:nn
     tid = fopen([FNAME '_test_' int2str(i) '.m'],'w');
     fprintf(tid,['function [T,t,LOG] = ' FNAME '_test_' int2str(i) '()\n']);
     fprintf(tid,['try\n']);
+    if isequal(file{b1(i)+1}(1:3), '%$ ') || isequal(file{b1(i)+1}(1:2), '%$')
+        remove_first_columns = true;
+    else
+        remove_first_columns = false;
+    end
     for j=b1(i):b2(i)
-        str = sprintf('%s \n',file{j}(4:end));
+        if remove_first_columns
+            str = sprintf('%s \n',file{j}(4:end));
+        else
+            str = sprintf('%s \n',file{j}(1:end));
+        end
         str = regexprep(str, '%', '%%');
         fprintf(tid,str);
     end
-- 
GitLab