From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id CCeRK6M7fmftCgEA62LTzQ:P1 (envelope-from ) for ; Wed, 08 Jan 2025 08:47:31 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id CCeRK6M7fmftCgEA62LTzQ (envelope-from ) for ; Wed, 08 Jan 2025 09:47:31 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=7d.nz header.s=20240212 header.b=OcoRPc7d; 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"; dmarc=pass (policy=reject) header.from=7d.nz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1736326051; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=JQH4IQPoWfZBvomvDjDQsQ1qzLTxBC0q+flTZpiFCJ8=; b=juJ9XvdTQp1oWgWUTqW3SpOAB+Zw/6riHRiU7T8S2ZGlTObmSgBJPZND0nVmilcEvptDr+ fpFr7bxca/Rk3flCE2IYelgGZROcD7DdrsCAFlhZz7pSVka8R+RealPM8QsdcSTC2xecRP voHCAtXBKb2fiwjDFO+//QvHGxNJQBIhJaDiCgScQVqiNjJjjfjVKeeCNaptgYAx2rcEFn mlcF4FEwA4JBJIHMMinpgiDVXuuPxcb/pEYtzdbwapDYTROEMRZ0wUCC+1jR5QIp9fWA9G qzEZ+jxL2pOIiz7FX7v83VQBByMHC8dS4l29yuQXyNgUbq9qCA7//gpw3rFQ3g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=7d.nz header.s=20240212 header.b=OcoRPc7d; 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"; dmarc=pass (policy=reject) header.from=7d.nz ARC-Seal: i=1; s=key1; d=yhetil.org; t=1736326051; a=rsa-sha256; cv=none; b=dFtjxY6iaIPFjoubiLGyQxgY5493cJVjCQQ+SyAMRrYSy00vWvgmdiesHty0+/j5cP3StB 5OQ1fTAoH9dPZbr0kWHXduMofxt8xknmAjjv4ITLtGs1OcGXTSYf0thp/nS0fXzGRYSzzf quM8+D9UG2cKYfa3sHi3elmvKETf+1kgfohX72w71AT2KK8rxIfQUjZRbvQptw4JenB84h ou5CRYx5d8y+fRiBgswhF4PXMf+ZlPFNa4LtxpxvBY10ju+CndRonr2pvnoaUYYwWvjAzn JB3T2qkcxLCkxTL2scUfwVxn1GJs43u1biXZCpbbUVDSWUXi7zTkwr/PriTjyA== 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 57FEB9999E for ; Wed, 08 Jan 2025 09:47:31 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVRh8-00064J-6F; Wed, 08 Jan 2025 03:45:42 -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 1tVRh6-000645-L1 for emacs-orgmode@gnu.org; Wed, 08 Jan 2025 03:45:40 -0500 Received: from smtp-190e.mail.infomaniak.ch ([2001:1600:4:17::190e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tVRh3-0001lE-SU for emacs-orgmode@gnu.org; Wed, 08 Jan 2025 03:45:40 -0500 Received: from smtp-3-0001.mail.infomaniak.ch (unknown [IPv6:2001:1600:4:17::246c]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4YShMD3pHmz6QT; Wed, 8 Jan 2025 09:45:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=7d.nz; s=20240212; t=1736325928; bh=JQH4IQPoWfZBvomvDjDQsQ1qzLTxBC0q+flTZpiFCJ8=; h=Date:From:Subject:To:Cc:From; b=OcoRPc7dMrPS0c18ISqp6DofVL+G/VxaqO85wkA+e9M5X1760EhVjytD4DkSKTJ8u aUnf1oPkfqX0HQ0WzUuT2gVoHLkGH+T1fg+n4l+d0wS1ELvrvqzEdU7GF9haPTpS17 fzeUcDr0zQkYyxxT9HXlUADyEI/XKLJVMtDQIjDHyQXRwX973QJxQCwVnDtmJcfG5A TQjXj4ho79UbJAHofMN0NIU8nXZ/01tBdOurU5peVNlKiZDniaBUw7FMJTaxA4k/7Z RCgS9JTfZBS20aa6K+xa75N12Ax1aqCh4z/q+iNU9kL2j1kv9x3nH3jwoYOo9Jny26 uoEgu9HPNXjsg== Received: from unknown by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4YShMD0Z5ZzCp9; Wed, 8 Jan 2025 09:45:28 +0100 (CET) Message-ID: <18d80a44-bc2b-472a-bf62-05878b4f8fa4@7d.nz> Date: Wed, 8 Jan 2025 09:45:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Phil Estival Subject: To factorize code of test sets (or not) To: Ihor Radchenko Cc: Org Mode List Content-Language: fr Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Infomaniak-Routing: alpha Received-SPF: pass client-ip=2001:1600:4:17::190e; envelope-from=pe@7d.nz; helo=smtp-190e.mail.infomaniak.ch 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, SPF_HELO_PASS=-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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -6.48 X-Spam-Score: -6.48 X-Migadu-Queue-Id: 57FEB9999E X-Migadu-Scanner: mx10.migadu.com X-TUID: 3Mo6daIS2Nwr * [2025-01-07 19:38] Ihor Radchenko:> Phil Estival writes: > >> [...] >> Some macros [for test suite] should probably be moved upward >> in a file where generic functions which purposes are to help >> writing the tests of babel source blocks should be declared. >> > > I do not mind. > But please show which _other_ tests can benefit from the simplification. This may appear as an unnecessary effort to refactor, or worse, normalize a code that can benefit from some diversity yet, the forms (should (equal "" (org-test-with-temp-text "" (org-babel-next-src-block) (org-trim (org-babel-execute-src-block)))))) or (org-test-with-temp-text "" (org-babel-next-src-block) (should (equal '() ;; or (should (string= " (org-babel-execute-src-block)))) ;; or org-babel-execute-maybe for ruby and elisp exist in test-ob-[maxima,R,sqlite,sed,shell,plantuml,lua,java,julia,lob,octave,perl,python,emacs-lisp].el Considering it at the repetitive pattern, I think a macro can shorten those forms to : (ob-test "" :expect "") and a variant to test or exclude matching regexp (ob-test "" :expect-to-match "") (ob-test "" :expect-to-not-match "") IMHO, they would be easier to read with one additional line feed (ob-test " #+begin_src ... #+end_src" :expect "") rather than (ob-test "#+begin_src ... #+end_src" :expect "") Similar macro/function exists in ob-emacs-lisp/dynamic-lexical-execute or ob-sql/command-should-contain. my 2ยข, Phil