File: test-terminal-properties.rb

package info (click to toggle)
ruby-gnome 4.3.4-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,320 kB
  • sloc: ruby: 55,206; ansic: 29,012; xml: 333; sh: 227; cpp: 45; makefile: 42
file content (93 lines) | stat: -rw-r--r-- 2,646 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Copyright (C) 2014-2015  Ruby-GNOME2 Project Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

class TestTerminalProperties < Test::Unit::TestCase
  include VteTestUtils

  def setup
    @terminal = Vte::Terminal.new
  end

  def test_allow_bold
    @terminal.allow_bold = false
    assert_false(@terminal.allow_bold?)
  end

  def test_audible_bell
    @terminal.audible_bell = false
    assert_false(@terminal.audible_bell?)
  end

  def test_backspace_binding
    bind = Vte::EraseBinding::DELETE_SEQUENCE
    @terminal.backspace_binding = bind
    assert_equal(bind, @terminal.backspace_binding)
  end

  def test_cursor_blink_mode
    cursor_mode = Vte::CursorBlinkMode::ON
    @terminal.cursor_blink_mode = cursor_mode
    assert_equal(cursor_mode, @terminal.cursor_blink_mode)
  end

  def test_cursor_shape
    shape = Vte::CursorShape::IBEAM
    @terminal.cursor_shape = shape
    assert_equal(shape, @terminal.cursor_shape)
  end

  def test_delete_binding
    bind = Vte::EraseBinding::ASCII_DELETE
    @terminal.delete_binding = bind
    assert_equal(bind, @terminal.delete_binding)
  end

  def test_encoding
    encoding = "UTF-16"
    @terminal.encoding = encoding
    assert_equal(encoding, @terminal.encoding)
  end

  def test_font_desc
    font = Pango::FontDescription.new("Monospace 15")
    @terminal.font_desc = font
    assert_equal(font, @terminal.font_desc)
  end

  def test_pointer_autohide
    hide = true
    @terminal.pointer_autohide = hide
    assert_true(@terminal.pointer_autohide?)
  end

  def test_scroll_on_keystroke
    scroll = true
    @terminal.scroll_on_keystroke = scroll
    assert_true(@terminal.scroll_on_keystroke?)
  end

  def test_scroll_on_output
    scroll = false
    @terminal.scroll_on_output = scroll
    assert_false(@terminal.scroll_on_output?)
  end

  def test_scrollback_lines
    lines = 1024
    @terminal.scrollback_lines = lines
    assert_equal(lines, @terminal.scrollback_lines)
  end
end