summaryrefslogtreecommitdiffstats
path: root/scilab/modules/data_structures/tests/nonreg_tests/bug_6792.tst
blob: 5f01e5d3175eee9a8c8ad9271675209efcedca8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2010 - INRIA -Serge.Steer@inria.fr
//
//  This file is distributed under the same license as the Scilab package.
// =============================================================================

// <-- Non-regression test for bug 6792 -->
//
// <-- Bugzilla URL -->
// http://bugzilla.scilab.org/show_bug.cgi?id=6792
//
// <-- Short Description -->
// mis-interpretation of macro arguments when the macro call  appears in an list extraction
function [x,y]=fun(varargin), x=varargin,y=size(varargin),endfunction
function y=%foo_e(name,ml),y=fun,endfunction

M=mlist(['foo']);
M1=mlist(['foo','meth'],fun);

[x,y]=M.meth(['hello' 'world']);
if or(x<>list(['hello' 'world']))|y<>1 then pause,end
[x,y]=M1.meth(['hello' 'world']);
if or(x<>list(['hello' 'world']))|y<>1 then pause,end

[x,y]=M.meth('xx',list(1,2,3));
if or(x<>list('xx',list(1,2,3)))|y<>2 then pause,end

[x,y]=M1.meth('xx',list(1,2,3));
if or(x<>list('xx',list(1,2,3)))|y<>2 then pause,end

[x,y]=M.meth('xx',1,2,3);
if or(x<>list('xx',1,2,3))|y<>4 then pause,end

[x,y]=M1.meth('xx',1,2,3);
if or(x<>list('xx',1,2,3))|y<>4 then pause,end