From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id qMJ6JJZNomKkTQAAbAwnHQ (envelope-from ) for ; Thu, 09 Jun 2022 21:44:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id AL3EI5ZNomI3ZAEAG6o9tA (envelope-from ) for ; Thu, 09 Jun 2022 21:44:22 +0200 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 29375F7D3 for ; Thu, 9 Jun 2022 21:44:22 +0200 (CEST) Received: from localhost ([::1]:37060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzO4r-0006Fn-8T for larch@yhetil.org; Thu, 09 Jun 2022 15:44:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzO4Y-0006Dz-9g for guix-patches@gnu.org; Thu, 09 Jun 2022 15:44:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53944) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzO4Y-0000mA-0L for guix-patches@gnu.org; Thu, 09 Jun 2022 15:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nzO4X-0001m0-T2 for guix-patches@gnu.org; Thu, 09 Jun 2022 15:44:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55845] [PATCH 1/1] ui: Improve pager selection logic when less is not installed. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 09 Jun 2022 19:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55845 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Taiju HIGASHI Cc: 55845@debbugs.gnu.org, me@tobias.gr Received: via spool by 55845-submit@debbugs.gnu.org id=B55845.16548038086763 (code B ref 55845); Thu, 09 Jun 2022 19:44:01 +0000 Received: (at 55845) by debbugs.gnu.org; 9 Jun 2022 19:43:28 +0000 Received: from localhost ([127.0.0.1]:47841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzO3z-0001l1-LG for submit@debbugs.gnu.org; Thu, 09 Jun 2022 15:43:27 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:59514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzO3w-0001kr-UG for 55845@debbugs.gnu.org; Thu, 09 Jun 2022 15:43:25 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id h7jM270024UW6Th067jMLc; Thu, 09 Jun 2022 21:43:23 +0200 Message-ID: <5ccb68a4dc80a02baaf6d19fd782145b6b62e7b5.camel@telenet.be> From: Maxime Devos Date: Thu, 09 Jun 2022 21:43:11 +0200 In-Reply-To: <874k0uxhif.fsf@taiju.info> References: <20220608102124.14865-1-higashi@taiju.info> <20220608102257.15042-1-higashi@taiju.info> <87leu72sbo.fsf@taiju.info> <55fe6cdbed891707aca419ff4eedd7c37ef3eb03.camel@telenet.be> <87fskexiyc.fsf@taiju.info> <874k0uxhif.fsf@taiju.info> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-SiXOPGSiks623RpUtbtt" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1654803803; bh=Rc7Nh1TXX4u1XxqvAnUNgLABTNZHcrheLka+62RhjFU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=XGrckfMKuMcwzFo8AzsmHQ+uoN9DxqBJSEJtOWuLzpBQf4QEWd4w0G19GN+55/ifB 092FwIcigXwUnHaEOjH48OR1EjblDMgLLK0Jczt0tSJdejETJZbgCJ6LxK1hd75Qfk Bv3Xx2BX7CiuN4oGttKs24tzrpgUDEJ+YN01hxpbC/jBEEmTwk4tCLLOUUte8rIeIo kpzatOrq+4xRCPBti4pZQB7Cp0ji2Fa2XYrK2az8B5bwZDxLntyKhyaxXPV+JdfpW1 tPls8yHJzoFDUsGorT1trpav3cEdBEg6t/tkO37qQH3XAo/By0rKmrePbBqydv9bFb gbXLaqWzlazxw== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1654803862; 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:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=Rc7Nh1TXX4u1XxqvAnUNgLABTNZHcrheLka+62RhjFU=; b=unlKVgv8bve01K1UZfWvghojPJJDz6A8+uenAK28TzmrefNNzZT8TF9RbihWi8oEuLWGmG p/ZNxauyd/6+jSHUOJB6SDtbG+rvzYOB8fAkh/ttv2N3LtGsyOJK42UCS2WxMs9ndZklEw 2/+0tFgvzaQRKHNiG5pG2vJBLgJ3kcUsslrhJIDaH+o0XBJz88cTHSgKwr72UdbiUqXm/4 1pQ5zlsd+Q6b70wEf4faXcfdEoYSOjKtY5hpOO8DJTKj0ZO6wn25rNJDtqRVpOPt6vqNbb LUDvne62fZpFcqjtxaKJKQiQKBoj6vpYfTDUrKnjSo5EOPaCmJSHiDWZLJwf5g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654803862; a=rsa-sha256; cv=none; b=P9Sox5OruMXfdPuVvm5P8kSl7/SlF7wbRxDsELOOFvvNCb2M1foU0qQgfCbGoXtN8uk8Bu 8F2KyXFfl1qihgG97Nk4AKcqv3LkT4mmoWNR0O1DFqu4zZ2KXKba4f/xl2T+0aKzHk+UwL xV3Ck84m0dl/xlf6+MOe70kri0UrwI1qLiSVLk3tf2yf2IiZXhCaEUbm5pQSUFfV/4duMO cfSpfL7HalDhmgwuCtCdm8zqtU68EJc5bQiNXPW8sw1N6UcP3+S+xnHIZVi48k+wkOKaim y0H3aseeoENEnsutIh4GzuvafuuRHYIe4w9hJ/jXzvWhn8YN9jY8EkecI7wSfQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=XGrckfMK; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.40 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=XGrckfMK; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 29375F7D3 X-Spam-Score: 5.40 X-Migadu-Scanner: scn0.migadu.com X-TUID: wr1OJReaZVAv --=-SiXOPGSiks623RpUtbtt Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Taiju HIGASHI schreef op do 09-06-2022 om 19:23 [+0900]: > Hi Maxime, >=20 > I tried to mock open-pipe* and isatty?* using the mock macro and also > add a test to inspect the program coming across to open-pipe*, but gave > up because I could not get the return value of the > with-paginated-output-port macro. The return value of 'with-paginated-output-port' is just whatever the last expression put in that macro evaluates to. Also 'close-pipe' needs to be mocked, otherwise an error will result. Try: (test-assert "with-paginated-output-port: finds less in PATH" (call-with-temporary-directory (lambda (dir) (define used-command #false) (with-environment-variables `(("PATH" ,dir)) (make-dummy-executable-file dir "less") (mock ((ice-9 popen) open-pipe* (lambda (mode command . args) (when used-command ; <--- an extra test (error "open-pipe* should only be called once")) (set! used-command command) ; <--- this captures the passe= d command (%make-void-port ""))) ; return a dummy port (mock ((ice-9 popen) close-pipe (const 'ok)) (mock ((guix colors) isatty?* (const #t)) (with-paginated-output-port port 'ok))))) (and (pk 'used-command used-command dir) ; <-- fails on my computer b= ecause a non-absolute path is passed and I haven't applied our patch (string=3D? (in-vicinity dir "less") used-command))))) Greetings, Maxime. --=-SiXOPGSiks623RpUtbtt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqJNTxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7nF9AP986LcNcjteB3h9iqA1wZE9CG4d n/ttr1mi/ndsa2VRFAEAtgBnEHTdT1TPYRdbePVeQsfsLvKYrhag+OO4vZJsfAY= =YEyy -----END PGP SIGNATURE----- --=-SiXOPGSiks623RpUtbtt--