From patchwork Tue May 16 15:39:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Cully X-Patchwork-Id: 50044 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5D0D327BBEA; Tue, 16 May 2023 16:40:19 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 38B4227BBE9 for ; Tue, 16 May 2023 16:40:18 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pywmW-00054M-Si; Tue, 16 May 2023 11:40:09 -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 1pywmR-000541-LG for guix-patches@gnu.org; Tue, 16 May 2023 11:40:04 -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 1pywmQ-0000dj-H5 for guix-patches@gnu.org; Tue, 16 May 2023 11:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pywmQ-0002hG-9N for guix-patches@gnu.org; Tue, 16 May 2023 11:40:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63538] [PATCH 1/3] tests: Add tests for MODIFY-SERVICES procedure Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 16 May 2023 15:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63538 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63538@debbugs.gnu.org Cc: Brian Cully X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168425159910349 (code B ref -1); Tue, 16 May 2023 15:40:02 +0000 Received: (at submit) by debbugs.gnu.org; 16 May 2023 15:39:59 +0000 Received: from localhost ([127.0.0.1]:47003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pywmN-0002gr-0v for submit@debbugs.gnu.org; Tue, 16 May 2023 11:39:59 -0400 Received: from lists.gnu.org ([209.51.188.17]:36406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pywmJ-0002gi-KR for submit@debbugs.gnu.org; Tue, 16 May 2023 11:39:57 -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 1pywmJ-00053D-Bb for guix-patches@gnu.org; Tue, 16 May 2023 11:39:55 -0400 Received: from coleridge.kublai.com ([166.84.7.167] helo=mail.spork.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pywmH-0000a5-R9 for guix-patches@gnu.org; Tue, 16 May 2023 11:39:55 -0400 Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id BEA7FA74E; Tue, 16 May 2023 11:39:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1684251582; bh=hxk+inCuFrsozG8yBZ/fh8ZBc7VPOkKQkLgLow1kRoU=; h=From:To:Cc:Subject:Date; b=HbmO5axiZ+hy2Lu8aOb3AtX6olqbFBXeGs1WS9zgrqGGM9/payO0Pg64cUaqhPiGI JmoBQdigQRwPSQkbcuwXl0si+I8Ep0oA8MtaOrdhcHW5VykROv/gzaiYufkwfhLDC3 0eyq1YRNl2kWMF/7zG3P7TV5hd8xmhwckJCyzwL0= Date: Tue, 16 May 2023 11:39:37 -0400 Message-Id: <999ea3ff3ea32e4e1bb8b7b8abd4e0e29d1f2395.1684251578.git.bjc@spork.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Received-SPF: pass client-ip=166.84.7.167; envelope-from=bjc@spork.org; helo=mail.spork.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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 X-Patchwork-Original-From: Brian Cully via Guix-patches via From: Brian Cully Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * tests/services.scm ("modify-services: do nothing") ("modify-services: delete service") ("modify-services: change value"): New tests. --- tests/services.scm | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) base-commit: b363fab46f5af42b3f653e2fee1834477bd5aacd prerequisite-patch-id: 8a03c5e8bcd4c526b93c558d550725887f932e41 prerequisite-patch-id: 89400c29b4c30dfbe8492aff1751ca583397b4f0 prerequisite-patch-id: a1963f772e753239b80e6a7b0d9f55e0ab4d662b prerequisite-patch-id: b047430c30ba9ea274aea33a467cdb49d769884e diff --git a/tests/services.scm b/tests/services.scm index 8e35758209..435f39e59b 100644 --- a/tests/services.scm +++ b/tests/services.scm @@ -286,4 +286,54 @@ (define-module (test-services) ((one) one) (x x)))) +(test-equal "modify-services: do nothing" + '(1 2 3) + (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 t2 2) (service t3 3)))) + (sort (map service-value + (modify-services services)) + <))) + +(test-equal "modify-services: delete service" + '(1 3) + (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 t2 2) (service t3 3)))) + (sort (map service-value + (modify-services services + (delete t2))) + <))) + +(test-equal "modify-services: change value" + '(1 2 33) + (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 t2 2) (service t3 3)))) + (sort (map service-value + (modify-services services + (t3 value => 33))) + <))) + (test-end)