From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id oMX/CE4zcWR8WQAASxT56A (envelope-from ) for ; Sat, 27 May 2023 00:31:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 2Kr7CE4zcWQMHAAA9RJhRA (envelope-from ) for ; Sat, 27 May 2023 00:31:42 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DC8F713A3E for ; Sat, 27 May 2023 00:31:41 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2fxm-0003ud-FF; Fri, 26 May 2023 18:31:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2fxe-0003sa-Ly for guix-patches@gnu.org; Fri, 26 May 2023 18:31:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2fxe-0003AG-AE for guix-patches@gnu.org; Fri, 26 May 2023 18:31:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q2fxe-00086K-62 for guix-patches@gnu.org; Fri, 26 May 2023 18:31:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63538] [PATCH v2 2/3] tests: Check for service existence in MODIFY-SERVICES Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 26 May 2023 22:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63538 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63538@debbugs.gnu.org Cc: Brian Cully Received: via spool by 63538-submit@debbugs.gnu.org id=B63538.168514022631076 (code B ref 63538); Fri, 26 May 2023 22:31:02 +0000 Received: (at 63538) by debbugs.gnu.org; 26 May 2023 22:30:26 +0000 Received: from localhost ([127.0.0.1]:50969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2fx3-000855-Ne for submit@debbugs.gnu.org; Fri, 26 May 2023 18:30:26 -0400 Received: from coleridge.kublai.com ([166.84.7.167]:59415 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2fx1-00084k-TJ for 63538@debbugs.gnu.org; Fri, 26 May 2023 18:30:24 -0400 Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id ADA54BEE2; Fri, 26 May 2023 18:30:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1685140223; bh=t9xUK4xqIkXvRG2F8P0RE1fk55OZAVeF22NNXcTTZpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=X7kgb3PmQChuYjQWN+4M4jyia6IMGf17CaJN6ihRjQWanUoiHieTitDT0e1Ff+vfg A2O4YDv07c7L7AHASlkoJUDiAExIgRhevBCrXJIQ4N0o73xgAfZbOdb3E/iJRk5EY5 fSJxb2qNx55FxW6lb7SjZb4/BcloZOMaS+rj1nrM= Date: Fri, 26 May 2023 18:30:16 -0400 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Brian Cully X-ACL-Warn: , Brian Cully via Guix-patches From: Brian Cully via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1685140301; a=rsa-sha256; cv=none; b=sA/6kafD0l53pS/uWXe+WimF0WYnC5GI/Nja38yZIT+fDPssvCOhFC6Zep7nQ1L2WjAb/Z XIq8aTD6Pzu6BvW+Me95PTylRk9WepmETZR5OK5isGOwv5cvC8SuhBzyr/6UbrQp3sWvN6 3DYt3jNF9erIsqU+mz6kABDhDWo7xwVNSsIW0SFQqWtFUK8MKdKYa62ezfTh9rwvfQwZg7 n/yov0WEB3SA4Z9bJuGRaE05bbjjsRTfd4XVe6h65tpaTnhG0XALdICesb6xaaP0kRHe6q NhlLS2UUO78xnx3s7XuM9SvIUghtwuqvTIXlQ6sArsv5qTcjkWNbZLN3kurynw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=spork.org header.s=dkim header.b=X7kgb3Pm; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1685140301; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=dkGsVWQHPu2ucYIIOf1dImuQtOP4lA/HAtdaWuiGGNY=; b=h2Z4Q2aXcLxiexWjWftYdRgN0K6hpeEJw79gSl8M2cSkqRVTYJIgI0UQfBZMLdiCA4/4fZ 68e4uAWC8AZFAYkZnjwgcBEBv57MHY/YlCafgtak0Df2qnlLMd9fzBQHt6pkd/ANLUpOB6 Q7tueckfNbksOJkycI6St8jyv2JOpiYrMuTz4Ob4yylzDNFFjRV5r431ILHu64BuTIZHeH NLzN2U6kqvAkOeXJDFOdcKa8Nm2pdiokL6nq+5zC+RhCq4ECTKuVGEhL/vH/jhqfLjukFP 9sWfCFR9gN/ZAwmTa7LwePAAOuR7TdVGwPkh4hqWJ+XeHIbELjM+kXMa04ICHQ== X-Migadu-Spam-Score: -0.61 X-Spam-Score: -0.61 X-Migadu-Queue-Id: DC8F713A3E X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=spork.org header.s=dkim header.b=X7kgb3Pm; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-TUID: 8dVgPspOCJ79 * tests/services.scm ("modify-services: delete non-existing service") ("modify-services: change value for non-existing service"): New tests. --- tests/services.scm | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/tests/services.scm b/tests/services.scm index 435f39e59b..8cdb1b2a31 100644 --- a/tests/services.scm +++ b/tests/services.scm @@ -303,7 +303,7 @@ (define-module (test-services) <))) (test-equal "modify-services: delete service" - '(1 3) + '(1) (let* ((t1 (service-type (name 't1) (extensions '()) (description ""))) @@ -316,11 +316,27 @@ (define-module (test-services) (services (list (service t1 1) (service t2 2) (service t3 3)))) (sort (map service-value (modify-services services + (delete t3) (delete t2))) <))) +(test-error "modify-services: delete non-existing service" + #t + (let* ((t1 (service-type (name 't1) + (extensions '()) + (description ""))) + (t2 (service-type (name 't2) + (extensions '()) + (description ""))) + (t3 (service-type (name 't2) + (extensions '()) + (description ""))) + (services (list (service t1 1) (service t2 2)))) + (modify-services services + (delete t3)))) + (test-equal "modify-services: change value" - '(1 2 33) + '(2 11 33) (let* ((t1 (service-type (name 't1) (extensions '()) (description ""))) @@ -333,7 +349,24 @@ (define-module (test-services) (services (list (service t1 1) (service t2 2) (service t3 3)))) (sort (map service-value (modify-services services + (t1 value => 11) (t3 value => 33))) <))) +(test-error "modify-services: change value for non-existing service" + #t + (let* ((t1 (service-type (name 't1) + (extensions '()) + (description ""))) + (t2 (service-type (name 't2) + (extensions '()) + (description ""))) + (t3 (service-type (name 't3) + (extensions '()) + (description ""))) + (services (list (service t1 1) (service t3 3)))) + (map service-value + (modify-services services + (t2 value => 22))))) + (test-end) -- 2.40.1