-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test uuid5 generates same value with given same input and vice-versa Signed-off-by: venkata pyla <[email protected]>
- Loading branch information
1 parent
628230b
commit f1a2441
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3deb2a0e-692c-5a37-93c0-1123948bf5ae |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# expected.uuid5 contains value generated with $namespace and $text1 | ||
{{ $namespace := or .namespace "6c9d1418-8fa9-11ee-b4ca-325096b39f47" }} | ||
{{ $text1 := or .text1 "ver1.0" }} | ||
{{ $text2 := or .text2 "ver2.0" }} | ||
|
||
architecture: amd64 | ||
|
||
actions: | ||
- action: run | ||
description: test uuid5 generate same value when input is same | ||
chroot: false | ||
command: echo {{ uuid5 $namespace $text1 }} > ${RECIPEDIR}/actual1.uuid5 | ||
- action: run | ||
chroot: false | ||
command: diff -u ${RECIPEDIR}/actual1.uuid5 ${RECIPEDIR}/expected.uuid5 | ||
|
||
- action: run | ||
description: test uuid5 generate different value when input is different | ||
chroot: false | ||
command: echo {{ uuid5 $namespace $text2 }} > ${RECIPEDIR}/actual2.uuid5 | ||
- action: run | ||
chroot: false | ||
command: diff -s ${RECIPEDIR}/actual2.uuid5 ${RECIPEDIR}/expected.uuid5 && exit 1 || exit 0 |