From 54f4a6929da5259e5cf997649164205aac15c3b9 Mon Sep 17 00:00:00 2001
From: galtm <40716346+galtm@users.noreply.github.com>
Date: Sun, 20 Feb 2022 14:48:41 -0800
Subject: [PATCH] Nonrecursive UUID functions plus XSpec tests
random-util.xsl provides r:make-uuid and r:make-uuid-sequence for creating one
or more random UUIDs. The r:make-random-string-sequence function supports
more flexible random patterns. Implementations here use the XPath
function, random-number-generator.
random-util.xspec provides template- and function-level tests for
code in random-util.xsl.
---
.../util/resolver-pipeline/random-util.xsl | 86 +++++---
.../testing/2_metadata/random-util.xspec | 207 ++++++++++++++++++
2 files changed, 257 insertions(+), 36 deletions(-)
create mode 100644 src/utils/util/resolver-pipeline/testing/2_metadata/random-util.xspec
diff --git a/src/utils/util/resolver-pipeline/random-util.xsl b/src/utils/util/resolver-pipeline/random-util.xsl
index 25e7701df8..4c2d40971c 100644
--- a/src/utils/util/resolver-pipeline/random-util.xsl
+++ b/src/utils/util/resolver-pipeline/random-util.xsl
@@ -27,8 +27,8 @@ v4 UUID
-->
-
+
@@ -49,49 +49,63 @@ v4 UUID
-
+
+
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
-
+
+ ________-____-4___-=___-____________
+
+
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- ________-____-4___-=___-____________
-
-
-
diff --git a/src/utils/util/resolver-pipeline/testing/2_metadata/random-util.xspec b/src/utils/util/resolver-pipeline/testing/2_metadata/random-util.xspec
new file mode 100644
index 0000000000..daa5ea4471
--- /dev/null
+++ b/src/utils/util/resolver-pipeline/testing/2_metadata/random-util.xspec
@@ -0,0 +1,207 @@
+
+
+
+
+ x
+
+ ^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ {codepoints-to-string($ov:charnum)}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+