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 MHOnACzkm2HsAgEAgWs5BA (envelope-from ) for ; Mon, 22 Nov 2021 19:40:44 +0100 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 IJLyNyvkm2GMXQAA1q6Kng (envelope-from ) for ; Mon, 22 Nov 2021 18:40:43 +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 C631A2DE3A for ; Mon, 22 Nov 2021 19:40:42 +0100 (CET) Received: from localhost ([::1]:37084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mpEF8-0006P1-0r for larch@yhetil.org; Mon, 22 Nov 2021 13:40:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpECa-0006OH-4A for emacs-orgmode@gnu.org; Mon, 22 Nov 2021 13:38:04 -0500 Received: from sender4-op-o14.zoho.com ([136.143.188.14]:17483) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpECV-0000Ci-7q for emacs-orgmode@gnu.org; Mon, 22 Nov 2021 13:38:01 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1637606268; cv=none; d=zohomail.com; s=zohoarc; b=HBhL8Mu5oR3vM6pnAQAJWDJlqhlrQYcr8VRSJsDFauDFC0BmhZeMXiCkkwY5h6/owZdeAbNbtC/nF83l7VYZxQ6HBwuVxs0jxsMkbx9vaWcw+VJseRqZt1DDwgaK4LuUmCrmT6TZ2r2xJdYztVhUoGh9ewInt+UqHNwUpIAJh/A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637606268; h=Content-Type:Date:From:MIME-Version:Message-ID:Subject:To; bh=aJ6Ubxl7ruWW7GqV8jR2pTJnL9QUWDs7N1Q9U2slsHM=; b=JT/33JrzU7dcw+AmAyPrDNzIFZhEPbYCmA/CUJ4Coz0i9tAwkgxH/Pdnl/vTS8sAWi/uu7T5qKdMgcZOF3grQDN2k8vFnrGlvi23ATMZH4T+OpSL2QSX8LvKVD4vY1kALlLb3xB7jVGYBrSJPXpxrZdSLdJcuovuQtHhmRGwZYk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=excalamus.com; spf=pass smtp.mailfrom=matt@excalamus.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1637606268; s=zmail; d=excalamus.com; i=matt@excalamus.com; h=Date:From:To:Message-Id:In-Reply-To:Subject:MIME-Version:Content-Type; bh=aJ6Ubxl7ruWW7GqV8jR2pTJnL9QUWDs7N1Q9U2slsHM=; b=YJiDqF+KTzP6qWz/7W1mjyKy1wFFxsyFDCamzv1K2UcIrXBRCmGjjPINy0Kv9PuA Qlpg1VMAUz3F4JyjMbZiI8uqHH2duxoQK6U06HBpLtqtBp9qWA/fKdLDkKYhx5Eq3ZD YVtT1UNf3CP3BxQqAklQr/nr/DIiWSnP3fGBE1Fk= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1637606266736781.845573619872; Mon, 22 Nov 2021 10:37:46 -0800 (PST) Date: Mon, 22 Nov 2021 13:37:46 -0500 From: Matt To: "emacs-orgmode" Message-Id: <17d48f09729.ddbece82213631.8340272801066201269@excalamus.com> In-Reply-To: Subject: [PATCH] ob-shell-test, test-ob-shell and introduction MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_669329_383381307.1637606266665" Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail X-Zoho-Virus-Status: 1 Received-SPF: pass client-ip=136.143.188.14; envelope-from=matt@excalamus.com; helo=sender4-op-o14.zoho.com 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" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637606443; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=aJ6Ubxl7ruWW7GqV8jR2pTJnL9QUWDs7N1Q9U2slsHM=; b=SCJPgDuxqXTIe2elH5r3rUOwZaWrpOG9W6iy8HQNbUfHNAhVBlbCw/pBJ2qPlGauMs0p7I BX78yicnr6Rv7ZhZ69yHX3rWghvh08U/pm5FiDSad0LngP2LGryjKrlp4JEOpEPaA46BKI dnfXHIOFOCXnhA7E5HwufwWkGOAFuw0aDSDHt1Pa1doLNe6biCAbvnaPRUHEqxvV1KB0/g aNsyaPeLgANMzni/XlIPvfJzifvJmstSSzW4RNR4oAODUF03JJmK715gpQ1Np8f6unVawn d1Fcn+55gejA7HPWlSXO4HQkfHq/AT231NBPcllj75E85INgaMF/f/NaX+j8aQ== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1637606443; a=rsa-sha256; cv=pass; b=f4fdEismOZBKFN3lZtQc1ZQDALRcy2WJLer3aUHxM+Kx3wxwRGshUOHk+XgmS4gRG9qF6U 4H3b1ak9WQ5OqXEFblgamRjmJQMxWvVH+R0JtwmPODzBZeZJJgWAcWfa5pvPbPW37CSR1k u++pWn+9GAqckCOYj7V2G8xBWlmKfeM52JsnDu2cTn7XbnFBQLvz9IGNVFpS43jVSviliE n8+mBVZDVxRuqcZv9yViro4kudS+r9QQIzHDFOcM6hZEJnum4/ATG+L4/TSoLhupQ2Gn60 FS1wXVbkr/6B3oPQlTT6pB1G7CWBYYj4H+EpEoD4yZ7qwh6wjQBVoQq5ZqdQ3w== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=excalamus.com header.s=zmail header.b=YJiDqF+K; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=none; 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: -4.57 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=excalamus.com header.s=zmail header.b=YJiDqF+K; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=none; 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: C631A2DE3A X-Spam-Score: -4.57 X-Migadu-Scanner: scn0.migadu.com X-TUID: TGazy7IqzpSE ------=_Part_669329_383381307.1637606266665 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Hi, I'm interested in getting async into ob-shell.el. Since I've never contributed before, I figure it'd be good to start with a few easy tasks. It looks to me like the stdin and cmdline header args aren't documented anywhere (at least I couldn't find anything). To make sure I'm using them correctly before making a patch for the manual, here are some tests. Please let me know if things look okay. It wasn't clear to me how to send along a message with git send-email, so I formatted these patches and included them as an attachment. Is that fine? Thanks, Matt ------=_Part_669329_383381307.1637606266665 Content-Type: application/octet-stream; name=0001-ob-shell-test.org-Add-example-for-stdin.patch Content-Transfer-Encoding: 7bit X-ZM_AttachId: 138568990666670040 Content-Disposition: attachment; filename=0001-ob-shell-test.org-Add-example-for-stdin.patch >From b59ec4c2d949ca4c2d881238393a8de3851315db Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 22 Nov 2021 13:07:53 -0500 Subject: [PATCH 1/2] ob-shell-test.org: Add example for stdin * ob-shell-test.org Add section for testing header args. --- testing/examples/ob-shell-test.org | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/testing/examples/ob-shell-test.org b/testing/examples/ob-shell-test.org index 2510f4f96..39539dc9f 100644 --- a/testing/examples/ob-shell-test.org +++ b/testing/examples/ob-shell-test.org @@ -86,3 +86,22 @@ echo ${table[spaghetti]} #+RESULTS: : 20 cm +* Header arg tests + :PROPERTIES: + :ID: cc56f3c6-13ec-4026-9d83-3106efd833e2 + :END: + +** stdin +#+name: an-org-reference +org reference line 1 +org reference line 2 + +#+begin_src sh :stdin an-org-reference :results output +cat +#+end_src + +#+RESULTS: +: org reference line 1 +: org reference line 2 + + -- 2.34.0 ------=_Part_669329_383381307.1637606266665 Content-Type: application/octet-stream; name=0002-test-ob-shell.el-Add-tests-for-stdin-and-cmdline-hea.patch Content-Transfer-Encoding: 7bit X-ZM_AttachId: 138568990666810010 Content-Disposition: attachment; filename=0002-test-ob-shell.el-Add-tests-for-stdin-and-cmdline-hea.patch >From b923d17679ba9c7cb88dd40312534c33eff74dd8 Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 22 Nov 2021 13:14:01 -0500 Subject: [PATCH 2/2] test-ob-shell.el: Add tests for stdin and cmdline header args * test-ob-shell.el (test-ob-shell/stdin, test-ob-shell/cmdline) Add tests. --- testing/lisp/test-ob-shell.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/testing/lisp/test-ob-shell.el b/testing/lisp/test-ob-shell.el index 2f346f699..b9fcb3819 100644 --- a/testing/lisp/test-ob-shell.el +++ b/testing/lisp/test-ob-shell.el @@ -106,6 +106,19 @@ ob-comint.el, which was not previously tested." "#+BEGIN_SRC sh :results output :var l='(1 2)\necho ${l}\n#+END_SRC" (org-trim (org-babel-execute-src-block)))))) +(ert-deftest test-ob-shell/stdin () + "Confirm stdin passes an org reference" + (org-test-at-id "cc56f3c6-13ec-4026-9d83-3106efd833e2" + (org-babel-next-src-block) + (should (equal "org reference line 1\norg reference line 2" + (org-trim (org-babel-execute-src-block)))))) + +(ert-deftest test-ob-shell/cmdline () + "Confirm cmdline header gets passed in as an argument." + (let ((res (org-babel-execute:sh "echo $1;" '((:cmdline . "foo"))))) + (should res) + (should (equal "foo" res)))) + (provide 'test-ob-shell) ;;; test-ob-shell.el ends here -- 2.34.0 ------=_Part_669329_383381307.1637606266665--