diff --git a/test/Callback.cc b/test/Callback.cc index a149357..21364cd 100644 --- a/test/Callback.cc +++ b/test/Callback.cc @@ -24,6 +24,7 @@ class Callback { static double callIncrementDouble(const nbind::cbFunction &incrementDouble, double x) {return(incrementDouble.call(x));} static std::string callCatenate(nbind::cbFunction &catenate, const char *a, const char *b) {return(catenate.call(a, b));} + static std::string callCatenate2(nbind::cbFunction &catenate, const char *a, const char *b) {return(catenate.call(a, b));} static void callCStrings(nbind::cbFunction &cb) { std::string foo = "foo"; @@ -51,7 +52,10 @@ NBIND_CLASS(Callback) { method(callAddInt2); method(callIncrementDouble); + method(callCatenate); + method(callCatenate2); + method(callCStrings); } diff --git a/test/reflect.txt b/test/reflect.txt index eac7337..8be25aa 100644 --- a/test/reflect.txt +++ b/test/reflect.txt @@ -19,6 +19,7 @@ class Callback { static int32_t callAddInt2(const std::function &, int32_t, int32_t); static float64_t callIncrementDouble(const cbFunction &, float64_t); static std::string callCatenate(cbFunction &, const char *, const char *); + static std::string callCatenate2(cbFunction &, const char *, const char *); static void callCStrings(cbFunction &); }; diff --git a/test/test.ts b/test/test.ts index 77f9265..c4584fd 100644 --- a/test/test.ts +++ b/test/test.ts @@ -168,6 +168,7 @@ test('Callbacks', function(t: any) { t.strictEqual(Type.callAddInt2(function(x: number, y: number) {return(x + y);}, 40, 2), 42); t.strictEqual(Type.callIncrementDouble(function(x: number) {return(x + 0.25);}, 0.5), 0.75); t.strictEqual(Type.callCatenate(function(x: string, y: string) {return(x + y);}, 'foo', 'bar'), 'foobar'); + t.strictEqual(Type.callCatenate2(function(x: string, y: string) {return(x + y);}, 'foo', 'bar'), 'foobar'); t.throws(function() { Type.callNegate({} as any as (x: boolean) => boolean, true);