diff options
Diffstat (limited to 'graphics/asymptote/tests/template/functionTest.asy')
-rw-r--r-- | graphics/asymptote/tests/template/functionTest.asy | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/graphics/asymptote/tests/template/functionTest.asy b/graphics/asymptote/tests/template/functionTest.asy new file mode 100644 index 0000000000..770322b2c1 --- /dev/null +++ b/graphics/asymptote/tests/template/functionTest.asy @@ -0,0 +1,20 @@ +import TestLib; + +typedef real F1(string); +typedef string F2(int); + +real f1(string s) { + return length(s); +} + +F2 f2 = operator ecast; + +StartTest("Function type parameters"); + +from 'template/imports/composeFunctions'(R=real, F1=F1, F2=F2, I=int) access + compose; + +real r = compose(f1, f2)(1234567890); +assert(r == 10); + +EndTest();
\ No newline at end of file |