summaryrefslogtreecommitdiff
path: root/tests/store-database.scm
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2021-02-09 15:09:43 -0500
committerLeo Famulari <leo@famulari.name>2021-02-09 15:09:43 -0500
commit388bd35dd0df2d231bc2cce3746d7d5fd15df23a (patch)
tree82e7cc45b8279f83439214c7c79dc7161ffda94d /tests/store-database.scm
parentf1c7c2f697877fcb68b53ea062ff8a88f274a2fe (diff)
parentd00380b0077b0df2a0b790bb115d07c1533b8863 (diff)
downloadguix-patches-388bd35dd0df2d231bc2cce3746d7d5fd15df23a.tar
guix-patches-388bd35dd0df2d231bc2cce3746d7d5fd15df23a.tar.gz
Merge branch 'master' into staging-next
Diffstat (limited to 'tests/store-database.scm')
-rw-r--r--tests/store-database.scm19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/store-database.scm b/tests/store-database.scm
index 17eea38c63..d8f3ce8070 100644
--- a/tests/store-database.scm
+++ b/tests/store-database.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2018, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -123,4 +123,21 @@
(pk 'welcome-exception! args)
#t)))))
+(test-equal "sqlite-register with incorrect size"
+ 'out-of-range
+ (call-with-temporary-output-file
+ (lambda (db-file port)
+ (delete-file db-file)
+ (catch #t
+ (lambda ()
+ (with-database db-file db
+ (sqlite-register db #:path "/gnu/foo"
+ #:references '("/gnu/bar")
+ #:deriver "/gnu/foo.drv"
+ #:hash (string-append "sha256:" (make-string 64 #\e))
+ #:nar-size -1234))
+ #f)
+ (lambda (key . _)
+ key)))))
+
(test-end "store-database")