Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 377d6496 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

tests: Factorize ‘type-predicate’.

* tests/guile.scm (type-predicate): New procedure.
("execute_request", "execute_request, exception"): Remove
‘type-predicate’.
parent d10123ba
No related branches found
No related tags found
No related merge requests found
;;; Guix-kernel -- Guix kernel for Jupyter ;;; Guix-kernel -- Guix kernel for Jupyter
;;; Copyright (C) 2019, 2021 Inria ;;; Copyright (C) 2019, 2021, 2024 Inria
;;; ;;;
;;; This program is free software: you can redistribute it and/or modify ;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by ;;; it under the terms of the GNU General Public License as published by
...@@ -35,6 +35,10 @@ ...@@ -35,6 +35,10 @@
(define %kernel-key "secretkey") (define %kernel-key "secretkey")
(define (type-predicate type)
(lambda (message)
(string=? (message-type message) type)))
(test-begin "guile") (test-begin "guile")
...@@ -68,10 +72,6 @@ ...@@ -68,10 +72,6 @@
(let ((connection client (allocate-connection %client-context (let ((connection client (allocate-connection %client-context
"tcp" "127.0.0.1" "tcp" "127.0.0.1"
%kernel-key))) %kernel-key)))
(define (type-predicate type)
(lambda (message)
(string=? (message-type message) type)))
(define (client-thunk) (define (client-thunk)
(let ((request (message (header "execute_request" "luser" "12345") (let ((request (message (header "execute_request" "luser" "12345")
(scm->json-string (scm->json-string
...@@ -108,10 +108,6 @@ ...@@ -108,10 +108,6 @@
(let ((connection client (allocate-connection %client-context (let ((connection client (allocate-connection %client-context
"tcp" "127.0.0.1" "tcp" "127.0.0.1"
%kernel-key))) %kernel-key)))
(define (type-predicate type)
(lambda (message)
(string=? (message-type message) type)))
(define (client-thunk) (define (client-thunk)
(let ((request (message (header "execute_request" "luser" "12345") (let ((request (message (header "execute_request" "luser" "12345")
(scm->json-string (scm->json-string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment