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
18 file_path = SCI + "/modules/console/tests/nonreg_tests/";
19 mkdir(TMPDIR + "/console");
20 cd(TMPDIR + "/console");
23 ilib_name = "console_c";
24 files = "bug_13226.c";
26 for i = 1 : size(files, "*")
27 copyfile(file_path + "/" + files(i), TMPDIR + "/console");
30 if isdir(SCI+"/modules/console/includes") then
31 // Unix source version
32 libs = SCI + "/modules/console/.libs/libsciconsole";
33 cflags = "-I " + SCI +"/modules/console/includes -I " + SCI + "/modules/localization/includes";
36 // Unix binary version
37 SCI_LIB = strsubst(SCI,"/share\/scilab$/","lib/scilab" ,"r");
38 SCI_INCLUDE = strsubst(SCI,"/share\/scilab$/","include/scilab" ,"r");
39 libs = SCI_LIB + "/libsciconsole";
40 cflags = "-I " + SCI_INCLUDE;
43 // name known in scilab , C function called
44 table = ["completecommandline" ,"sci_completecommandline"];
45 libname = ilib_build(ilib_name,table,files,libs,[],"",cflags);
57 ierr = exec(TMPDIR + "/console/loader.sce", "errcatch", -1);
59 createdir(TMPDIR+"/Téléchargements");
60 mputl("",TMPDIR+"/Téléchargements/foo.bar");
63 [r,c] = completecommandline("atomsInstall(""./Téléchargements/f",33);
64 assert_checkequal(r,"atomsInstall(""./Téléchargements/foo.bar");
65 assert_checkequal(c,39);