nadako / haxe-coroutines

41 stars 5 forks source link

Test cases for yield and async/await #6

Open RealyUniqueName opened 6 years ago

RealyUniqueName commented 6 years ago

In our implementation we mimic C# approach, so there are some Task api calls in these tests which should be replaced as you adopt them to you syntax.

nadako commented 6 years ago

Awesome, thanks a lot!

Simn commented 6 months ago

I'm currently looking into adding (some of these) tests. Using the yield implementation from our misc tests makes quite a few things work already. Some observations:

        var generator = basicYieldReturn();
        assert([10, 20], generator);
        assert([10, 20], generator);

I'm not sure what the semantics are supposed to be here.

Simn commented 6 months ago

Ok so it seems like @:yield break is actually just supposed to be return. As in actual return, not yield-return. I replaced all occurrences and the tests pass.

Other than the aforementioned multiple-iterations failure (and some disabled tests that relied on __ctx__ from the original build macro), the only other failures are related to exceptions and will probably be solved when we figure out what I talk about here.

kLabz commented 6 months ago

What is hxasync uh.. library? used here? There's a lib called hxasync nowadays but it seems very unrelated and was created years after this PR.