summaryrefslogtreecommitdiffstats
path: root/scilab/modules/functions
diff options
context:
space:
mode:
authorVincent COUVERT <vincent.couvert@scilab.org>2010-03-30 17:21:03 +0200
committerVincent COUVERT <vincent.couvert@scilab.org>2010-03-30 17:21:03 +0200
commita0046327b0dd39370192077bc8d2b4c3e7eef085 (patch)
treee3ebeca9218d3086147bd0a995e812bdc04bff25 /scilab/modules/functions
parent65ce0ceaba7b3e995ac8fcec01d807c0146e0462 (diff)
downloadscilab-a0046327b0dd39370192077bc8d2b4c3e7eef085.zip
scilab-a0046327b0dd39370192077bc8d2b4c3e7eef085.tar.gz
Bug 6841 fixed
Diffstat (limited to 'scilab/modules/functions')
-rw-r--r--scilab/modules/functions/macros/fun2string.sci2
-rw-r--r--scilab/modules/functions/tests/nonreg_tests/bug_6841.dia.ref27
-rw-r--r--scilab/modules/functions/tests/nonreg_tests/bug_6841.tst19
3 files changed, 47 insertions, 1 deletions
diff --git a/scilab/modules/functions/macros/fun2string.sci b/scilab/modules/functions/macros/fun2string.sci
index d65212c..7b59804 100644
--- a/scilab/modules/functions/macros/fun2string.sci
+++ b/scilab/modules/functions/macros/fun2string.sci
@@ -361,7 +361,7 @@ function [stk,txt,ilst]=exp2sci(lst,ilst)
361 stk(top)=list(op(2),'0') 361 stk(top)=list(op(2),'0')
362 m=%f 362 m=%f
363 elseif type(stk(top)(1))==10 then 363 elseif type(stk(top)(1))==10 then
364 if op(4)=='1'&funptr(op(2))==0&exists(op(2))==0|and(type(evstr(op(2)))<>[11 13 130]) then 364 if op(4)=='1'&funptr(op(2))==0&exists(op(2))==0|(execstr(op(2),"errcatch")==0&and(type(evstr(op(2)))<>[11 13 130])) then
365 top=top+1 365 top=top+1
366 stk(top)=list(op(2),'0') 366 stk(top)=list(op(2),'0')
367 m=%f 367 m=%f
diff --git a/scilab/modules/functions/tests/nonreg_tests/bug_6841.dia.ref b/scilab/modules/functions/tests/nonreg_tests/bug_6841.dia.ref
new file mode 100644
index 0000000..1b2198f
--- /dev/null
+++ b/scilab/modules/functions/tests/nonreg_tests/bug_6841.dia.ref
@@ -0,0 +1,27 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2010 - DIGITEO - Vincent COUVERT
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- Non-regression test for bug 6841 -->
8//
9// <-- Bugzilla URL -->
10// http://bugzilla.scilab.org/show_bug.cgi?id=6841
11//
12// <-- Short Description -->
13// fun2string does not work on a simple example.
14function myfoo ( )
15 B = zeros(2,1)
16 v = B(1,1)
17endfunction
18fun2string(myfoo)
19 ans =
20
21!function []=ans() !
22! !
23! B = zeros(2, 1) !
24! !
25! v = B(1, 1) !
26! !
27!endfunction !
diff --git a/scilab/modules/functions/tests/nonreg_tests/bug_6841.tst b/scilab/modules/functions/tests/nonreg_tests/bug_6841.tst
new file mode 100644
index 0000000..dcf83ea
--- /dev/null
+++ b/scilab/modules/functions/tests/nonreg_tests/bug_6841.tst
@@ -0,0 +1,19 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2010 - DIGITEO - Vincent COUVERT
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- Non-regression test for bug 6841 -->
8//
9// <-- Bugzilla URL -->
10// http://bugzilla.scilab.org/show_bug.cgi?id=6841
11//
12// <-- Short Description -->
13// fun2string does not work on a simple example.
14
15function myfoo ( )
16 B = zeros(2,1)
17 v = B(1,1)
18endfunction
19fun2string(myfoo) \ No newline at end of file