File: 04_api.t

package info (click to toggle)
libwx-perl 1%3A0.9932-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,300 kB
  • sloc: cpp: 11,064; perl: 8,603; ansic: 711; makefile: 53
file content (43 lines) | stat: -rwxr-xr-x 824 bytes parent folder | download | duplicates (7)
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
#!/usr/bin/perl -w

use Test::More tests => 8;

use strict;
use lib '../../t';
use Tests_Helper qw(in_frame);
use Wx;
use Wx::Grid;

sub test {
    my $self = shift;
    my $grid = Wx::Grid->new( $self, -1 );
    $grid->CreateGrid( 20, 20 );
    my @s;

    $grid->SelectRow( 1 );
    @s = $grid->GetSelectedRows;
    is( scalar( @s ), 1 );
    is_deeply( \@s, [ 1 ] );

    $grid->SelectRow( 2 );
    @s = $grid->GetSelectedRows;
    is( scalar( @s ), 1 );
    is_deeply( \@s, [ 2 ] );

    $grid->SelectRow( 5, 1 );
    @s = $grid->GetSelectedRows;
    is( scalar( @s ), 2 );
    is_deeply( \@s, [ 2, 5 ] );

    $grid->SelectCol( 1 );
    $grid->SelectCol( 2, 1 );
    @s = $grid->GetSelectedCols;
    is( scalar( @s ), 2 );
    is_deeply( \@s, [ 1, 2 ] );
}

in_frame( \&test );

# local variables:
# mode: cperl
# end: