From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GMIrHb614GCh8wAAgWs5BA (envelope-from ) for ; Sat, 03 Jul 2021 21:08:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id cF/bGL614GBxGQAA1q6Kng (envelope-from ) for ; Sat, 03 Jul 2021 19:08:46 +0000 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 8398B16949 for ; Sat, 3 Jul 2021 21:08:45 +0200 (CEST) Received: from localhost ([::1]:59798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzl0N-0002e5-LO for larch@yhetil.org; Sat, 03 Jul 2021 15:08:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzkzy-0002dw-Cb for emacs-orgmode@gnu.org; Sat, 03 Jul 2021 15:08:18 -0400 Received: from mx0a-00395d01.pphosted.com ([148.163.133.170]:47748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzkzv-00028F-Mg for emacs-orgmode@gnu.org; Sat, 03 Jul 2021 15:08:18 -0400 Received: from pps.filterd (m0173171.ppops.net [127.0.0.1]) by mx0a-00395d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 163J8Amn018273; Sat, 3 Jul 2021 12:08:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsd.edu; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=campus; bh=cwSb8M+cpP0VNP6PD+Ga9ouHaUEJl5tHnGX+vYmtf0k=; b=C2Qn0+6nZbRNn58G0NThOD/RnADrcSd94hEmPihh+mpSV4muJZQyKhRsjfujXsBioU0y rQrs//oJ9WAdVGwmwnRkWf5UrHaRYJ95aFKz6hEOZwHU6keffVaPNOq4kUEP3hpeNRB9 oH4a9FiosDOC/yo5WPRoNPjxa0PT4dmfVoSSbhQcW1USU5HT5+JvSWzlS5iMI4kzdn5f 2y+8qA/GXba0/mKx7HiOxp77RiAXlJGsqmND9YthukxtgGqxKrATLWs20IQMLsHOEKAN f3mcjKL4XUDqpM2V1ggk/45pphWkCCoKrdf48HB1iiouY7XJq4TGM8ntHHB6rizQQMxH Rg== Received: from secdlpezp04.ucsd.edu ([40.112.251.180]) by mx0a-00395d01.pphosted.com with ESMTP id 39jm4n0hx9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 03 Jul 2021 12:08:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a4oXyegUHhd9YgQiVCBVqfJUnAhnzx6h5Hell7bECe7bIg6jN1tJqmzwIMbz0zMmU364LBdvCeSxVY71AhkKFLNV19/dLpdfsQ3w23ZtvnNuWsSlN2PYp7KzK8xCE8SDmziUr9Vu7uXZxgFS8bZlV4bkBv67kbpgL2cUriGbgCkXs34NzSIdm0FxS88MeMFZ+tLYgow28/pSZ56+a6jpG+rgM6+LYsZWtPWyOB+evwCt2yxHR0m79VNoB6v9Gx4U3umynm+zkb6NOZVsAg34u0Kly7/qQ2RwYF/HU965C4pfnNB6X/VK5b/Yf0fD7j0fXcMFfViXuxQUe4gZ6eJpWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cwSb8M+cpP0VNP6PD+Ga9ouHaUEJl5tHnGX+vYmtf0k=; b=giaYpyWWCkb43H9rQGqCgnxdPY15VYoAj+vXdkcQyUEQazvE6JkbmfXOJpKEJ3MoQzjlSKkffL+HYefbYGhhgpyFbgG9SMSd+snK1zwgI87qyYrpd7NOisV/aAxof7mbAnwNJCk88UjNW2VEA7oVaZmyORd+QvTmX7E7pH5gebxC71qEpvCFLAJlKHVy5Wga6JoyFw/hJMvW0iOhPEmad23DWf1aKZGKQkXQiIVcNcGQYjB5HCBKJqoNcVzuOFG0F2DyBa2Itg5/UdfJoTLN2FvBc8jkLfqEVjA5VC4ui982dvZmdZlPxclYy/sPi67//gpnP7hf2Mc5a8ueYkFulA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=health.ucsd.edu; dmarc=pass action=none header.from=health.ucsd.edu; dkim=pass header.d=health.ucsd.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsdhs.onmicrosoft.com; s=selector2-ucsdhs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cwSb8M+cpP0VNP6PD+Ga9ouHaUEJl5tHnGX+vYmtf0k=; b=2mdMiAfOkhsNBVjOlbOf3GQaawLZzMm0c07G+N5Eoh99dTVawBlIgTju+JtVdcPLyK1VM+z1GR2NLCRUfwBjBVwoDEJ7n/cRILA8Ge6992nxAVrhOpNoZ6IzODfXmdX5zq201ADneOZMRcsIIF2H3p3wdFOtlzSpyW4B/PrcDIU= To: Greg Minshall Subject: Re: using previous =#+results= when =:eval never= Thread-Topic: using previous =#+results= when =:eval never= Thread-Index: AQHXcD7DHXbVUsY31kCrUl/4tZOiQA== Date: Sat, 3 Jul 2021 19:08:09 +0000 Message-ID: References: <3963141.1625330129@apollo2.minshall.org> In-Reply-To: <3963141.1625330129@apollo2.minshall.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2600:1702:1021:b0:fdb2:6383:e9c0:3bf1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4d035947-91d3-407a-9970-08d93e55e5f3 x-ms-traffictypediagnostic: SJ0PR19MB4431: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SyiOwliFB3wKDKw0IMWQ1kDqEEF0ZD+Iwuy7I2ylHyXXmx3+wzqSpK6/wl+JaAtp7b+1VfX8fMnun28p6PCwqRmtxsejcbCo0lGA6j/d/KpXU44Fzqy/+iOA7m+LyWXA7j8oBkGvCK3gXsW2vZ8QPQi87MTIQHSyQXC7MD9iP8j1E4L8AXk44XpJt5I6O1IUfW1M+qDrCDzCEKO8T8dX7VcwO/EIaW8zKWbGyXFbmBeW2YaxU5U++YvMenT9YMUQj8PHbqCbfjIGfC62P/BeHv1DCk8igoK1GFOmBsAl7738dssOf6q4x/mHz7Q9pPWoQm/GqgOscATJzkhyxhJGNmhmXIoDSg3KDiE0hVr0Xrwa69t25+3ptYcQoF++lh0QZXkzAch9+QfJ8sj6pE8Cl2bsfxzkoFD8KeeeXvyDJ8GNF33UnFXY6/kgW8n6btfShrR3/rV1T4hc23H2W8XGDxxl3iEbt3PTQnpifwCB4l9ebepRgTKVKEJuvrFZSqwZp67OGby/IYiv0ATonw+jBGK+ig0/3yYanZu9iT86tTBCRiI1iW5eB08v5b2w8ZwTb4Xzrd7svpUEed9qf5ZU2XC8g7YKIRdm2cKit6HqXibsfuuSINmA1UkrEGJTBtKvjRoEI6fsRz6Sn5oaTW5NFTctrAFxKKDA7DsxEFYGEBuRlvOx2RH9NFuH0NleAb2ULDufja3w5uHrzUgLIhbNJQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR19MB2581.namprd19.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(366004)(136003)(346002)(39860400002)(8936002)(6512007)(122000001)(86362001)(186003)(38100700002)(2616005)(5660300002)(71200400001)(2906002)(6486002)(75432002)(6916009)(6506007)(53546011)(33656002)(66946007)(316002)(4326008)(76116006)(786003)(478600001)(8676002)(83380400001)(64756008)(66556008)(66476007)(66446008)(45980500001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Je17aeQlGDFjybowS6kJUGa5T2HaoLQfWqjnRctSLTMo4ULc5CzrXKIH8q7d?= =?us-ascii?Q?c+mwOyuV64Y12K8oSmlcN5X+RUey1FunSzai5uYtaE+txskGHMXplswRvK/l?= =?us-ascii?Q?mPfAYJtaXrbi6R4k0pOpCByCFausHdnzL2Bke7ndwDFcVmJu+ObOCilN0XxV?= =?us-ascii?Q?OwB3BW7A33W0BfRkpJo3h9Ik3BOcIWvWWslRK0ItznSaJ4uTH7/P8orLvvqz?= =?us-ascii?Q?NXVUl5+lKkSz3mXEbDcIMBauDa2tNBOxLz1xk6yq6RqfysVrHT76omgGY69X?= =?us-ascii?Q?Cwly3T3pPVHVu8waRw7HDmm1GUyT29YwwFyOglwdU3471JE6OaH7i+sWFjUs?= =?us-ascii?Q?9XPdDGM4hsMpoIHU4LEBHUZtBzA1nQakcYLgxEMempBgZjRru+q4yunD4eIY?= =?us-ascii?Q?xhbBObqJu4IZ0O25AMBmqhdGZwykDeOVcikHkH4RSJRx2EEHNcM1+/DJYC4c?= =?us-ascii?Q?8/eyvIW0c6z5x6Le1+B2s07I328HslB+DuzcSucJBo7xakPZMqtroE7rO0kn?= =?us-ascii?Q?SRThPkHiDv6nrf72v1zqJcp4bDF7pptwhfOq855qMDADhWPvKCyEG8NRp2Sx?= =?us-ascii?Q?JqTt5RbT904FKQqWcODobrDhGvV9bLxuJZzWZj3YkpvLsi32uZqMx1IPdRmb?= =?us-ascii?Q?CkjcQ6zvYo4CTTP9LDCBzNcYCS2OVp+iUj6BL/b0kusNqNVmaxJtm72xK6Xw?= =?us-ascii?Q?Kg3lw2lmxGp8pRSyHedrq/Dgzv/cO7sNsTBcHGhPQC9rPQnO07Cgyv5VyKUD?= =?us-ascii?Q?4HbYIMqpc27DS57CAB8TcwRtWiRMBhHJrK9jIqORdB7adh9N4OYYmkgnZRtc?= =?us-ascii?Q?OO4GUbQZjwg9XtbAFK5qZK88ZOGdQp3GjS+LqPISI+A5L/8PzB+8IpgKxLFb?= =?us-ascii?Q?gy175l5n5eEjgWhMFGPHRQNWVuUjZC7ODfZIWRHiUxRXbU78/D7AgxAzLfgv?= =?us-ascii?Q?WiBKYpRvhd6d0GVUVaexZNBbOTq21LM3CJXSHLNLTT7MRQz3R3uVi/9Moabj?= =?us-ascii?Q?kFbZLWN4KrxcDLMBPiBG2vn8eAs6ntqK+5OsZ4d/2/7xLdcIkazh95TXWtsB?= =?us-ascii?Q?XyRhN6EYbugX/6TnUDul2cC97CqK4BqqrRJWgnIUyIrIKcUaIPV1pBeT9yKH?= =?us-ascii?Q?huHxzEEcuGmMpAKl4conVS4gZ3VUx+eCKPpAew3cb9eRRb+vLHDxlcBEqUl7?= =?us-ascii?Q?F8jOnJTFejv8aWi9u9LAXisBQkf9dK3yE9YwyW3gXa9xlTvtwMX3qarSM5Go?= =?us-ascii?Q?MHxoZ9FKhBdASumDk8PuTD4CKE6d55jX2Fmg9mS3CJj6OxFV9+9JYMYoTgVK?= =?us-ascii?Q?YIrg8gxDd3XC+mNf8b+RYMKQP2zcBCyycH/QluUhbviykUzTtJiqtW4C2+9w?= =?us-ascii?Q?u1pbbK15ER2JM6eYtoz9BxrDoJzT?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-ID: <758995DAF74A7547A105D0B118095144@namprd19.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: health.ucsd.edu X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR19MB2581.namprd19.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d035947-91d3-407a-9970-08d93e55e5f3 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jul 2021 19:08:09.9955 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: e470d736-e7f7-41a8-8eab-dad544b2b579 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: JtRHGI7kx7ichPDCYk2yVQUngX5DNW9GlyXAHK5iA0xtRUbteJXTnCpADIDVsOeRDHjJzTfLvatIhQ3S0pFJsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR19MB4431 X-Proofpoint-ORIG-GUID: sXG7hvnM3VayFEt8mcaWLRAVlgrRf-9D X-Proofpoint-GUID: sXG7hvnM3VayFEt8mcaWLRAVlgrRf-9D X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-03_07:2021-07-02, 2021-07-03 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1011 adultscore=0 impostorscore=0 mlxlogscore=763 mlxscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 spamscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107030119 Received-SPF: pass client-ip=148.163.133.170; envelope-from=ccberry@health.ucsd.edu; helo=mx0a-00395d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" Reply-to: "Berry, Charles" From: "Berry, Charles" via "General discussions about Org-mode." X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625339325; 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-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=cwSb8M+cpP0VNP6PD+Ga9ouHaUEJl5tHnGX+vYmtf0k=; b=VkAsOfi8oFrqY938PcUcRI3jcC3Q/sqqBckPToPz3dlyX6o7zkbA1WFjUHD9eRrVl83tXa gZ0xNsKfOa7nPKRZ+st/pvSjp3esmZKovKF9QfZHgZrahq5fIouXAu+IIFk6t8g9wpuDMz rc56aX3RV5GVXAB4nkWeRdFACdBrFOKxzzTAe6Ynif9WOCFeMNHoC/mc7xoEBczfBWjtEj sX3NWZp67ROcqLp7Bf5UuzO71cSfBpRq8psLXSo566hqcNtACcy5JpqwrPay6PKklpbwnH AzsYbm1odumb5GIra96FCwCN3zIts+WCstJKvx2lt0PezlLHC79XohOOWR8ZnA== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1625339325; a=rsa-sha256; cv=fail; b=MH0FIMrKXErzge4Z2+HmzTx1qi0pqC1QMd6ggoQVKF22Bq6OdhmtD6aS3kZ4IL1/tY8ak6 ULy230/ZpUwyeiaahmzzNCMcRH+UHeeBOHXVC09Z/wpaLGvwX2jHD7UvlYETELpyR7iaH7 8dsVdkmBvtItyK2msvv6WB7lh90GxZG0WvR85+0+rJ215BKJQngOFntX2rMvqkdCtHiAMh PjU5ioXAU8YilVESvWDw1JZPDHfMREhWc0FmYxrjFn74YsV9K2kxsW2nwPxYyTS+TqRLIS fBo5H+IwZTlWHTg9hOUNmP1LnXxdGSWpHNAlaXAroBWWzylkCXm/xwCLJDejmg== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ucsd.edu header.s=campus header.b=C2Qn0+6n; dkim=fail ("headers rsa verify failed") header.d=ucsdhs.onmicrosoft.com header.s=selector2-ucsdhs-onmicrosoft-com header.b=2mdMiAfO; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -0.91 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ucsd.edu header.s=campus header.b=C2Qn0+6n; dkim=fail ("headers rsa verify failed") header.d=ucsdhs.onmicrosoft.com header.s=selector2-ucsdhs-onmicrosoft-com header.b=2mdMiAfO; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 8398B16949 X-Spam-Score: -0.91 X-Migadu-Scanner: scn0.migadu.com X-TUID: aoMS3DWsswtR > On Jul 3, 2021, at 9:35 AM, Greg Minshall wrote: >=20 > hi. >=20 > i am trying to simplify adding regression test cases to a program. >=20 > to generate the base, "compared-to" results, i want to write some code > in a source block, then evaluate it, producing the "true" value. >=20 > then, later during development, i want to check if the code that ran in > that block gives the same results. to do this, i preface the test check > block with, e.g., =3D:var fu=3Dbar=3D. obviously, i do *not* want to > re-create the base results; so, after producing the base case results, i > tried marking the source block that produces the results =3D:eval never= =3D. >=20 > but, doing that, using `:var fu=3Dbar` on a test check source block, fu's > value is nil. (*) >=20 > is there a way to convince org-mode to, in the face of =3D:eval never=3D,= go > ahead and pass the *previous* results? or, some other idea of how to do > this? there will be a large number of these test cases. >=20 > cheers, Greg Greg, I think it would be easier to leave :eval alone and instead evaluate the sr= c block using `org-babel-ref-resolve' and compare to the current value. Som= ething like this is a start: #+begin_src emacs-lisp (defun org-babel-read-named-result (blkname) (save-excursion (org-babel-goto-named-result blkname) (org-babel-read-result))) #+end_src #+begin_src emacs-lisp (defun compare-old-to-new (refname) (let ((new (org-babel-ref-resolve refname)) (old (org-babel-read-named-result refname))) (or (equal old new) (format "Comparison failed for block %s" refname)))) #+end_src Then eval'ing `(compare-old-to-new "testcountsdecompose")` for the ECM you = gave will give `t` if the result is the same and return a string saying whi= ch block failed the test. I suppose you could loop thru `(org-babel-src-block-names)` if you want to = check all the named blocks in a file. HTH, Chuck >=20 > (*) this is sort of confusing, so here's an example: >=20 > #+begin_src org > ,#+name: testcountsdecompose > ,#+begin_src R :eval never > mtcars[1:3,] > ,#+end_src >=20 > ,#+RESULTS: testcountsdecompose > | 21 | 6 | 160 | 110 | 3.9 | 2.62 | 16.46 | 0 | 1 | 4 | 4 | > | 21 | 6 | 160 | 110 | 3.9 | 2.875 | 17.02 | 0 | 1 | 4 | 4 | > | 22.8 | 4 | 108 | 93 | 3.85 | 2.32 | 18.61 | 1 | 1 | 4 | 1 | >=20 > ,#+name: testcounts > ,#+header: :var testcountsdecompose=3Dtestcountsdecompose :results outpu= t > ,#+begin_src R > str(testcountsdecompose) > ,#+end_src >=20 > ,#+RESULTS: testcounts > : chr "nil" > #+end_src >=20 > whereas, if the =3Dtestcountsdecompose=3D source block does *not* have > =3D:eval never=3D, my =3Dtestcountsdecompse=3D variable has all the rows = and > columns i was hoping for. >=20 >=20