From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0BhpMJPsoWKaegAAbAwnHQ (envelope-from ) for ; Thu, 09 Jun 2022 14:50:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id oEY5MJPsoWIZZwEAauVa8A (envelope-from ) for ; Thu, 09 Jun 2022 14:50:27 +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 73CCC9C29 for ; Thu, 9 Jun 2022 14:50:27 +0200 (CEST) Received: from localhost ([::1]:34054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzHcI-0002EJ-3a for larch@yhetil.org; Thu, 09 Jun 2022 08:50:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzFKg-0008DE-Cq for guix-patches@gnu.org; Thu, 09 Jun 2022 06:24:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51169) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzFKc-00011u-Ub for guix-patches@gnu.org; Thu, 09 Jun 2022 06:24:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nzFKc-0001VW-RA for guix-patches@gnu.org; Thu, 09 Jun 2022 06:24:02 -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: Taiju HIGASHI Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 09 Jun 2022 10:24:02 +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: Maxime Devos Cc: 55845@debbugs.gnu.org, me@tobias.gr Received: via spool by 55845-submit@debbugs.gnu.org id=B55845.16547702125740 (code B ref 55845); Thu, 09 Jun 2022 10:24:02 +0000 Received: (at 55845) by debbugs.gnu.org; 9 Jun 2022 10:23:32 +0000 Received: from localhost ([127.0.0.1]:45065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzFK8-0001UW-J1 for submit@debbugs.gnu.org; Thu, 09 Jun 2022 06:23:32 -0400 Received: from mail-pl1-f171.google.com ([209.85.214.171]:42756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzFK6-0001UH-0Z for 55845@debbugs.gnu.org; Thu, 09 Jun 2022 06:23:31 -0400 Received: by mail-pl1-f171.google.com with SMTP id f8so858902plo.9 for <55845@debbugs.gnu.org>; Thu, 09 Jun 2022 03:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=taiju-info.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=kuah/88OpMtYeQQMMC8Yin+pKGBc2zJA0c3aXe1j98s=; b=u05NTQwdlcnJ+NNqt88rwVxEPq9D2AnIiCXqh4ECRBkpgBjPkZtQ3YXrjgXCoddqFz GVXCjuboDAzTd9hqKUXidubVogYQL/kF43umCIBiMa/2ScMcAfRNqlH/ht6K+V10EmbX lwj2fZxXavYgdz/jxkoR8WGPREeopLSeoAn3EWvOy7OBzUYlFY1BkVZYb+Qel5N2n2Qf 766/cu1O5qoWIt2ML32n34GOTEJxpwwZuY3zj7pHb3A5emrNX2d8JIiAx+4+hPM3h2Qo GAI603+ermICqPSUe7+jDgakAlt/xB9jeRtwgOGAMci0teBVpI0YcuKKtBq7rSJsz36x nqqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=kuah/88OpMtYeQQMMC8Yin+pKGBc2zJA0c3aXe1j98s=; b=Uu3aJi8E4Jx9w2L3CHKnubL6M5qmsMcLm8KdhQKz69Ab9zNGR92o4TmZf8BxIA+5TA vAP41DhYT+sYqKaIZLz03rt82iO95JRIJI75+lq//CkoYxTwGlcUYvZvNx/Yuv49++kO 97LEAvM3VZDja9g4Kj+BnzAnuVzAM/lmoU4w7h0kXUmQaqG6yR/88dqNWHg8DdFzTvNc MKKZ2Vu51QHLKKbQIoixdfeHkFHd/TIuForOIrkj9vmptlNn/hklPMbtkpStei5BmpFs HpotWSWwL5XW00DfO9dmEVjMYu6l6ayD0dMx0lNN3QmPFzQ+WdWcZTBbq0nq7hmiNe3r Yygg== X-Gm-Message-State: AOAM531Jpqsa3NjntbT0JURfxjYwvRyydi0t6VgrENI78I4kkTwl/Xyu M7/xC8K560AqZrhEIxPHLUqNXO5fGRiy4Q42 X-Google-Smtp-Source: ABdhPJzzhX+Q8gG2GOUk8YE7QAxxN7MaHA2mS/fxNIUI3+EMHOtFC8Aik0wMjsKMKz2L2xQLyQQXwQ== X-Received: by 2002:a17:90a:b284:b0:1e3:826b:d11d with SMTP id c4-20020a17090ab28400b001e3826bd11dmr2780847pjr.79.1654770203943; Thu, 09 Jun 2022 03:23:23 -0700 (PDT) Received: from Taix ([240b:253:ec40:2400:b7d1:436e:2d61:e925]) by smtp.gmail.com with ESMTPSA id o4-20020a170902d4c400b0016230703ca3sm16598571plg.231.2022.06.09.03.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 03:23:23 -0700 (PDT) From: Taiju HIGASHI 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> Date: Thu, 09 Jun 2022 19:23:20 +0900 In-Reply-To: <87fskexiyc.fsf@taiju.info> (Taiju HIGASHI's message of "Thu, 09 Jun 2022 18:52:11 +0900") Message-ID: <874k0uxhif.fsf@taiju.info> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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=1654779027; 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=kuah/88OpMtYeQQMMC8Yin+pKGBc2zJA0c3aXe1j98s=; b=QI1xd8iTz9+pA+lK7TqLjZfFIF4xv0uY94ZS5BQmHRBVeMd2ql6A2NhoCAb+Fyo+d908h4 nnki8X7awv3Wc127xxW+/P+VAqhefmrIgt9PySc1+4pxljJ8N/54L0gDXTmv9QcJCCB4Sd KaN1hf3LUPsE2bqTxqYkassdEnlB9nEYARS3o7nVWIuaPc2PZAmWjZ3DnxL9Cq2zUULkin 2tOrN5y9c0Y3mYZ+mMGKfmTJZkkLLxwB3jEMrQ6vd092P2/b/OmrIMSLKkh9Zeshaa053/ HJ/h2AaUn/GZOwc12o7RJiWfOfaRZs42b4AxqNJANgme0RJ3Vsx941Mniy+NFA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654779027; a=rsa-sha256; cv=none; b=lUG0f/kIqdLhVZg8kDE2ppBjb38bFYUzmXqhr5mAj2/w8L11wAO1URh78XRG08J6KEUhYf R94k63SxW71LwL2Rr4Shu5kT0bjCuznvF6IYndBH/9J7OO3/TjwuqaeDi9B5wkIljM+KSz VhbuMZ95aXKdp2we1PRKUR+pkewIqWTl9WggNmKUz2WfsmfEiEvoZqyGxmCEiquF2KH0p0 ynPY3p7CJLF4jIO297iucL/TlLST9VI4P93L6jceWOtQf8OD9VNpr1yuhJYwlJ4oV18YJp VzjbKvyr6SYZHSNtticOcucjoPEIZCrakrEHkNEoH3BxdXRPaihsEN0oNKREjw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=taiju-info.20210112.gappssmtp.com header.s=20210112 header.b=u05NTQwd; dmarc=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: 1.69 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=taiju-info.20210112.gappssmtp.com header.s=20210112 header.b=u05NTQwd; dmarc=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: 73CCC9C29 X-Spam-Score: 1.69 X-Migadu-Scanner: scn0.migadu.com X-TUID: 2yjLLxtdk0g1 Hi Maxime, 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. I think we are one step closer, but it is not working. I will share a piece of code in the process of verification just in case. (test-equal "with-paginated-output-port" "less" (call-with-temporary-directory (lambda (dir) (with-environment-variables `(("PATH" ,dir)) (make-dummy-executable-file dir "less") (mock ((ice-9 popen) open-pipe* (lambda (mode command . args) (current-output-port))) (mock ((guix colors) isatty?* (const #t)) (with-paginated-output-port paginated "less"))))))) I have debugged that the return value of dynamic-wind is "less", but I could not successfully use it for assertions. I also tried to inspect the value of the command argument using test-equal in the open-pipe* mock replacement function, but it did not work. Is there a better way to do this? Thanks, -- Taiju