# -*- coding: utf-8 -*- $cairo = true require File.expand_path(File.dirname(__FILE__) + '/../helper') # require File.expand_path(File.dirname(__FILE__) + '/../utils') miquire :mui, 'textselector' $debug = true # !> instance variable @textselect_start not initialized # seterrorlevel(:notice) $logfile = nil $daemon = false class MockPainter include Gdk::TextSelector def on_modify end end class TC_TextSelector < Test::Unit::TestCase S1 = 'this is a test text'.freeze S2 = 'escape > text' S3 = 'にほんごもじれつ' S4 = 'エンティティのテスト <<<< &&&& >>> ておくれ' S5 = 'fav' S6 = <is is a test text', mp.textselector_press(2).textselector_release(12).textselector_markup(S1)) assert_equal('this is a test text', mp.textselector_press(2).textselector_release(6).textselector_markup(S1)) assert_equal('this is a test text', mp.textselector_press(2).textselector_release(18).textselector_markup(S1)) assert_equal('escape > text', mp.textselector_press(4).textselector_release(9).textselector_markup(S2)) assert_equal('にほんごもじれつ', mp.textselector_press(2).textselector_release(5).textselector_markup(S3)) assert_equal('エンティティのテス <<<< &&&& >>> ておくれ', mp.textselector_press(9).textselector_release(10).textselector_markup(S4)) assert_equal('エンティティのテス<<<< &&&& >>> ておくれ', mp.textselector_press(9).textselector_release(11).textselector_markup(S4)) assert_equal('エンティティのテスト <<<< &&&& >>> ておくれ', mp.textselector_press(9).textselector_release(12).textselector_markup(S4)) end end # >> Loaded suite - # >> Started # >> . # >> Finished in 0.002221 seconds. # >> # >> 1 tests, 5 assertions, 0 failures, 0 errors