-module(guid_test). -include_lib("eunit/include/eunit.hrl"). % Test descriptions v4_test_() -> [{"A v4 uuid must have version 4", check_v4_version()}, {"A uuid must be 16 bytes", check_v4_length()} ]. text_test_() -> [{"The text representation must be 38 characters long", check_v4_string_length()} ]. % Tests check_v4_version() -> Uuid = guid:v4(), [?_assertEqual(guid:version(Uuid), 4)]. check_v4_length() -> Uuid = guid:v4(), [?_assertEqual(byte_size(Uuid), 16)]. check_v4_string_length() -> String = guid:v4string(), [?_assertEqual(length(String), 36)].