1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2014 - Scilab Enterprises - Calixte DENIZET
5 // This file is distributed under the same license as the Scilab package.
6 // =============================================================================
9 // <-- Non-regression test for bug 13226 -->
11 // <-- Bugzilla URL -->
12 // http://bugzilla.scilab.org/13226
14 // <-- Short Description -->
15 // Completion with accentued chars could lead to a a crash
17 file_path = SCI + "/modules/console/tests/nonreg_tests/";
18 mkdir(TMPDIR + "/console");
19 cd(TMPDIR + "/console");
22 ilib_name = "console_c";
23 files = "bug_13226.c";
25 for i = 1 : size(files, "*")
26 copyfile(file_path + "/" + files(i), TMPDIR + "/console");
29 if getos() == "Windows" then
30 libs = SCI + "/bin/sciconsole";
31 cflags = "-I " + SCI +"/modules/console/includes";
33 elseif isdir(SCI+"/modules/console/includes")
34 // Unix source version
35 libs = SCI + "/modules/console/.libs/libsciconsole";
36 cflags = "-I " + SCI +"/modules/console/includes -I " + SCI + "/modules/localization/includes";
39 // Unix binary version
40 SCI_LIB = strsubst(SCI,"/share\/scilab$/","lib/scilab" ,"r");
41 SCI_INCLUDE = strsubst(SCI,"/share\/scilab$/","include/scilab" ,"r");
42 libs = SCI_LIB + "/libsciconsole";
43 cflags = "-I " + SCI_INCLUDE
46 // name known in scilab , C function called
47 table = ["completecommandline" ,"sci_completecommandline"];
48 libname = ilib_build(ilib_name,table,files,libs,[],"",cflags);
60 ierr = exec(TMPDIR + "/console/loader.sce", "errcatch", -1);
62 createdir(TMPDIR+"/Téléchargements");
63 mputl("",TMPDIR+"/Téléchargements/foo.bar");
66 [r,c] = completecommandline("atomsInstall(""./Téléchargements/f",33);
67 assert_checkequal(r,"atomsInstall(""./Téléchargements/foo.bar");
68 assert_checkequal(c,39);