octave: Simplified module loading.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13941 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
092e2104c7
commit
e60ae2d81d
5 changed files with 141 additions and 159 deletions
|
|
@ -1,17 +1,7 @@
|
|||
# file: runme_args.m
|
||||
|
||||
# test module loading with arguments
|
||||
clear all
|
||||
|
||||
# access module, no global load
|
||||
example = example;
|
||||
assert(example.cvar.ivar == example.ifunc());
|
||||
clear all
|
||||
example = example;
|
||||
assert(example.cvar.ivar == example.ifunc());
|
||||
clear all
|
||||
|
||||
# load module globally
|
||||
# load module
|
||||
clear all;
|
||||
example;
|
||||
assert(cvar.ivar == ifunc);
|
||||
assert(exist("example","var"));
|
||||
|
|
@ -21,27 +11,8 @@ assert(cvar.ivar == ifunc);
|
|||
assert(exist("example","var"));
|
||||
clear all
|
||||
|
||||
# access module in a function, no global load
|
||||
function testme
|
||||
example = example;
|
||||
assert(example.cvar.ivar == example.ifunc());
|
||||
endfunction
|
||||
testme
|
||||
testme
|
||||
example = example;
|
||||
assert(example.cvar.ivar == example.ifunc());
|
||||
clear all
|
||||
function testme
|
||||
example = example;
|
||||
assert(example.cvar.ivar == example.ifunc());
|
||||
endfunction
|
||||
testme
|
||||
testme
|
||||
example = example;
|
||||
assert(example.cvar.ivar == example.ifunc());
|
||||
clear all
|
||||
|
||||
# load module in a function globally before base context
|
||||
clear all;
|
||||
function testme
|
||||
example;
|
||||
assert(cvar.ivar == ifunc);
|
||||
|
|
@ -66,6 +37,7 @@ assert(exist("example","var"));
|
|||
clear all
|
||||
|
||||
# load module in a function globally after base context
|
||||
clear all;
|
||||
example;
|
||||
assert(cvar.ivar == ifunc);
|
||||
assert(exist("example","var"));
|
||||
|
|
@ -95,17 +67,8 @@ if api_version < 37
|
|||
exit
|
||||
endif
|
||||
|
||||
# access module with no cvar, no global load
|
||||
example2 = example2;
|
||||
assert(example2.ivar == example2.ifunc());
|
||||
assert(!isglobal("cvar"))
|
||||
clear all
|
||||
example2 = example2;
|
||||
assert(example2.ivar == example2.ifunc());
|
||||
assert(!isglobal("cvar"))
|
||||
clear all
|
||||
|
||||
# load module with no cvar globally
|
||||
# load module with no cvar
|
||||
clear all;
|
||||
example2;
|
||||
assert(example2.ivar == ifunc);
|
||||
assert(exist("example2","var"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue