From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by bl2.djc.id.au (Postfix, from userid 1000) id 310CA27E166; Mon, 05 Oct 2026 21:16:55 +1100 (AEDT) Date: Mon, 05 Oct 2026 21:16:55 +1100 To: sup-commits@supmua.dev Subject: [sup.git] branch develop updated: tests: fix TestLineCursorMode failures due to Ncurses.tigetflag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <179119541508.285799.7362928622543157052@bl2.djc.id.au> Reply-To: Dan Callaghan X-Git-Host: bl2.djc.id.au X-Git-Repo: sup.git X-Git-Refname: refs/heads/develop X-Git-Reftype: branch X-Git-Oldrev: d21b4bebeb134b1cccefdb1c669542cc2d109b3e X-Git-Newrev: a17638d388636713308d320d5a826c1ef2a0e398 X-Git-Rev: a17638d388636713308d320d5a826c1ef2a0e398 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.7.dev Auto-Submitted: auto-generated From: Dan Callaghan List-Id: 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 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