My favorites | Sign in
Project Hosting will be READ-ONLY Thursday at 3:00pm UTC for up to 3 hours for network maintenance.
Project Home Downloads Wiki Issues Source
Search
for
AsyncTest  
Small sample for an asynchronous test
Featured, Phase-Implementation
Updated Jan 1, 2010 by franco.p...@gmail.com

Introduction

Async tests are very easy to implement with utest. Create a delegate using Assert.createAsync, than dispatch it on a timer or timed event.

Details

import utest.Assert;
import utest.Runner;
import utest.ui.Report;

class Test {
    public static function main() {
        var runner = new Runner();
        runner.addCase(new Test());
        Report.create(runner);
        runner.run();
    }
	
    public function new();
	
    public function testAsync() {
        var async = Assert.createAsync(function() Assert.isTrue(true));
        haxe.Timer.delay(async, 50);
    }
}

Compile using the same build file used in Basic Tutorial.


Sign in to add a comment
Powered by Google Project Hosting