From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id oGRALl4EgGdgzgAAe85BDQ:P1 (envelope-from ) for ; Thu, 09 Jan 2025 17:16:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id oGRALl4EgGdgzgAAe85BDQ (envelope-from ) for ; Thu, 09 Jan 2025 18:16:14 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=rIPbAcy8; 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=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1736442974; 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=/U8hyCpY7i68n0AF+g4BtKNdVfQJ3v/qeJ7c9N0vf7Q=; b=rg0bXxKygQyVquEgXOt5TMPQPcZEOK7uFO9QLEjF+pcG8Pf09JZW3R2UyQFOdQJ6XDfe8h YMViVIy3D5lQWcxt2M2y8g+9phdDOFieOMaT/BeeYmtuilKkNOaRGNQEKNmOyZgbttMhRK F15Aq2g1qhAiUadsShulOLQvCGsjfNzsvMjn7/ykCgQgYEKZgk0J9iGTLV9W1rXJX4hJYs MYjEqidLjV+1ZpDXbMCB0y5HWhMuB9ZWRse8rVxW7pevUCPKOq2ge20tPbeHj5uI5Bg+KP b1hSoN868pyR7lL//hIJNJ+kTv6Kcgd9BvTJi/KZQvBfDz4cK7UP2JsCZkzMOg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=rIPbAcy8; 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=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1736442974; a=rsa-sha256; cv=none; b=r5pSVmcUW3QqgPhkyj9VzT/Y5gnG2Bzt5d26FzzhUMjylTwMgV98zEqBPy51Wv0uHz3RKq NJSvl+gyh1jkfvlR3xarlIyhNoYuQlvGXX7HWnXVo+n1AmqJLVzUr1wsjryCUjqMziJb1P O4nYkL2jO38CYoVz4hWApX2EQFSLrH/RfGIRllqop7NdcsZX0OUe49mbYatsLeRl4bE6M2 Nz5R+PxFdYjwdmXx5hGLsW7kFHvpZpdkd1rSZbZ0GiQ7NmjHiET7ZtuSTdOpw3fqzhFhgZ DEsmqalV3aj8ekucQTfzVAdBJwXURoFjFPiP+PIax7jOqyXZJXmyHkSBGLWyhQ== 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 39B1A42A72 for ; Thu, 09 Jan 2025 18:16:14 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVw7p-0001JK-0N; Thu, 09 Jan 2025 12:15:17 -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 1tVw7m-0001HL-O7 for emacs-orgmode@gnu.org; Thu, 09 Jan 2025 12:15:15 -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 1tVw7k-0008Jn-1D for emacs-orgmode@gnu.org; Thu, 09 Jan 2025 12:15:14 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 01B15240101 for ; Thu, 9 Jan 2025 18:15:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1736442908; bh=WtaB7icUwy4uHm7RNDT/yIhXokaL8M1CmsUxFlsuQhI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=rIPbAcy8cEiXYAAqR6m3QZgF09RKgtL9yMby7GHjtPAI62m3GdaMuKDBPIy7o64Yf st+AULT+w8uXJC0+M97i6fH2RuFL+t20raXm/hgg8u6qsVukfFRNGoOD/0JV9rB7R8 X19IjENeXR8uKeE03wIAwKG+s34lqcwNc7mQdKtHzMPn3oR67lfajNLgBt9uMwBsY5 qCVRE1FJbdmwsAlWsk6P52hBWhDVFHp1LbXHmSn2J1lNJY6C0I5Hqu2LrgIK8dn5GB eqdYtESXL0yCQfe+bMlSpWQ091Q1kUhIpxGYI+cA+Skau2FSKQ42B5IK/W6u7IOl7x UH9lQaOhVhYuw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YTWcq36W8z9rxD; Thu, 9 Jan 2025 18:15:07 +0100 (CET) From: Ihor Radchenko To: Phil Estival Cc: Org Mode List Subject: Re: To factorize code of test sets (or not) In-Reply-To: <18d80a44-bc2b-472a-bf62-05878b4f8fa4@7d.nz> References: <18d80a44-bc2b-472a-bf62-05878b4f8fa4@7d.nz> Date: Thu, 09 Jan 2025 17:17:28 +0000 Message-ID: <87jzb36h5j.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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 39B1A42A72 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -0.86 X-Spam-Score: -0.86 X-TUID: D2YIsV/gJ8GO Phil Estival writes: > 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)))))) > ... > 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 "") > ... > (ob-test "" > :expect-to-match "") Looks reasonable. Although, :expect/:expect-*-to-* are probably redundant. We may instead use some kind of anamorphic form like: (ob-with-src-block-result "...." (should (equal it "expected")) (should (string-match-p "expected-re" it)) (should-not ...) ...) -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at , or support my work at