Add future support, and fix returning of r-values
This commit is contained in:
17
unittests/future.chai
Normal file
17
unittests/future.chai
Normal file
@@ -0,0 +1,17 @@
|
||||
var func = fun(){
|
||||
var ret = 0;
|
||||
for (var i = 0; i < 1000000; ++i) {
|
||||
ret += i;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
var fut1 := async(func);
|
||||
var fut2 := async(func);
|
||||
var fut3 := async(func);
|
||||
var fut4 := async(func);
|
||||
|
||||
// simply executing without crashing is good enough for this test
|
||||
|
||||
print(" ${fut1.get()} ${fut2.get()} ${fut3.get()} ${fut4.get()}")
|
||||
Reference in New Issue
Block a user