From 8cafd6b2d504f54199202ff010e5fdeb2c1b79ac Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Sat, 22 Aug 2026 05:26:12 -0600 Subject: [PATCH] test: distinguish UUID and GUID key types (#80) --- tests/specs/integration/BaseEntity/GUIDPrimaryKeySpec.cfc | 8 ++++++++ tests/specs/integration/BaseEntity/UUIDPrimaryKeySpec.cfc | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/tests/specs/integration/BaseEntity/GUIDPrimaryKeySpec.cfc b/tests/specs/integration/BaseEntity/GUIDPrimaryKeySpec.cfc index a52bef89..490f6832 100644 --- a/tests/specs/integration/BaseEntity/GUIDPrimaryKeySpec.cfc +++ b/tests/specs/integration/BaseEntity/GUIDPrimaryKeySpec.cfc @@ -8,6 +8,14 @@ component extends="tests.resources.ModuleIntegrationSpec" { var country = getInstance( "Actor" ).create( { "name" : "Tina Fey" } ); expect( country.getId() ).notToBeNumeric(); + expect( country.getId() ).toHaveLength( 36 ); + expect( + reFindNoCase( + "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", + country.getId() + ) + ).toBe( 1 ); + expect( getInstance( "Actor" ).find( country.getId() ) ).notToBeNull(); } ); }, skip = !server.keyExists( "lucee" ) && !server.keyExists( "boxlang" ) diff --git a/tests/specs/integration/BaseEntity/UUIDPrimaryKeySpec.cfc b/tests/specs/integration/BaseEntity/UUIDPrimaryKeySpec.cfc index aa6b5b5c..a1a4796a 100644 --- a/tests/specs/integration/BaseEntity/UUIDPrimaryKeySpec.cfc +++ b/tests/specs/integration/BaseEntity/UUIDPrimaryKeySpec.cfc @@ -6,6 +6,11 @@ component extends="tests.resources.ModuleIntegrationSpec" { var country = getInstance( "Country" ).create( { "name" : "Wakanda" } ); expect( country.getId() ).notToBeNumeric(); + expect( country.getId() ).toHaveLength( 35 ); + expect( reFindNoCase( "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{16}$", country.getId() ) ).toBe( + 1 + ); + expect( getInstance( "Country" ).find( country.getId() ) ).notToBeNull(); } ); } ); }