mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/reline] Add Terminfo tests
https://github.com/ruby/reline/commit/17721e477e
This commit is contained in:
parent
2a7e86844b
commit
8fc98295cb
1 changed files with 24 additions and 0 deletions
24
test/reline/test_terminfo.rb
Normal file
24
test/reline/test_terminfo.rb
Normal file
|
@ -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?
|
Loading…
Reference in a new issue