summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Couvert <vincent.couvert@scilab.org>2007-03-15 15:27:59 +0000
committerVincent Couvert <vincent.couvert@scilab.org>2007-03-15 15:27:59 +0000
commit77c44f099f95d64066c58445b278619ccd1f61e7 (patch)
tree84c550377f57c7e617dc1c3639f2ebdc461a8c54 /tests
parentdf35f16a9f238bf38a56730bceff5f8612e1f95f (diff)
downloadscilab-77c44f099f95d64066c58445b278619ccd1f61e7.zip
scilab-77c44f099f95d64066c58445b278619ccd1f61e7.tar.gz
non regression test file for bug 2341
Diffstat (limited to 'tests')
-rw-r--r--tests/nonRegression/bug2341.sci83
1 files changed, 83 insertions, 0 deletions
diff --git a/tests/nonRegression/bug2341.sci b/tests/nonRegression/bug2341.sci
new file mode 100644
index 0000000..cca0e0c
--- /dev/null
+++ b/tests/nonRegression/bug2341.sci
@@ -0,0 +1,83 @@
1// Non-regression test file for bug 2341
2// Copyright INRIA
3// Scilab Project - Vincent COUVERT
4
5mode(-1);
6clear;
7
8MFILE=TMPDIR+"/bug2341.m"
9SCIFILE=TMPDIR+"/bug2341.sci"
10
11correct=%T;
12
13// TEST1: no commas
14MFILECONTENTS=["function [a b c d]=bug2341";
15"a=1;b=2;c=3;d=4"]
16
17fd=mopen(MFILE,"w");
18mputl(MFILECONTENTS,fd);
19mclose(fd);
20
21ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch");
22correct=correct&ierr==0;
23
24// TEST2: commas OK without spaces
25MFILECONTENTS=["function [a,b,c,d]=bug2341";
26"a=1;b=2;c=3;d=4"]
27
28fd=mopen(MFILE,"w");
29mputl(MFILECONTENTS,fd);
30mclose(fd);
31
32ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch");
33correct=correct&ierr==0;
34
35// TEST3: commas OK with spaces before
36MFILECONTENTS=["function [a ,b ,c ,d]=bug2341";
37"a=1;b=2;c=3;d=4"]
38
39fd=mopen(MFILE,"w");
40mputl(MFILECONTENTS,fd);
41mclose(fd);
42
43ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch");
44correct=correct&ierr==0;
45
46// TEST3: commas OK with spaces after
47MFILECONTENTS=["function [a, b, c, d]=bug2341";
48"a=1;b=2;c=3;d=4"]
49
50fd=mopen(MFILE,"w");
51mputl(MFILECONTENTS,fd);
52mclose(fd);
53
54ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch");
55correct=correct&ierr==0;
56
57// TEST4: commas OK with spaces after and before
58MFILECONTENTS=["function [a , b, c ,d]=bug2341";
59"a=1;b=2;c=3;d=4"]
60
61fd=mopen(MFILE,"w");
62mputl(MFILECONTENTS,fd);
63mclose(fd);
64
65ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch");
66correct=correct&ierr==0;
67
68// TEST4: commas OK or KO
69MFILECONTENTS=["function [a b, c d]=bug2341";
70"a=1;b=2;c=3;d=4"]
71
72fd=mopen(MFILE,"w");
73mputl(MFILECONTENTS,fd);
74mclose(fd);
75
76ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch");
77correct=correct&ierr==0;
78
79affich_result(correct,2341);
80
81clear
82
83