Commit Graph

6 Commits

Author SHA1 Message Date
Ludovic Courtès 6c5790a2fa
uuid: 'fat-uuid->string' preserves leading zeros.
Fixes <https://bugs.gnu.org/35582>.
Reported by sirgazil <sirgazil@zoho.com>.

Previously, leading zeros would be removed, leading to an "invalid"
UUID:

  (uuid->string (uuid "00CA-050E" 'fat32))
  ⇒ "CA-50E"
  (string->uuid "CA-50E" 'fat32)
  ⇒ #f

* gnu/system/uuid.scm (fat-uuid->string): Pad digits with zeros.
* tests/uuid.scm ("uuid, FAT32, leading zeros preserved"): New test.
2019-05-07 12:18:44 +02:00
Ludovic Courtès 263c9941a1
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.
2018-05-19 00:14:52 +02:00
Ludovic Courtès 0b12324284
uuid: Fix typo in 'uuid=?' test.
* tests/uuid.scm ("uuid=?"): Change to 'test-assert'.
2017-10-06 14:16:23 +02:00
Ludovic Courtès aed1f1b049
uuid: Add 'uuid=?' and use it.
* gnu/system/uuid.scm (uuid=?): New procedure.
* tests/uuid.scm ("uuid=?"): New test.
* gnu/build/file-systems.scm (partition-uuid-predicate)
(luks-partition-uuid-predicate): Use it instead of 'bytevector=?'.
2017-10-05 12:09:17 +02:00
Ludovic Courtès 8a7d81a5e2
uuid: Add a parser for FAT32 UUIDs.
* gnu/system/uuid.scm (%fat32-uuid-rx): New variable.
(string->fat32-uuid): New procedure.
(%uuid-parsers): Add it.
* tests/uuid.scm ("uuid, FAT32, format preserved"): New test.
2017-09-22 18:40:57 +02:00
Ludovic Courtès 8f3b63b5d7
uuid: Move tests to 'tests/uuid.scm'.
* tests/file-systems.scm ("uuid->string", "string->uuid")
("uuid", "uuid, syntax error"): Move to...
* tests/uuid.scm: ... here.  New file.
("uuid, ISO-9660, format preserved"): New test.
2017-09-14 00:10:13 +02:00