Commit notifications for all Sup repositories
 help / color / mirror / Atom feed
From: Dan Callaghan <dan@bl2.djc.id.au>
To: sup-commits@supmua.dev
Subject: [sup.git] branch develop updated: tests: fix TestLineCursorMode failures due to Ncurses.tigetflag
Date: Mon, 05 Oct 2026 21:16:55 +1100	[thread overview]
Message-ID: <179119541508.285799.7362928622543157052@bl2.djc.id.au> (raw)

Pushed a commit to branch develop:
https://supmua.dev/git/sup/commit/a17638d388636713308d320d5a826c1ef2a0e398.html

The following commit(s) were added to refs/heads/develop by this push:
     new a17638d3 tests: fix TestLineCursorMode failures due to Ncurses.tigetflag
a17638d3 is described below

commit a17638d388636713308d320d5a826c1ef2a0e398
Author: Dan Callaghan <djc@djc.id.au>
AuthorDate: Mon Oct 5 21:13:42 2026 +1100

    tests: fix TestLineCursorMode failures due to Ncurses.tigetflag
    
    The previous commit d21b4bebeb134b1cccefdb1c669542cc2d109b3e introduced
    a call to Ncurses.tigetflag in BufferManager, but that method is only
    defined after Ncurses.initscr or Ncurses.newterm have been called.
    
    Fix TestLineCursorMode to initialise a dummy ncurses terminal on
    /dev/null so that BufferManager can work in unit tests.
    
        TestLineCursorMode#test_jump_to_end:
        NoMethodError: undefined method `tigetflag' for Ncurses:Module
    
            @have_xterm_title = Ncurses.tigetflag("XT") > 0 || ENV["TERM"] =~ /(screen|tmux)/
                                       ^^^^^^^^^^
            lib/sup/buffer.rb:154:in `initialize'
            lib/sup/util.rb:594:in `new'
            lib/sup/util.rb:594:in `init'
            test/unit/test_line_cursor_mode.rb:13:in `setup'
---
 test/unit/test_line_cursor_mode.rb | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/test/unit/test_line_cursor_mode.rb b/test/unit/test_line_cursor_mode.rb
index d22221c4..e8482db4 100644
--- a/test/unit/test_line_cursor_mode.rb
+++ b/test/unit/test_line_cursor_mode.rb
@@ -10,6 +10,9 @@ class TestLineCursorMode < Minitest::Test
       :load_more_threads_when_scrolling => true,
       :continuous_scroll => false,
     }
+    @out = File.open File::NULL, "w"
+    @inp = File.open File::NULL, "r"
+    @screen = Ncurses.newterm "dumb", @out, @inp
     Redwood::BufferManager.init
     @modes_to_cleanup = []
     @lines = []
@@ -20,6 +23,9 @@ class TestLineCursorMode < Minitest::Test
   def teardown
     @modes_to_cleanup.each { |mode| mode.cleanup }
     Redwood::BufferManager.deinstantiate!
+    Ncurses.delscreen @screen
+    @inp.close
+    @out.close
     $config = nil
   end
 

                 reply	other threads:[~2026-10-05 10:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179119541508.285799.7362928622543157052@bl2.djc.id.au \
    --to=dan@bl2.djc.id.au \
    --cc=djc@djc.id.au \
    --cc=sup-commits@supmua.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox