Skip to content

Raise in Time.add/3 for non-positive integer #13122

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 4 commits into from
Nov 18, 2023

Conversation

03juan
Copy link
Contributor

@03juan 03juan commented Nov 18, 2023

Before this fix the test fails because the code runs through System.convert_time_unit/3 into System.normalize_time_unit/1.

  1) test add/2 (TimeTest)
     lib/elixir/test/elixir/calendar/time_test.exs:94
     Wrong message for ArgumentError
     expected:
       ~r/Expected :hour, :minute, :second/
     actual:
       "unsupported time unit. Expected :second, :millisecond, :microsecond, :nanosecond, or a positive integer, got 0"
     code: assert_raise ArgumentError, ~r/Expected :hour, :minute, :second/, fn ->
     stacktrace:
       lib/elixir/test/elixir/calendar/time_test.exs:99: (test)

@03juan
Copy link
Contributor Author

03juan commented Nov 18, 2023

I was busy writing a code review comment on #13121 but José beat me to the commit. 🤣

@03juan
Copy link
Contributor Author

03juan commented Nov 18, 2023

Actions passed in my repo CI

@josevalim josevalim merged commit 15e17c1 into elixir-lang:main Nov 18, 2023
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

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

Successfully merging this pull request may close these issues.

2 participants