mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
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.
This commit is contained in:
parent
a48d345041
commit
263c9941a1
2 changed files with 15 additions and 5 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue