diff options
Diffstat (limited to 'tests/utils.scm')
| -rw-r--r-- | tests/utils.scm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/utils.scm b/tests/utils.scm index eade84b5d49..edea11db720 100644 --- a/tests/utils.scm +++ b/tests/utils.scm | |||
| @@ -46,6 +46,22 @@ | |||
| 46 | "mzxw6ytb" | 46 | "mzxw6ytb" |
| 47 | "mzxw6ytboi"))) | 47 | "mzxw6ytboi"))) |
| 48 | 48 | ||
| 49 | (test-assert "base32-string->bytevector" | ||
| 50 | (every (lambda (bv) | ||
| 51 | (equal? (base32-string->bytevector | ||
| 52 | (bytevector->base32-string bv)) | ||
| 53 | bv)) | ||
| 54 | ;; Examples from RFC 4648. | ||
| 55 | (map string->utf8 '("" "f" "fo" "foo" "foob" "fooba" "foobar")))) | ||
| 56 | |||
| 57 | (test-assert "nix-base32-string->bytevector" | ||
| 58 | (every (lambda (bv) | ||
| 59 | (equal? (nix-base32-string->bytevector | ||
| 60 | (bytevector->nix-base32-string bv)) | ||
| 61 | bv)) | ||
| 62 | ;; Examples from RFC 4648. | ||
| 63 | (map string->utf8 '("" "f" "fo" "foo" "foob" "fooba" "foobar")))) | ||
| 64 | |||
| 49 | ;; The following tests requires `nix-hash' in $PATH. | 65 | ;; The following tests requires `nix-hash' in $PATH. |
| 50 | (test-skip (if (false-if-exception (system* "nix-hash" "--version")) | 66 | (test-skip (if (false-if-exception (system* "nix-hash" "--version")) |
| 51 | 0 | 67 | 0 |
