summaryrefslogtreecommitdiff
path: root/graphics/asymptote/tests/template/mapArrayTest.asy
blob: a110b0ed69b1acf6c0e73181a51eaf0a0ceb4fbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import TestLib;

StartTest("mapArray");

from mapArray(Src=real, Dst=string) access map;

real[] a = {1.0, 1.5, 2.5, -3.14};
string[] b = map(new string(real x) {return (string)x;},
                 a);

assert(all(b == new string[] {"1", "1.5", "2.5", "-3.14"}));

EndTest();