From 8fc98295cb22cf179ba6805872e545921d080745 Mon Sep 17 00:00:00 2001 From: aycabta Date: Fri, 25 Jun 2021 18:04:27 +0900 Subject: [PATCH] [ruby/reline] Add Terminfo tests https://github.com/ruby/reline/commit/17721e477e --- test/reline/test_terminfo.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/reline/test_terminfo.rb diff --git a/test/reline/test_terminfo.rb b/test/reline/test_terminfo.rb new file mode 100644 index 0000000000..6f98591b15 --- /dev/null +++ b/test/reline/test_terminfo.rb @@ -0,0 +1,24 @@ +require_relative 'helper' +require "reline" + +class Reline::Terminfo::Test < Reline::TestCase + def setup + Reline::Terminfo.setupterm(0, 2) + end + + def test_tigetstr + assert Reline::Terminfo.tigetstr('khome') + end + + def test_tiparm + assert Reline::Terminfo.tigetstr('khome').tiparm + end + + def test_tigetstr_with_param + assert Reline::Terminfo.tigetstr('cuu').include?('%p1%d') + end + + def test_tiparm_with_param + assert Reline::Terminfo.tigetstr('cuu').tiparm(4649).include?('4649') + end +end if Reline::Terminfo.enabled?