File: test_gtk_tree_path.rb

package info (click to toggle)
ruby-gnome2 3.1.0-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 16,072 kB
  • ctags: 17,433
  • sloc: ansic: 93,621; ruby: 62,273; xml: 335; sh: 246; makefile: 25
file content (20 lines) | stat: -rw-r--r-- 499 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class TestGtkTreePath < Test::Unit::TestCase
  include GtkTestUtils

  def test_compare
    assert_equal(-1, tree_path("0") <=> tree_path("1"))
    assert_equal(0, tree_path("0") <=> tree_path("0"))
    assert_equal(1, tree_path("1") <=> tree_path("0"))
  end

  def test_equal
    assert_equal(tree_path("0"), tree_path("0"))
    assert_not_equal(tree_path("0"), tree_path("1"))
    assert_not_equal(tree_path("0"), "0")
  end

  private
  def tree_path(path)
    Gtk::TreePath.new(path)
  end
end