summaryrefslogtreecommitdiffstats
path: root/scilab/modules
diff options
context:
space:
mode:
authorAllan CORNET <allan.cornet@scilab.org>2010-05-17 10:06:43 +0200
committerAllan CORNET <allan.cornet@scilab.org>2010-05-18 10:45:28 +0200
commit7d0334b9cc1c9755a549630192f0171ecf6aba28 (patch)
treebd5604dacafb183a8b76a26ac2c484bcbb137025 /scilab/modules
parent88b9103bc068187257412b450a56c677aacd9adc (diff)
downloadscilab-7d0334b9cc1c9755a549630192f0171ecf6aba28.zip
scilab-7d0334b9cc1c9755a549630192f0171ecf6aba28.tar.gz
bug 7123 no completion was possible if the name of variable is preceded by ~ or @ or < or >
Change-Id: Ibd5eac2183875ff276869d4217a61067108a89ed
Diffstat (limited to 'scilab/modules')
-rw-r--r--scilab/modules/completion/src/c/getPartLine.c4
-rw-r--r--scilab/modules/completion/tests/nonreg_tests/bug_7123.dia.ref44
-rw-r--r--scilab/modules/completion/tests/nonreg_tests/bug_7123.tst56
3 files changed, 102 insertions, 2 deletions
diff --git a/scilab/modules/completion/src/c/getPartLine.c b/scilab/modules/completion/src/c/getPartLine.c
index dc1232e..5d359a4 100644
--- a/scilab/modules/completion/src/c/getPartLine.c
+++ b/scilab/modules/completion/src/c/getPartLine.c
@@ -19,8 +19,8 @@
19/*--------------------------------------------------------------------------*/ 19/*--------------------------------------------------------------------------*/
20char *getPartLevel(char *line) 20char *getPartLevel(char *line)
21{ 21{
22 #define MAX_SYMBS 23 22 #define MAX_SYMBS 28
23 const char symbs[MAX_SYMBS] = "+-*/\\([ ^,;={.&|\'])}:\"\'"; 23 const char symbs[MAX_SYMBS] = "+-*/\\([ ^,;={.&|\'])}:\"\'><~@\t";
24 int index = -1; 24 int index = -1;
25 int i = 0; 25 int i = 0;
26 26
diff --git a/scilab/modules/completion/tests/nonreg_tests/bug_7123.dia.ref b/scilab/modules/completion/tests/nonreg_tests/bug_7123.dia.ref
new file mode 100644
index 0000000..e1d3a30
--- /dev/null
+++ b/scilab/modules/completion/tests/nonreg_tests/bug_7123.dia.ref
@@ -0,0 +1,44 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2010 - DIGITEO - Allan CORNET
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7//
8// <-- JVM NOT MANDATORY -->
9//
10// <-- Non-regression test for bug 7123 -->
11//
12// <-- Bugzilla URL -->
13// http://bugzilla.scilab.org/show_bug.cgi?id=7123
14//
15// <-- Short Description -->
16// No completion was possible if the name of a variable is preceded by ~ or @ or < or >
17//
18ilib_verbose(0);
19ierr = exec(SCI+"/modules/completion/tests/utilities/build_primitives.sce","errcatch",-1);
20if ierr <> 0 then bugmes();quit;end
21ierr = exec(SCI+"/modules/completion/tests/utilities/loader.sce","errcatch",-1);
22if ierr <> 0 then bugmes();quit;end
23blahblah = %t;
24ref = 'blahbl';
25r = getpartlevel('if ~blahbl');
26if r <> ref then bugmes();quit;end;
27r = getpartlevel('if @blahbl');
28if r <> ref then bugmes();quit;end;
29r = getpartlevel('if %t==blahbl');
30if r <> ref then bugmes();quit;end;
31r = getpartlevel('if %t == blahbl');
32if r <> ref then bugmes();quit;end;
33blahblah = 3;
34r = getpartlevel('if 2>blahbl');
35if r <> ref then bugmes();quit;end;
36r = getpartlevel('if 2 > blahbl');
37if r <> ref then bugmes();quit;end;
38r = getpartlevel('if 2<blahbl');
39if r <> ref then bugmes();quit;end;
40r = getpartlevel('if 2 < blahbl');
41if r <> ref then bugmes();quit;end;
42// tabulation used in editor not in console
43r = getpartlevel(ascii(9) + 'blahbl');
44if r <> ref then bugmes();quit;end;
diff --git a/scilab/modules/completion/tests/nonreg_tests/bug_7123.tst b/scilab/modules/completion/tests/nonreg_tests/bug_7123.tst
new file mode 100644
index 0000000..d84b7e5
--- /dev/null
+++ b/scilab/modules/completion/tests/nonreg_tests/bug_7123.tst
@@ -0,0 +1,56 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2010 - DIGITEO - Allan CORNET
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7//
8// <-- JVM NOT MANDATORY -->
9//
10// <-- Non-regression test for bug 7123 -->
11//
12// <-- Bugzilla URL -->
13// http://bugzilla.scilab.org/show_bug.cgi?id=7123
14//
15// <-- Short Description -->
16// No completion was possible if the name of a variable is preceded by ~ or @ or < or >
17//
18
19ilib_verbose(0);
20ierr = exec(SCI+"/modules/completion/tests/utilities/build_primitives.sce","errcatch",-1);
21if ierr <> 0 then pause, end
22ierr = exec(SCI+"/modules/completion/tests/utilities/loader.sce","errcatch",-1);
23if ierr <> 0 then pause, end
24
25blahblah = %t;
26ref = 'blahbl';
27
28r = getpartlevel('if ~blahbl');
29if r <> ref then pause, end;
30
31r = getpartlevel('if @blahbl');
32if r <> ref then pause, end;
33
34r = getpartlevel('if %t==blahbl');
35if r <> ref then pause, end;
36
37r = getpartlevel('if %t == blahbl');
38if r <> ref then pause, end;
39
40blahblah = 3;
41
42r = getpartlevel('if 2>blahbl');
43if r <> ref then pause, end;
44
45r = getpartlevel('if 2 > blahbl');
46if r <> ref then pause,end;
47
48r = getpartlevel('if 2<blahbl');
49if r <> ref then pause,end;
50
51r = getpartlevel('if 2 < blahbl');
52if r <> ref then pause,end;
53
54// tabulation used in editor not in console
55r = getpartlevel(ascii(9) + 'blahbl');
56if r <> ref then pause,end;