From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 2EbINuGjY2T7XgEASxT56A (envelope-from ) for ; Tue, 16 May 2023 17:40:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id mAS5NuGjY2T9fQEA9RJhRA (envelope-from ) for ; Tue, 16 May 2023 17:40:17 +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 3DD2CBF2C for ; Tue, 16 May 2023 17:40:17 +0200 (CEST) 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 Content-Transfer-Encoding: 8bit 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 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-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684251617; a=rsa-sha256; cv=none; b=UAw46xvjEn4R6EvLidorzgRckuX8uKAEA+GoqLL4EoaT63scjNCmiYWNREFkgKZoWq6iYQ 6oEmF7eRn3yp4XK5HdsL3Do97cyTU+kqTuRpZ2ZcTen5NFthYh8ZDSJiKvXTkDHQcgyOWO 7J73it/+zJg/79BbGIPQ64cp3mcRzT1thMNwTJ/GV8iozKUQkVzFuUzbQrIIEAjTK8dTyj SGJvBWjQcqhjRGoF+qIfIQsuWrb+HyVmUPBm8DGdQ3Ss9LRlkU1SJ9/AJERdG1rlBiXwk7 asUkacJW0tHmyySFfy3rLjThtf7tFFza4n+Yw4YN4426SOLTFtreBmx6qyA5Hw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=spork.org header.s=dkim header.b=HbmO5axi; 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=1684251617; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=8n+2fS1BeuuWfIsKROfGCFxKJ3evpUhauugAojhnnmM=; b=dCZg0wmeibqDTUJRCYybSDG+z8yHnGrlB5BTp79WIdvrovkotgOv44CBMAZDilv8bXecjv liL/kHZ1FiHn2OY3/kU40GGkzRUi+J6AYAhHnB1eJ3P2BLc1dADZ/8IOV53ORCWlcZ6qXy uq1SbHpoDizeSGDxPFWch0+w3NBSfBxHLgpc01vo0Tb400sAsTSyENUvTWi9csnoY4Pv2Z hT5KzfvEz0pghcgaY04NN7maYLTRnznEn84Dtb4GWJ4tWSTZ/OKKc7kEjbSWBIYnB4TtT9 36Ounyf99EIh/MqsVgThyXzlTAdpoSylA+tUhSnVqlzjvfW6LTPZw0g8LS94Mg== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=spork.org header.s=dkim header.b=HbmO5axi; 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-Migadu-Spam-Score: -3.39 X-Spam-Score: -3.39 X-Migadu-Queue-Id: 3DD2CBF2C X-TUID: G4Na+yy4p7yA * 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(+) 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) base-commit: b363fab46f5af42b3f653e2fee1834477bd5aacd prerequisite-patch-id: 8a03c5e8bcd4c526b93c558d550725887f932e41 prerequisite-patch-id: 89400c29b4c30dfbe8492aff1751ca583397b4f0 prerequisite-patch-id: a1963f772e753239b80e6a7b0d9f55e0ab4d662b prerequisite-patch-id: b047430c30ba9ea274aea33a467cdb49d769884e -- 2.40.1