Minor modifications in tests: 19/16719/2
Vincent COUVERT [Mon, 22 Jun 2015 08:19:09 +0000 (10:19 +0200)]
 - parser differences between 5/6 versions
 - minor differences on macr2tree output
Tests:
test_run m2sci bug_1003
test_run m2sci bug_1004
test_run m2sci bug_1082
test_run m2sci bug_1123
test_run m2sci bug_1636
test_run m2sci bug_800
test_run m2sci bug_924

Change-Id: I0e57954d855272080c43bf093c5aa716a16e6eee

13 files changed:
scilab/modules/m2sci/macros/kernel/sciparam.sci
scilab/modules/m2sci/tests/nonreg_tests/bug_1003.dia.ref
scilab/modules/m2sci/tests/nonreg_tests/bug_1003.tst
scilab/modules/m2sci/tests/nonreg_tests/bug_1004.tst
scilab/modules/m2sci/tests/nonreg_tests/bug_1082.tst
scilab/modules/m2sci/tests/nonreg_tests/bug_1123.dia.ref
scilab/modules/m2sci/tests/nonreg_tests/bug_1123.tst
scilab/modules/m2sci/tests/nonreg_tests/bug_1636.dia.ref
scilab/modules/m2sci/tests/nonreg_tests/bug_1636.tst
scilab/modules/m2sci/tests/nonreg_tests/bug_800.dia.ref
scilab/modules/m2sci/tests/nonreg_tests/bug_800.tst
scilab/modules/m2sci/tests/nonreg_tests/bug_924.dia.ref
scilab/modules/m2sci/tests/nonreg_tests/bug_924.tst

index 4c42037..63a0efb 100644 (file)
@@ -37,7 +37,7 @@ function sciparam()
     ">"       , "log" ;
     "<="      , "log" ;
     ">="      , "log" ;
-    "~="      , "log" ;
+    "<>"      , "log" ;
     ":"       , "imp" ;
     "rc"      , "rc"  ;
     "ins"     , "i"   ;
index 1ec9f43..5e3993b 100644 (file)
@@ -45,32 +45,7 @@ MFILECONTENTS=["% Test with fgets result stored in a variable";
 "% Test with fgets result not-stored in a variable";
 "fp = fopen(''testfile.txt'',''r'');";
 "disp(fgets(fp)); % -1 if eof";
-"fclose(fp);"]
- MFILECONTENTS  =
-!% Test with fgets result stored in a variable      !
-!                                                   !
-!fp = fopen('testfile.txt','r');                    !
-!                                                   !
-!tempstr = ' ';                                     !
-!                                                   !
-!while ( tempstr ~= -1)                             !
-!                                                   !
-!  tempstr = fgets(fp); % -1 if eof                 !
-!                                                   !
-!  disp(tempstr);                                   !
-!                                                   !
-!end                                                !
-!                                                   !
-!fclose(fp);                                        !
-!                                                   !
-!% Test with fgets result not-stored in a variable  !
-!                                                   !
-!fp = fopen('testfile.txt','r');                    !
-!                                                   !
-!disp(fgets(fp)); % -1 if eof                       !
-!                                                   !
-!fclose(fp);                                        !
+"fclose(fp);"];
 MFILE=TMPDIR+"/bug1003.m";
 SCIFILE=TMPDIR+"/bug1003.sci";
 mputl(MFILECONTENTS,MFILE);
@@ -102,7 +77,7 @@ SCIFILECONTENTSREF=["";
 "// Test with fgets result stored in a variable";
 "fp = mtlb_fopen(""testfile.txt"",""r"");";
 "tempstr = "" "";";
-"while tempstr~=(-1)";
+"while tempstr<>-1";
 "  tempstr = mgetl(fp,1);  if isempty(tempstr) then tempstr = -1;end;  // -1 if eof";
 "  disp(tempstr);";
 "end;";
index 8578f75..47b6102 100644 (file)
@@ -48,7 +48,7 @@ MFILECONTENTS=["% Test with fgets result stored in a variable";
 "% Test with fgets result not-stored in a variable";
 "fp = fopen(''testfile.txt'',''r'');";
 "disp(fgets(fp)); % -1 if eof";
-"fclose(fp);"]
+"fclose(fp);"];
 
 MFILE=TMPDIR+"/bug1003.m";
 SCIFILE=TMPDIR+"/bug1003.sci";
@@ -67,7 +67,7 @@ SCIFILECONTENTSREF=["";
 "// Test with fgets result stored in a variable";
 "fp = mtlb_fopen(""testfile.txt"",""r"");";
 "tempstr = "" "";";
-"while tempstr~=(-1)";
+"while tempstr<>-1";
 "  tempstr = mgetl(fp,1);  if isempty(tempstr) then tempstr = -1;end;  // -1 if eof";
 "  disp(tempstr);";
 "end;";
index 4c27be6..1680cd1 100644 (file)
@@ -50,13 +50,14 @@ mfile2sci(MFILE,TMPDIR);
 SCIFILECONTENTS=mgetl(SCIFILE);
 
 SCIFILECONTENTSREF=["";
-        "// Display mode";
-        "mode(0);";
-        "";
-        "// Display warning for floating point exception";
-        "ieee(1);";
-        "";
-        "for i = 1:5";
-        "end;"]
+"// Display mode";
+"mode(0);";
+"";
+"// Display warning for floating point exception";
+"ieee(1);";
+"";
+"for i = 1:5";
+"";
+"end;"]
 
 if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then pause,end
index 11587a9..4445433 100644 (file)
@@ -18,9 +18,9 @@
 //    syntax is the same in both languages, the converter fails to
 //    convert the rounding of the field of a structure: "round(a.b)"
 
-MFILECONTENTS=["structure.field = 2;" 
+MFILECONTENTS=["structure.field = 2;"
 ""
-"data = round(structure.field);"]
+"data = round(structure.field);"];
 
 MFILE=TMPDIR+"/bug1082.m";
 SCIFILE=TMPDIR+"/bug1082.sci";
index de8290b..a005826 100644 (file)
@@ -47,22 +47,7 @@ SCIFILECONTENTSREF=["";
 "// Display warning for floating point exception";
 "ieee(1);";
 "";
-"if %t then t = 1;end;"]
- SCIFILECONTENTSREF  =
-!                                                 !
-!                                                 !
-!// Display mode                                  !
-!                                                 !
-!mode(0);                                         !
-!                                                 !
-!                                                 !
-!                                                 !
-!// Display warning for floating point exception  !
-!                                                 !
-!ieee(1);                                         !
-!                                                 !
-!                                                 !
-!                                                 !
-!if %t then t = 1;end;                            !
+"if %t then"; 
+"  t = 1;"
+"end;"];
 if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then bugmes();quit;end
index 4f7bafa..281543f 100644 (file)
@@ -36,6 +36,8 @@ SCIFILECONTENTSREF=["";
 "// Display warning for floating point exception";
 "ieee(1);";
 "";
-"if %t then t = 1;end;"]
+"if %t then";
+"  t = 1;"
+"end;"];
 
 if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then pause,end
index 01118e8..612956b 100644 (file)
@@ -1,43 +1,32 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2005 - INRIA - Farid BELAHCENE
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// <-- ENGLISH IMPOSED -->
 // <-- Non-regression test for bug 1636 -->
 //
 // <-- Bugzilla URL -->
 // http://bugzilla.scilab.org/show_bug.cgi?id=1636
 //
 // <-- Short Description -->
-//    When processing an m-file with multiple continuation lines in the
-//    initial function statement, i.e the first line, I received an index
-//    error in  line 181 of m2sci_syntax. On investigation, I found the index
-//    k was zero and traced this to lines 141 and 171 which set k=k-1 after
-//    appending line k to line k-1. I have produced a modified
-//    m2sci_syntax.sci file with the line if k<> 1 then k=k-1; end instead of
-//    k=k-1 for lines 141 and 181 which seems to work OK. No errors and
+//    When processing an m-file with multiple continuation lines in the 
+//    initial function statement, i.e the first line, I received an index 
+//    error in  line 181 of m2sci_syntax. On investigation, I found the index 
+//    k was zero and traced this to lines 141 and 171 which set k=k-1 after 
+//    appending line k to line k-1. I have produced a modified 
+//    m2sci_syntax.sci file with the line if k<> 1 then k=k-1; end instead of 
+//    k=k-1 for lines 141 and 181 which seems to work OK. No errors and 
 //    produces an sci file
-// Copyright INRIA
-// Scilab Project - F. Belahcene
 MFILECONTENTS=["function A = bug1636(x,y,...";
-               "z,t,...";
-               "u,v,w,...";
-               "z)";
-               "a=x+y+z+t+u+v+w+z;"]
- MFILECONTENTS  =
-!function A = bug1636(x,y,...  !
-!                              !
-!z,t,...                       !
-!                              !
-!u,v,w,...                     !
-!                              !
-!z)                            !
-!                              !
-!a=x+y+z+t+u+v+w+z;            !
-MFILE=TMPDIR+"/bug1636.m"
- MFILE  =
- TMPDIR/bug1636.m   
-SCIFILE=TMPDIR+"/bug1636.sci"
- SCIFILE  =
- TMPDIR/bug1636.sci   
+"z,t,...";
+"u,v,w,...";
+"z)";
+"a=x+y+z+t+u+v+w+z;"];
+MFILE=TMPDIR+"/bug1636.m";
+SCIFILE=TMPDIR+"/bug1636.sci";
 mputl(MFILECONTENTS,MFILE);
 mfile2sci(MFILE,TMPDIR,%f,%t);
   ****** Beginning of mfile2sci() session ******
@@ -58,54 +47,16 @@ mfile2sci(MFILE,TMPDIR,%f,%t);
   ****** End of mfile2sci() session ******
 SCIFILECONTENTS=mgetl(SCIFILE);
 SCIFILECONTENTSREF=["function [A] = bug1636(x,y,z,t,u,v,w,z)";
-               "";
-               "// Output variables initialisation (not found in input variables)"
-               "A=[];";
-               "";
-               "// Display mode";
-               "mode(0);"
-               "";
-               "// Display warning for floating point exception";
-               "ieee(1);";
-               "";
-               "";
-               "";
-               "";
-               "a = mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(x,y),z),t),u),v),w),z);"
-               "endfunction"]
- SCIFILECONTENTSREF  =
-!function [A] = bug1636(x,y,z,t,u,v,w,z)                               !
-!                                                                      !
-!                                                                      !
-!                                                                      !
-!// Output variables initialisation (not found in input variables)     !
-!                                                                      !
-!A=[];                                                                 !
-!                                                                      !
-!                                                                      !
-!                                                                      !
-!// Display mode                                                       !
-!                                                                      !
-!mode(0);                                                              !
-!                                                                      !
-!                                                                      !
-!                                                                      !
-!// Display warning for floating point exception                       !
-!                                                                      !
-!ieee(1);                                                              !
-!                                                                      !
-!                                                                      !
-!                                                                      !
-!                                                                      !
-!                                                                      !
-!                                                                      !
-!                                                                      !
-!                                                                      !
-!                                                                      !
-!a = mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(x,y),z),t),u),v),!
-!     w),z);                                                           !
-!                                                                      !
-!endfunction                                                           !
-               
+"";
+"// Output variables initialisation (not found in input variables)"
+"A=[];";
+"";
+"// Display mode";
+"mode(0);"
+"";
+"// Display warning for floating point exception";
+"ieee(1);";
+"";
+"a = mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(x,y),z),t),u),v),w),z);"
+"endfunction"];
 if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then bugmes();quit;end
index e6a1dbd..2de3a68 100644 (file)
 // http://bugzilla.scilab.org/show_bug.cgi?id=1636
 //
 // <-- Short Description -->
-//    When processing an m-file with multiple continuation lines in the 
-//    initial function statement, i.e the first line, I received an index 
-//    error in  line 181 of m2sci_syntax. On investigation, I found the index 
-//    k was zero and traced this to lines 141 and 171 which set k=k-1 after 
-//    appending line k to line k-1. I have produced a modified 
-//    m2sci_syntax.sci file with the line if k<> 1 then k=k-1; end instead of 
-//    k=k-1 for lines 141 and 181 which seems to work OK. No errors and 
+//    When processing an m-file with multiple continuation lines in the
+//    initial function statement, i.e the first line, I received an index
+//    error in  line 181 of m2sci_syntax. On investigation, I found the index
+//    k was zero and traced this to lines 141 and 171 which set k=k-1 after
+//    appending line k to line k-1. I have produced a modified
+//    m2sci_syntax.sci file with the line if k<> 1 then k=k-1; end instead of
+//    k=k-1 for lines 141 and 181 which seems to work OK. No errors and
 //    produces an sci file
 
 MFILECONTENTS=["function A = bug1636(x,y,...";
-               "z,t,...";
-               "u,v,w,...";
-               "z)";
-               "a=x+y+z+t+u+v+w+z;"]
+"z,t,...";
+"u,v,w,...";
+"z)";
+"a=x+y+z+t+u+v+w+z;"];
 
-MFILE=TMPDIR+"/bug1636.m"
-SCIFILE=TMPDIR+"/bug1636.sci"
+MFILE=TMPDIR+"/bug1636.m";
+SCIFILE=TMPDIR+"/bug1636.sci";
 
 mputl(MFILECONTENTS,MFILE);
 mfile2sci(MFILE,TMPDIR,%f,%t);
 SCIFILECONTENTS=mgetl(SCIFILE);
 
 SCIFILECONTENTSREF=["function [A] = bug1636(x,y,z,t,u,v,w,z)";
-               "";
-               "// Output variables initialisation (not found in input variables)"
-               "A=[];";
-               "";
-               "// Display mode";
-               "mode(0);"
-               "";
-               "// Display warning for floating point exception";
-               "ieee(1);";
-               "";
-               "";
-               "";
-               "";
-               "a = mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(x,y),z),t),u),v),w),z);"
-               "endfunction"]
+"";
+"// Output variables initialisation (not found in input variables)"
+"A=[];";
+"";
+"// Display mode";
+"mode(0);"
+"";
+"// Display warning for floating point exception";
+"ieee(1);";
+"";
+"a = mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(x,y),z),t),u),v),w),z);"
+"endfunction"];
 
-               
 if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then pause,end
index 051effb..3f78304 100644 (file)
@@ -40,16 +40,16 @@ mfile2sci(MFILE,TMPDIR);
   ****** End of mfile2sci() session ******
 SCIFILECONTENTS=mgetl(SCIFILE);
 SCIFILECONTENTSREF=["";
-               "// Display mode";
-               "mode(0);";
-               "";
-               "// Display warning for floating point exception";
-               "ieee(1);";
-               "";
-               "a = 1/(-2);";
-               "b = 1/(-23);";
-               "c = 1/(-25);";
-               "d = 1/(-c);";
-               "e = 1/(-36);x = 1/(-2)";
-               "f = 1/(-36);"];
+"// Display mode";
+"mode(0);";
+"";
+"// Display warning for floating point exception";
+"ieee(1);";
+"";
+"a = 1/-2;";
+"b = 1/-23;";
+"c = 1/-25;";
+"d = 1/(-c);";
+"e = 1/-36;x = 1/-2";
+"f = 1/-36;"];
 if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then bugmes();quit;end
index 246b48f..aaea242 100644 (file)
@@ -30,17 +30,17 @@ mfile2sci(MFILE,TMPDIR);
 SCIFILECONTENTS=mgetl(SCIFILE);
 
 SCIFILECONTENTSREF=["";
-               "// Display mode";
-               "mode(0);";
-               "";
-               "// Display warning for floating point exception";
-               "ieee(1);";
-               "";
-               "a = 1/(-2);";
-               "b = 1/(-23);";
-               "c = 1/(-25);";
-               "d = 1/(-c);";
-               "e = 1/(-36);x = 1/(-2)";
-               "f = 1/(-36);"];
+"// Display mode";
+"mode(0);";
+"";
+"// Display warning for floating point exception";
+"ieee(1);";
+"";
+"a = 1/-2;";
+"b = 1/-23;";
+"c = 1/-25;";
+"d = 1/(-c);";
+"e = 1/-36;x = 1/-2";
+"f = 1/-36;"];
 
 if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then pause,end
index 47f70c4..917538e 100644 (file)
 //    disp(a)
 //    but it is not....
 MFILECONTENTS=["function bug924";
-               "a=''milou'';";
-               "a=''milou'',";
-               "a=''milou''";
-               "a;";
-               "a,";
-               "a";
-               "[c,d]=svd(1);";
-               "[c,d]=svd(1),";
-               "[c,d]=svd(1)";
-               "b=a;";
-               "b=a,";
-               "b=a"];
+"a=''milou'';";
+"a=''milou'',";
+"a=''milou''";
+"a;";
+"a,";
+"a";
+"[c,d]=svd(1);";
+"[c,d]=svd(1),";
+"[c,d]=svd(1)";
+"b=a;";
+"b=a,";
+"b=a"];
 MFILE=TMPDIR+"/bug924.m";
 SCIFILE=TMPDIR+"/bug924.sci";
 mputl(MFILECONTENTS,MFILE);
@@ -58,24 +58,24 @@ mfile2sci(MFILE,TMPDIR);
   ****** End of mfile2sci() session ******
 SCIFILECONTENTS=mgetl(SCIFILE);
 SCIFILECONTENTSREF=["function [] = bug924()";
-               "";
-               "// Display mode";
-               "mode(0);";
-               "";
-               "// Display warning for floating point exception";
-               "ieee(1);";
-               "";
-               "a = ""milou"";";
-               "a = ""milou"",";
-               "a = ""milou""";
-               "a;";
-               "a,";
-               "a";
-               "[c,d] = svd(1);";
-               "[c,d] = svd(1),";
-               "[c,d] = svd(1)";
-               "b = a;";
-               "b = a,";
-               "b = a";
-               "endfunction"];
+"";
+"// Display mode";
+"mode(0);";
+"";
+"// Display warning for floating point exception";
+"ieee(1);";
+"";
+"a = ""milou"";";
+"a = ""milou""";
+"a = ""milou""";
+"a;";
+"a";
+"a";
+"[c,d] = svd(1);";
+"[c,d] = svd(1)";
+"[c,d] = svd(1)";
+"b = a;";
+"b = a";
+"b = a";
+"endfunction"];
 if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then bugmes();quit;end
index 6f382a1..1a28247 100644 (file)
 //    but it is not....
 
 MFILECONTENTS=["function bug924";
-               "a=''milou'';";
-               "a=''milou'',";
-               "a=''milou''";
-               "a;";
-               "a,";
-               "a";
-               "[c,d]=svd(1);";
-               "[c,d]=svd(1),";
-               "[c,d]=svd(1)";
-               "b=a;";
-               "b=a,";
-               "b=a"];
+"a=''milou'';";
+"a=''milou'',";
+"a=''milou''";
+"a;";
+"a,";
+"a";
+"[c,d]=svd(1);";
+"[c,d]=svd(1),";
+"[c,d]=svd(1)";
+"b=a;";
+"b=a,";
+"b=a"];
 
 MFILE=TMPDIR+"/bug924.m";
 SCIFILE=TMPDIR+"/bug924.sci";
@@ -48,25 +48,25 @@ mfile2sci(MFILE,TMPDIR);
 SCIFILECONTENTS=mgetl(SCIFILE);
 
 SCIFILECONTENTSREF=["function [] = bug924()";
-               "";
-               "// Display mode";
-               "mode(0);";
-               "";
-               "// Display warning for floating point exception";
-               "ieee(1);";
-               "";
-               "a = ""milou"";";
-               "a = ""milou"",";
-               "a = ""milou""";
-               "a;";
-               "a,";
-               "a";
-               "[c,d] = svd(1);";
-               "[c,d] = svd(1),";
-               "[c,d] = svd(1)";
-               "b = a;";
-               "b = a,";
-               "b = a";
-               "endfunction"];
+"";
+"// Display mode";
+"mode(0);";
+"";
+"// Display warning for floating point exception";
+"ieee(1);";
+"";
+"a = ""milou"";";
+"a = ""milou""";
+"a = ""milou""";
+"a;";
+"a";
+"a";
+"[c,d] = svd(1);";
+"[c,d] = svd(1)";
+"[c,d] = svd(1)";
+"b = a;";
+"b = a";
+"b = a";
+"endfunction"];
 
 if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then pause,end