faker icon indicating copy to clipboard operation
faker copied to clipboard

Make tests compatible with Elixir 1.16 and 1.17

Open ypconstante opened this issue 1 year ago • 0 comments

This PR replaces usages of Elixir functions that return random data, allowing us to update the test to work on all supported Elixir versions:

  • Replace Enum.random with :rand.uniform on Faker.Random.Test.random_between
  • Replace Enum.random with random_between on Faker.Random.Test.random_bytes
  • Replace Enum.take_random and Enum.shuffle with Enum.sort_by(random_uniform)

After this changes the only tests breaking was on Faker.File because of the map ordering changes on OTP 26, also fixed it and updated CI to test on both OTP 26 and 27.

I've added:

  • [ ] USAGE.md docs if applicable
  • [X] CHANGELOG.md

ypconstante avatar Jun 16 '24 19:06 ypconstante