summaryrefslogtreecommitdiffstats
path: root/tests/nonRegression/bug1107.sci
blob: a1b359341a24a6bf5e611b1b526aac3eb6714744 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// <-- Non-regression test for bug 1107 -->
//
// <-- Bugzilla URL -->
// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1107
//
// <-- Short Description -->
//    wrong use of = not detected in if conditions


// bug1107
//the bug was due to a misinterpretation of syntax like (x=2) in
//factor. It was treated as a named argument of a function instead of a
//factor equivalent to (x==2)
mode (-1)
clear
x=5; if (x = 4) then x=6;end
ok=x==5
ok=ok&execstr('x=5;z=2*(x=4)',"errcatch","n")==0&z==0
ok=ok&execstr('x=5;z=2*(x-1=4)',"errcatch","n")==0&z==2
affich_result(ok, 1107)
clear