From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oD/CCBAIamNQBQEAbAwnHQ (envelope-from ) for ; Tue, 08 Nov 2022 08:41:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id ANKtBxAIamObIwEAG6o9tA (envelope-from ) for ; Tue, 08 Nov 2022 08:41:04 +0100 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 CAA7EC7D5 for ; Tue, 8 Nov 2022 08:41:03 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1osJDH-0007BH-H1; Tue, 08 Nov 2022 02:40:03 -0500 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 1osJDC-0007AW-SN for emacs-orgmode@gnu.org; Tue, 08 Nov 2022 02:40:01 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osJDA-0005xA-W7 for emacs-orgmode@gnu.org; Tue, 08 Nov 2022 02:39:58 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 673FA240103 for ; Tue, 8 Nov 2022 08:39:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1667893194; bh=ehdQSIc6s/nFrCy7IgePJ/k/hCZm63+ChgBjt9hpS8I=; h=From:To:Cc:Subject:Date:From; b=JdzJrPRgNom4yqFtW6z0j5m7SgugZE4S6kgvozbyOZ23UbM8hXwYWUvcWQlOrSWIw iJAQ41LfJyATAQs4wgFXrfw9VUUwObnyogizfGFdYrDmZloxrqbs1oPJ1PYgcwZDUD skvjGI6f+o6NWMp6nsbkZekDD9ak0ZarkgdPTQ9EFT8HiRjIO1t5hjEN2TNwIgvzyE 9I5wb8Iaojkr83NAlb6dO4eqjywKplSVkMWNvGz+K04O8OouDRVKFE1b32jtRwjveH 42yE/l6XWkZIFWcGrC+1Ie/9HBaz7Ga3FBRk3uCVSKIhguXB8MOqYdCDJFsFED/JI8 hD5tOlw8FT2vA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4N60P24YMJz9rxR; Tue, 8 Nov 2022 08:39:50 +0100 (CET) From: Ihor Radchenko To: Leo Butler Cc: Org Mode Mailing List Subject: Re: [PATCH] rfc: using ert-deftest with side-effects In-Reply-To: <87mt92elyy.fsf@t14.reltub.ca> References: <87mt92elyy.fsf@t14.reltub.ca> Date: Tue, 08 Nov 2022 07:40:28 +0000 Message-ID: <87mt9128sz.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667893263; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=DMS8fLGjyA+MQJrsYY92wZf2vMIHER1IhMQ9vxa1l84=; b=O+J1vLdfp8ra2xSmxh9ojT0qht8PU9xg0Xnp6an9rI2yrhiHkGpcSQrrBGQzQGcmmHHG7z U7SpWVxbvFPe1VJIG9Kfh6+v0xIP8U2qRwwDMVbXjEnpc/YoNQ9oWL3uR/8Ak5XaEN5v97 8ICHKSdMcREKZysJtEGwOEdQpKpy+N6fEeJD7444mUrK0DJGZhmfkAO+L4WmWgI+RRukE3 4OayuoD5UnQfg0nS1+lKUgMniEl8wuqSe0Jalsp0H69vIrhhPQPj0W1ij+dotgs1fiNUVD LTey4M83JM1x/b2HX9U7yL2KWdhqWW+HbqH82FzIihY4xn3qdg8qH+HZpiWP1g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667893263; a=rsa-sha256; cv=none; b=MoyOe2FksZOIncSFcfweUvH5Xr2dVQ1ziAMc6Vc23/hN+sHyGs9epxv4t4PoDnc1miDxwJ NQChMReDrzF8wb3+I5xKoh08mDLFwgY0W8H3cy+r8FfawF/HYXppdNFb1l2CQG2qFWD9PP WWrftDvMW2rLXTjArx0s5Z2V9+bYJLr9oy6THk7Ad9F34nuXCo63g5rIbsSbSlwh0RA+Ev fIIdl0Dxn6xw9BuPry5b0p+AQwr7g3EMrPvH2pkst+b8tLicP/7H0yyQfMdct19hx7Wz8S ocZMB4/k6aK5Bt0lFwZwyMx4Nd1PT+OuoAUOi4FVI1bipHNfDQkH7wwmv5pX8A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=JdzJrPRg; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -9.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=JdzJrPRg; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: CAA7EC7D5 X-Spam-Score: -9.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: cY9V1iC0JMFy Leo Butler writes: > However, I would like feedback/suggestions on writing such a > test. Issues include: > > 1. how to clean up the side-effects, including changes in the test > buffer, filesystem and potentially creating an error buffer; As you did, we generally use unwind-protect. Also, we prefer putting temporary files into temporary directory. You can grep for `make-temp-file' and `delete-file' in tests. There are plenty of examples. > 2. the general absence of similar tests (except in test-ob.el, > test-ob/result-graphics-link-type-header-argument). > ... > I am unsure about 2. Is the absence of such tests because there is a > policy against them, or ... We have no such policy. In fact, many tests are making temporary files. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at