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

Added to_int, is_int and string_from_int #373

Merged
merged 1 commit into from
Apr 12, 2016
Merged

Added to_int, is_int and string_from_int #373

merged 1 commit into from
Apr 12, 2016

Conversation

EliasC
Copy link
Contributor

@EliasC EliasC commented Apr 11, 2016

This commit extends the String library with support for translating
to and from ints. Tests in src/tests/encore/stdlib/string.enc have
been extended.

@albertnetymk
Copy link
Contributor

  • the if statement has two identical branches in string_from_int
  • is_int doesn't seem like a library function
  • strtol could be used to parse a string with error detection in to_int
  • it's good to include a test case for integers mixed with strings, sth like 12abc

Tests in `src/tests/encore/stdlib/string.enc` have been extended, and
these are now run with `make test`.
@EliasC
Copy link
Contributor Author

EliasC commented Apr 12, 2016

Reacted to all of @albertnetymk's comments. Code is much better now. I also made sure that the string tests are run with make test

@albertnetymk
Copy link
Contributor

Looks great. The stdlib tests are not integrated in the same manner as the rest, but that could be addressed in anther PR. Merging now.

@albertnetymk albertnetymk merged commit 125ea79 into parapluu:development Apr 12, 2016
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.

3 participants