[COMMIT LOGREPORT] service/all/lib/tests UICompoundWidgetTest.pm,1.10,1.11

Wolfgang Sourdeau wsourdeau at users.sourceforge.net
Sat May 7 07:57:59 CEST 2005


Update of /cvsroot/logreport/service/all/lib/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17075/tests

Modified Files:
	UICompoundWidgetTest.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: UICompoundWidgetTest.pm
===================================================================
RCS file: /cvsroot/logreport/service/all/lib/tests/UICompoundWidgetTest.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- UICompoundWidgetTest.pm	10 Jul 2004 20:19:38 -0000	1.10
+++ UICompoundWidgetTest.pm	7 May 2005 05:57:56 -0000	1.11
@@ -167,6 +167,26 @@
 
     $self->assert_str_equals( 'string', $help_summary->text() );
     $self->assert_str_equals( 'No help available.', $help_viewer->text() );
+
+    my $texteditor = '<undef>';
+    my $nothing = '<undef>';
+    my $scrollpos = 0;
+
+    no warnings 'redefine';
+    local *Curses::UI::TextViewer::cursor_up =
+      sub { $texteditor = shift; $nothing = shift; $scrollpos = shift; };
+
+    $help_viewer->{'-yscrpos'} = 1;
+    Lire::UI::CompoundWidget::_child_focus_cb( $widget->getobj('list_widget') );
+
+    $self->assert_str_equals( '<undef>', $texteditor );
+
+    $help_viewer->{'-yscrpos'} = 3;
+    Lire::UI::CompoundWidget::_child_focus_cb( $widget->getobj('list_widget') );
+
+    $self->assert_str_equals( $help_viewer, $texteditor );
+    $self->assert_null( $nothing );
+    $self->assert_num_equals( 3, $scrollpos );
 }
 
 sub test_layout {

-- 
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