From 066fb30b2112b666d39a0e21e886ef45f6171837 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Mon, 11 Nov 2024 12:39:28 +0000 Subject: [PATCH] Explain artist_uuid test implementation --- test/support/fixtures/records_fixtures.ex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/support/fixtures/records_fixtures.ex b/test/support/fixtures/records_fixtures.ex index aecf2c78..b6f8afca 100644 --- a/test/support/fixtures/records_fixtures.ex +++ b/test/support/fixtures/records_fixtures.ex @@ -95,6 +95,9 @@ defmodule MusicLibrary.RecordsFixtures do |> record_fixture() end + # The following functions have been lifted from `Ecto.UUID`'s source. + # The purpose is to provide a deterministic implementation of uuid generation + # that can be used in tests to generate the same artist uuid. defp artist_uuid(name) do <> = :crypto.hash(:md5, name) encode(<>)