[COMMIT LOGREPORT] service/all/lib/tests UIPrefsTest.pm,1.14,1.15
Wolfgang Sourdeau
wsourdeau at users.sourceforge.net
Fri Apr 29 02:36:33 CEST 2005
Update of /cvsroot/logreport/service/all/lib/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8034/all/lib/tests
Modified Files:
UIPrefsTest.pm
Log Message:
- make sure that the cursor in the help window is reset to its highest
position everytime a new option is selected;
Index: UIPrefsTest.pm
===================================================================
RCS file: /cvsroot/logreport/service/all/lib/tests/UIPrefsTest.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- UIPrefsTest.pm 4 Jun 2004 15:50:29 -0000 1.14
+++ UIPrefsTest.pm 29 Apr 2005 00:36:31 -0000 1.15
@@ -256,7 +256,7 @@
my $opt_summary = $driver->find_widget( '/prefs_win/option_summary' );
$self->assert_str_equals( 'Test Summary', $opt_summary->text() );
my $opt_help = $driver->find_widget( '/prefs_win/option_help' );
- $self->assert_str_equals( 'Test Description', $opt_help->text() );
+ $self->assert_str_equals( 'Test Description', $opt_help->text() );
my $opt_widget =
$driver->find_widget( '/prefs_win' )->getobj( 'option_widget' );
@@ -272,7 +272,30 @@
$options->{'-selected'} = 2;
Lire::UI::Prefs::_option_change_cb( $options );
- $self->assert_str_equals( 'Summary with newlines and wawas', $opt_summary->text() );
+ $self->assert_str_equals( 'Summary with newlines and wawas',
+ $opt_summary->text() );
+
+ my $texteditor = '<undef>';
+ my $nothing = '<undef>';
+ my $scrollpos = 0;
+
+ no warnings 'redefine';
+ local *Curses::UI::TextEditor::cursor_up =
+ sub { $texteditor = shift; $nothing = shift; $scrollpos = shift; };
+
+ $opt_help->{'-yscrpos'} = 1;
+ $options->{'-selected'} = 1;
+ Lire::UI::Prefs::_option_change_cb( $options );
+
+ $self->assert_str_equals( '<undef>', $texteditor );
+
+ $opt_help->{'-yscrpos'} = 3;
+ $options->{'-selected'} = 2;
+ Lire::UI::Prefs::_option_change_cb( $options );
+
+ $self->assert_str_equals( $opt_help, $texteditor );
+ $self->assert_null( $nothing );
+ $self->assert_num_equals( 3, $scrollpos );
return;
}
--
To UNSUBSCRIBE, email to commit-request at logreport.org with a subject of
"unsubscribe". Trouble? Send an email with subject "help" to
commit-request at logreport.org
More information about the Commit
mailing list