summaryrefslogtreecommitdiff
path: root/graphics/asymptote/tests/template/functionTest.asy
blob: 770322b2c11f50d40c42825759116ba45ce6fcae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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();