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

chore(gnolang): add challenges #765

Merged
merged 1 commit into from
Apr 20, 2023
Merged

Conversation

tbruyelle
Copy link
Contributor

If you manage to solve one of these challenges by updating the gnovm code, move those files into the gnovm/test/files folder (eventually increment the number suffix in the name according to existing files).

- Add 2 challenges for map and slice literals, as described in gnolang#758
- Add a challenge to handle chained panics, as described in gnolang#756
- Add a challenge to handle a specific rule of recover, as described in
  this [comment][0]

Also add some working recover cases in `tests/files`, to increase code
coverage.

If you manage to solve one of these challenges by updating the gnovm code, move
those files into the `gnovm/test/files` folder (eventually increment the
number suffix in the name according to existing files).

[0]: gnolang#756 (comment)
@tbruyelle tbruyelle requested a review from a team as a code owner April 20, 2023 14:48
@moul moul merged commit 32bc631 into gnolang:master Apr 20, 2023
Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(TIL that when we use println on nil values it prints "undefined"... smells very javascript-y to me 😞 )


// Error:
// first
// second
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// second
// second

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got ninja'd by manfred... shouldn't be too much of a problem though, if somebody does fix the challenges they'll probably have to adjust the output anyway.

yes :)

// Output:
// g recover undefined
// f recover wtf
// false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// false

@thehowl
Copy link
Member

thehowl commented Apr 20, 2023

Got ninja'd by manfred... shouldn't be too much of a problem though, if somebody does fix the challenges they'll probably have to adjust the output anyway.

@tbruyelle
Copy link
Contributor Author

(TIL that when we use println on nil values it prints "undefined"... smells very javascript-y to me disappointed )

This also surprised me, initially I was expecting <nil>, but println has a specific behavior, even in Go, it prints (0x0,0x0) for a nil error, which is probably something like a zero pointer.

peter7891 pushed a commit that referenced this pull request May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants