aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-05-18 22:20:33 +0200
committerLudovic Courtès <ludo@gnu.org>2018-05-19 00:14:52 +0200
commit263c9941a1e523b360ca9f42d1ed6b11e6e6e285 (patch)
tree8fcb7e85667a28fcd33d68cea06173ccb134261e /tests
parenta48d34504181e2f14cef3a5514d2319e60453a79 (diff)
downloadguix-263c9941a1e523b360ca9f42d1ed6b11e6e6e285.tar
guix-263c9941a1e523b360ca9f42d1ed6b11e6e6e285.tar.gz
uuid: 'uuid' returns #f when 'string->uuid' returns #f.
* gnu/system/uuid.scm (uuid): When STR is not a literal, return #f when 'string->uuid' returns #f. * tests/uuid.scm ("uuid, dynamic value"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/uuid.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/uuid.scm b/tests/uuid.scm
index 91a3482490..260614f079 100644
--- a/tests/uuid.scm
+++ b/tests/uuid.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -57,6 +57,13 @@
"1234-ABCD"
(uuid->string (uuid "1234-abcd" 'fat32)))
+(test-assert "uuid, dynamic value"
+ (let* ((good "4dab5feb-d176-45de-b287-9b0a6e4c01cb")
+ (bad (string-drop good 3)))
+ (and (uuid? (uuid good))
+ (string=? good (uuid->string (uuid good)))
+ (not (uuid bad)))))
+
(test-assert "uuid=?"
(and (uuid=? (uuid-bytevector (uuid "1234-abcd" 'fat32))
(uuid "1234-abcd" 'fat32))