mirror of https://github.com/swig/swig
add two Python tests
This commit is contained in:
parent
92dfc5de2e
commit
0d8ce6e031
|
@ -1,5 +1,9 @@
|
|||
%module iadd
|
||||
|
||||
#if defined(SWIGJAVASCRIPT)
|
||||
%rename(addto) operator+=;
|
||||
#endif
|
||||
|
||||
%include attribute.i
|
||||
class Foo;
|
||||
%attribute_ref(test::Foo, test::A& , AsA);
|
||||
|
|
|
@ -19,9 +19,11 @@ top_srcdir = @top_srcdir@
|
|||
top_builddir = @top_builddir@
|
||||
|
||||
CPP_TEST_CASES += \
|
||||
iadd \
|
||||
inplaceadd \
|
||||
input \
|
||||
javascript_lib_arrays \
|
||||
li_factory
|
||||
|
||||
SWIGEXE = $(top_builddir)/swig
|
||||
SWIG_LIB_DIR = $(top_srcdir)/Lib
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
var li_factory = require("li_factory");
|
||||
|
||||
circle = li_factory.Geometry.create(li_factory.Geometry.CIRCLE);
|
||||
r = circle.radius();
|
||||
if ((r != 1.5)) {
|
||||
throw new Error;
|
||||
}
|
||||
|
||||
point = li_factory.Geometry.create(li_factory.Geometry.POINT);
|
||||
w = point.width();
|
||||
if ((w != 1.0)) {
|
||||
throw new Error;
|
||||
}
|
Loading…
Reference in New Issue