guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/04: inferior: Add 'inferior-eval-with-store' tests.


From: guix-commits
Subject: 02/04: inferior: Add 'inferior-eval-with-store' tests.
Date: Wed, 20 Jan 2021 18:19:30 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 074a201c33f822a7ab59512e7ee8b301204ff732
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed Jan 20 23:34:15 2021 +0100

    inferior: Add 'inferior-eval-with-store' tests.
    
    * tests/inferior.scm ("inferior-eval-with-store, exception")
    ("inferior-eval-with-store, not a procedure"): New tests.
---
 tests/inferior.scm | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/tests/inferior.scm b/tests/inferior.scm
index 5fddb1f..fb12111 100644
--- a/tests/inferior.scm
+++ b/tests/inferior.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -213,6 +213,26 @@
                                                       "uh uh")))
       #f)))
 
+(test-equal "inferior-eval-with-store, exception"
+  '(the-answer = 42)
+  (let ((inferior (open-inferior %top-builddir
+                                 #:command "scripts/guix")))
+    (guard (c ((inferior-exception? c)
+               (close-inferior inferior)
+               (inferior-exception-arguments c)))
+      (inferior-eval-with-store inferior %store
+                                '(lambda (store)
+                                   (throw 'the-answer '= 42))))))
+
+(test-equal "inferior-eval-with-store, not a procedure"
+  'wrong-type-arg
+  (let ((inferior (open-inferior %top-builddir
+                                 #:command "scripts/guix")))
+    (guard (c ((inferior-exception? c)
+               (close-inferior inferior)
+               (car (inferior-exception-arguments c))))
+     (inferior-eval-with-store inferior %store '(+ 1 2)))))
+
 (test-equal "inferior-package-derivation"
   (map derivation-file-name
        (list (package-derivation %store %bootstrap-guile "x86_64-linux")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]