Changeset e4f4287 for t/completion.t


Ignore:
Timestamp:
Oct 3, 2009, 1:53:00 AM (12 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
5fdc562
Parents:
42ad917
git-author:
David Benjamin <davidben@mit.edu> (09/24/09 23:18:01)
git-committer:
David Benjamin <davidben@mit.edu> (10/03/09 01:53:00)
Message:
Enable Context::shift_words tests and add one

Now that the tester can run XS code, we can test shift_words. Also added
a new test that ensures we die when we shift away the point.

Signed-off-by: David Benjamin <davidben@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • t/completion.t

    r69c27e6 re4f4287  
    131131
    132132## Test Context::shift
    133 SKIP: {
    134     skip "Can't yet test code that depends on perlglue.xs", 4;
    135     test_shift('lorem ipsum dolor ', 'sit amet', 0,
    136                [qw(lorem ipsum dolor sit amet)],
    137                3, 0, 18, 21);
    138 
    139     test_shift('lorem ipsum dolor ', 'sit amet', 1,
    140                [qw(lorem ipsum dolor sit amet)],
    141                2, 0, 12, 15);
    142 
    143     test_shift('lorem ipsum dolor ', 'sit amet', 2,
    144                [qw(lorem ipsum dolor sit amet)],
    145                1, 0, 6, 9);
    146 
    147     test_shift('lorem ipsum dolor ', 'sit amet', 3,
    148                [qw(lorem ipsum dolor sit amet)],
    149                0, 0, 0, 3);
    150 
    151 }
     133test_shift('lorem ipsum dolor ', 'sit amet', 0,
     134           [qw(lorem ipsum dolor sit amet)],
     135           3, 0, 18, 21);
     136
     137test_shift('lorem ipsum dolor ', 'sit amet', 1,
     138           [qw(ipsum dolor sit amet)],
     139           2, 0, 12, 15);
     140
     141test_shift('lorem ipsum dolor ', 'sit amet', 2,
     142           [qw(dolor sit amet)],
     143           1, 0, 6, 9);
     144
     145test_shift('lorem ipsum dolor ', 'sit amet', 3,
     146           [qw(sit amet)],
     147           0, 0, 0, 3);
     148
     149eval {
     150    my $before_point = 'lorem ipsum dolor';
     151    my $after_point = 'sit amet';
     152    my $shift = 4;
     153
     154    my $ctx = BarnOwl::Completion::Context->new($before_point,
     155                                                $after_point);
     156    $ctx = $ctx->shift_words($shift);
     157};
     158like($@, qr/^Context::shift: Unable to shift /, "Correctly die when shifting away the point");
     159
    152160## Test common_prefix
    153161
Note: See TracChangeset for help on using the changeset viewer.