summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Couvert <vincent.couvert@scilab.org>2007-03-26 08:45:45 +0000
committerVincent Couvert <vincent.couvert@scilab.org>2007-03-26 08:45:45 +0000
commit2b5677d82bdefa92178ad5418ea6f6f6c0fd62e4 (patch)
tree0b09833247095dcbe9712c3ce9cadbdb87929774 /tests
parent99db2890d23b703e6c45869e8d6f22ce6e597de5 (diff)
downloadscilab-2b5677d82bdefa92178ad5418ea6f6f6c0fd62e4.zip
scilab-2b5677d82bdefa92178ad5418ea6f6f6c0fd62e4.tar.gz
some tests added
Diffstat (limited to 'tests')
-rw-r--r--tests/nonRegression/bug2341.sci42
1 files changed, 32 insertions, 10 deletions
diff --git a/tests/nonRegression/bug2341.sci b/tests/nonRegression/bug2341.sci
index cca0e0c..1dcd8e3 100644
--- a/tests/nonRegression/bug2341.sci
+++ b/tests/nonRegression/bug2341.sci
@@ -2,7 +2,7 @@
2// Copyright INRIA 2// Copyright INRIA
3// Scilab Project - Vincent COUVERT 3// Scilab Project - Vincent COUVERT
4 4
5mode(-1); 5//mode(-1);
6clear; 6clear;
7 7
8MFILE=TMPDIR+"/bug2341.m" 8MFILE=TMPDIR+"/bug2341.m"
@@ -18,7 +18,7 @@ fd=mopen(MFILE,"w");
18mputl(MFILECONTENTS,fd); 18mputl(MFILECONTENTS,fd);
19mclose(fd); 19mclose(fd);
20 20
21ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch"); 21ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch")
22correct=correct&ierr==0; 22correct=correct&ierr==0;
23 23
24// TEST2: commas OK without spaces 24// TEST2: commas OK without spaces
@@ -29,7 +29,7 @@ fd=mopen(MFILE,"w");
29mputl(MFILECONTENTS,fd); 29mputl(MFILECONTENTS,fd);
30mclose(fd); 30mclose(fd);
31 31
32ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch"); 32ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch")
33correct=correct&ierr==0; 33correct=correct&ierr==0;
34 34
35// TEST3: commas OK with spaces before 35// TEST3: commas OK with spaces before
@@ -40,10 +40,10 @@ fd=mopen(MFILE,"w");
40mputl(MFILECONTENTS,fd); 40mputl(MFILECONTENTS,fd);
41mclose(fd); 41mclose(fd);
42 42
43ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch"); 43ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch")
44correct=correct&ierr==0; 44correct=correct&ierr==0;
45 45
46// TEST3: commas OK with spaces after 46// TEST4: commas OK with spaces after
47MFILECONTENTS=["function [a, b, c, d]=bug2341"; 47MFILECONTENTS=["function [a, b, c, d]=bug2341";
48"a=1;b=2;c=3;d=4"] 48"a=1;b=2;c=3;d=4"]
49 49
@@ -51,10 +51,10 @@ fd=mopen(MFILE,"w");
51mputl(MFILECONTENTS,fd); 51mputl(MFILECONTENTS,fd);
52mclose(fd); 52mclose(fd);
53 53
54ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch"); 54ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch")
55correct=correct&ierr==0; 55correct=correct&ierr==0;
56 56
57// TEST4: commas OK with spaces after and before 57// TEST5: commas OK with spaces after and before
58MFILECONTENTS=["function [a , b, c ,d]=bug2341"; 58MFILECONTENTS=["function [a , b, c ,d]=bug2341";
59"a=1;b=2;c=3;d=4"] 59"a=1;b=2;c=3;d=4"]
60 60
@@ -62,10 +62,10 @@ fd=mopen(MFILE,"w");
62mputl(MFILECONTENTS,fd); 62mputl(MFILECONTENTS,fd);
63mclose(fd); 63mclose(fd);
64 64
65ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch"); 65ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch")
66correct=correct&ierr==0; 66correct=correct&ierr==0;
67 67
68// TEST4: commas OK or KO 68// TEST6: commas OK or KO
69MFILECONTENTS=["function [a b, c d]=bug2341"; 69MFILECONTENTS=["function [a b, c d]=bug2341";
70"a=1;b=2;c=3;d=4"] 70"a=1;b=2;c=3;d=4"]
71 71
@@ -73,7 +73,29 @@ fd=mopen(MFILE,"w");
73mputl(MFILECONTENTS,fd); 73mputl(MFILECONTENTS,fd);
74mclose(fd); 74mclose(fd);
75 75
76ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch"); 76ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch")
77correct=correct&ierr==0;
78
79// TEST7: one output
80MFILECONTENTS=["function [a]=bug2341";
81"a=1;"]
82
83fd=mopen(MFILE,"w");
84mputl(MFILECONTENTS,fd);
85mclose(fd);
86
87ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch")
88correct=correct&ierr==0;
89
90// TEST8: one output with blanks
91MFILECONTENTS=["function [ a ]=bug2341";
92"a=1;"]
93
94fd=mopen(MFILE,"w");
95mputl(MFILECONTENTS,fd);
96mclose(fd);
97
98ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch")
77correct=correct&ierr==0; 99correct=correct&ierr==0;
78 100
79affich_result(correct,2341); 101affich_result(correct,2341);