Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test cases for yield and async/await #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RealyUniqueName
Copy link

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
Copy link
Owner

nadako commented Sep 18, 2017

Awesome, thanks a lot!

@Simn
Copy link

Simn commented Feb 15, 2024

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:

  • The tests expect Iterable while our yield is Iterator. I find the latter more intuitive for because generators are not really data structures, which is what I associate with Iterable.

  • However, this test currently doesn't work:

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

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

  • I don't know what @:yield break; is.

Simn added a commit to HaxeFoundation/haxe that referenced this pull request Feb 15, 2024
@Simn
Copy link

Simn commented Feb 15, 2024

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
Copy link

kLabz commented Feb 16, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants