Skip to content

Change usage of System.stacktrace into __STACKTRACE__ and make tests pass #251

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

Merged
merged 3 commits into from
Jun 10, 2020

Conversation

kknives
Copy link
Contributor

@kknives kknives commented Jun 4, 2020

Changes in getting a stacktrace from a failed koan
As of Elixir 1.10, the usage of System.stacktrace to retrieve a stacktrace is now deprecated and is also non functional. Refer to the docs.

#242 tried substituting System.stacktrace with Erlang's :erlang.get_stacktrace() but it returns an empty list instead.

So, I substituted the calling of System.stacktrace in a non rescue context when trying to report errors with a call to __STACKTRACE__ in the Koan macro itself, for normal execution and for tests, something that #242 suggested.

Making the tests pass
Even then, the tests would not pass. Two tests were failing.
The failure_test.exs was providing input arguments which were not correct for the output the tests asserted.
The comprehension_koans_test.exs was out of date with respect to the koan itself.

Now the tests pass and a few koans I tried worked as well.

[closes #250]

@m3co-code
Copy link

Works for me now 🎉 Thanks!

Copy link
Collaborator

@iamvery iamvery left a comment

Choose a reason for hiding this comment

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

Thanks for making this project better for others ❤️

@iamvery iamvery merged commit 4ff2490 into elixirkoans:master Jun 10, 2020
w0rd-driven added a commit to w0rd-driven/elixir-koans that referenced this pull request Nov 10, 2020
Due to changes introduced in elixirkoans#251, we need to bump our Elixir version to something more recent.
w0rd-driven pushed a commit to w0rd-driven/elixir-koans that referenced this pull request Jul 12, 2021
Change usage of System.stacktrace into __STACKTRACE__ and make tests pass
w0rd-driven added a commit to w0rd-driven/elixir-koans that referenced this pull request Jul 12, 2021
Due to changes introduced in elixirkoans#251, we need to bump our Elixir version to something more recent.
w0rd-driven added a commit to w0rd-driven/elixir-koans that referenced this pull request Jul 13, 2021
Due to changes introduced in elixirkoans#251, we need to bump our Elixir version to something more recent.
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.

FunctionClauseError when starting newly cloned elixir-koans
3 participants