guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#55845] [PATCH 1/1] ui: Improve pager selection logic when less is n


From: Taiju HIGASHI
Subject: [bug#55845] [PATCH 1/1] ui: Improve pager selection logic when less is not installed.
Date: Thu, 09 Jun 2022 19:23:20 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]