1#unittest { 2 name: "List map."; 3 result: true; 4}; 5 6func main() { 7 var list = [0, 1, 2, 3, 4, 5] 8 func x(a) { 9 return a % 2 10 } 11 if (list.map(x).String() != "[0,1,0,1,0,1]") { 12 return false 13 } 14 var list2 = ["this", "is", "a", "test"] 15 func y(a) { 16 return a.length 17 } 18 if (list2.map(y).String() != "[4,2,1,4]") { 19 return false 20 } 21 return true 22}