Added _forEach and _map, added tests for them

This commit is contained in:
2023-02-06 00:51:07 +00:00
parent c0ec5ef28e
commit c875ae7a0e
6 changed files with 358 additions and 15 deletions

View File

@@ -0,0 +1,40 @@
//test this logic for memory leaks
{
import compound;
import timer;
fn start(k, v) {
return startTimer();
}
fn check(k, v) {
var l = v.stopTimer();
print l.timerToString();
l.destroyTimer();
return v;
}
fn destroy(k, v) {
v.destroyTimer();
}
var arr = [1];
arr
.map(start)
.map(check)
.map(check)
.map(check)
.map(check)
.map(check)
.map(check)
.map(check)
.map(check)
.map(check)
.map(check)
.map(destroy)
;
}
print "All good";