@@ -590,6 +590,20 @@ export const standardTypeTests: Test[] = [
590590 values : [ 1n ] ,
591591 displayValues : [ '1' ] ,
592592 } ,
593+ {
594+ name : 'UUID' ,
595+ query : `
596+ with rel:base use uuid_from_string
597+ def output = uuid_from_string["22b4a8a1-e548-4eeb-9270-60426d66a48e"]
598+ ` ,
599+ typeDefs : [
600+ {
601+ type : 'UUID' ,
602+ } ,
603+ ] ,
604+ values : [ '22b4a8a1-e548-4eeb-9270-60426d66a48e' ] ,
605+ displayValues : [ '"22b4a8a1-e548-4eeb-9270-60426d66a48e"' ] ,
606+ } ,
593607] ;
594608
595609export const specializationTests : Test [ ] = [
@@ -1406,6 +1420,25 @@ export const specializationTests: Test[] = [
14061420 values : [ 1n ] ,
14071421 displayValues : [ '1' ] ,
14081422 } ,
1423+ {
1424+ name : 'UUID' ,
1425+ query : `
1426+ with rel:base use uuid_from_string
1427+ def v = uuid_from_string["22b4a8a1-e548-4eeb-9270-60426d66a48e"]
1428+ def output = #(v)
1429+ ` ,
1430+ typeDefs : [
1431+ {
1432+ type : 'Constant' ,
1433+ value : {
1434+ type : 'UUID' ,
1435+ value : '22b4a8a1-e548-4eeb-9270-60426d66a48e' ,
1436+ } ,
1437+ } ,
1438+ ] ,
1439+ values : [ '22b4a8a1-e548-4eeb-9270-60426d66a48e' ] ,
1440+ displayValues : [ '"22b4a8a1-e548-4eeb-9270-60426d66a48e"' ] ,
1441+ } ,
14091442] ;
14101443
14111444export const valueTypeTests : Test [ ] = [
@@ -2558,6 +2591,34 @@ export const valueTypeTests: Test[] = [
25582591 values : [ [ ':MyType' , 1n , 1n ] ] ,
25592592 displayValues : [ '(:MyType, 1, 1)' ] ,
25602593 } ,
2594+ {
2595+ name : 'UUID' ,
2596+ query : `
2597+ with rel:base use uuid_from_string, UUID
2598+ def uuid = uuid_from_string["22b4a8a1-e548-4eeb-9270-60426d66a48e"]
2599+ value type MyType = Int, UUID
2600+ def output = ^MyType[1, uuid]
2601+ ` ,
2602+ typeDefs : [
2603+ {
2604+ type : 'ValueType' ,
2605+ typeDefs : [
2606+ {
2607+ type : 'Constant' ,
2608+ value : { type : 'String' , value : ':MyType' } ,
2609+ } ,
2610+ {
2611+ type : 'Int64' ,
2612+ } ,
2613+ {
2614+ type : 'UUID' ,
2615+ } ,
2616+ ] ,
2617+ } ,
2618+ ] ,
2619+ values : [ [ ':MyType' , 1n , '22b4a8a1-e548-4eeb-9270-60426d66a48e' ] ] ,
2620+ displayValues : [ '(:MyType, 1, "22b4a8a1-e548-4eeb-9270-60426d66a48e")' ] ,
2621+ } ,
25612622] ;
25622623
25632624export const miscValueTypeTests : Test [ ] = [
@@ -4106,4 +4167,37 @@ export const valueTypeSpecializationTests: Test[] = [
41064167 values : [ [ ':MyType' , 1n , 1n ] ] ,
41074168 displayValues : [ '(:MyType, 1, 1)' ] ,
41084169 } ,
4170+ {
4171+ name : 'UUID' ,
4172+ query : `
4173+ with rel:base use uuid_from_string, UUID
4174+ def uuid = uuid_from_string["22b4a8a1-e548-4eeb-9270-60426d66a48e"]
4175+ value type MyType = UUID, Int
4176+ def v = ^MyType[uuid, 1]
4177+ def output = #(v)
4178+ ` ,
4179+ typeDefs : [
4180+ {
4181+ type : 'Constant' ,
4182+ value : {
4183+ type : 'ValueType' ,
4184+ typeDefs : [
4185+ {
4186+ type : 'Constant' ,
4187+ value : { type : 'String' , value : ':MyType' } ,
4188+ } ,
4189+ {
4190+ type : 'UUID' ,
4191+ } ,
4192+ {
4193+ type : 'Int64' ,
4194+ } ,
4195+ ] ,
4196+ value : [ ':MyType' , '22b4a8a1-e548-4eeb-9270-60426d66a48e' , 1n ] ,
4197+ } ,
4198+ } ,
4199+ ] ,
4200+ values : [ [ ':MyType' , '22b4a8a1-e548-4eeb-9270-60426d66a48e' , 1n ] ] ,
4201+ displayValues : [ '(:MyType, "22b4a8a1-e548-4eeb-9270-60426d66a48e", 1)' ] ,
4202+ } ,
41094203] ;
0 commit comments