- Timestamp:
- Jul 27, 2009, 11:23:57 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- d7bcff8
- Parents:
- 8eac1a5
- git-author:
- Nelson Elhage <nelhage@mit.edu> (07/25/09 00:37:50)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (07/27/09 23:23:57)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
t/completion.t
r8eac1a5 r13614e7 24 24 my $word_point = shift; 25 25 26 my $word_start = shift; 27 my $word_end = shift; 28 26 29 my $ctx = BarnOwl::Completion::Context->new($before_point, 27 30 $after_point); … … 33 36 is($ctx->word, $word, "Correct current word."); 34 37 is($ctx->word_point, $word_point, "Correct point within word."); 38 is($ctx->word_start, $word_start, "Correct start of word"); 39 is($ctx->word_end, $word_end, "Correct end of word"); 35 40 } 36 41 } … … 41 46 no warnings 'qw'; 42 47 test_tokenize('Hello, W', 'orld', 43 [qw(Hello, World)], 1, 1 );48 [qw(Hello, World)], 1, 1, 7, 12); 44 49 45 50 test_tokenize('Hello, World', '', 46 [qw(Hello, World)], 1, 5 );51 [qw(Hello, World)], 1, 5, 7, 12); 47 52 48 53 test_tokenize('', '', 49 [qw()], 0, 0 );54 [qw()], 0, 0, 0, 0); 50 55 51 56 test_tokenize('Hello', 'World', 52 [qw(HelloWorld)], 0, 5 );57 [qw(HelloWorld)], 0, 5, 0, 10); 53 58 54 59 test_tokenize('lorem ipsum dolor ', 'sit amet', 55 [qw(lorem ipsum dolor sit amet)], 3, 0); 60 [qw(lorem ipsum dolor sit amet)], 61 3, 0, 18, 21); 56 62 57 63 test_tokenize(q{error "ls -l failed"}, q{}, 58 ['error', 'ls -l failed'], 1, 12); 64 ['error', 'ls -l failed'], 65 1, 12, 6, 20); 59 66 60 67 test_tokenize(q{"a long"' word'}, q{}, 61 68 ['a long word']); 62 69 63 test_tokenize(q{"'"}, q{}, [q{'}] );70 test_tokenize(q{"'"}, q{}, [q{'}], 0, 1, 0, 3); 64 71 65 72 test_tokenize(q{"Hello, }, q{World"}, 66 [q{Hello, World}], 0, 7); 73 [q{Hello, World}], 74 0, 7, 0, 14); 67 75 68 76 test_tokenize(q{But 'Hello, }, q{World'}, 69 ['But', q{Hello, World}], 1, 7); 77 ['But', q{Hello, World}], 78 1, 7, 4, 18); 70 79 71 80 test_tokenize(q{But "Hello, }, q{World"''''''""}, 72 ['But', q{Hello, World}], 1, 7); 81 ['But', q{Hello, World}], 82 1, 7, 4, 26); 73 83 74 84 test_tokenize(q{}, q{''Hello}, 75 ['Hello'], 0, 0); 85 ['Hello'], 86 0, 0, 0, 7); 76 87 77 88 test_tokenize(q{"Hello, }, q{World}, 78 [q{Hello, World}], 0, 7); 89 [q{Hello, World}], 90 0, 7, 0, 13); 79 91 80 92 test_tokenize(q{Hello }, q{World}, 81 [qw{Hello World}], 1, 0); 93 [qw{Hello World}], 94 1, 0, 9, 14); 82 95 83 96 test_tokenize(q{Hello '' ""}, q{ World}, 84 ["Hello", '', '', 'World'], 2, 0); 97 ["Hello", '', '', 'World'], 98 2, 0, 9, 11); 85 99 86 100 # It's not entirely clear what we should do here. Make a test for the 87 101 # current behavior, so we'll notice if it changes. 88 102 test_tokenize(q{Hello }, q{ World}, 89 [qw(Hello World)], 1, -1); 103 [qw(Hello World)], 104 1, -1, 7, 12); 90 105 91 106 1;
Note: See TracChangeset
for help on using the changeset viewer.