Changeset 1167bf1 for 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:
3b80321
Parents:
5fdc562
git-author:
David Benjamin <davidben@mit.edu> (09/24/09 23:43:20)
git-committer:
David Benjamin <davidben@mit.edu> (10/03/09 01:53:00)
Message:
Add tests for complete_filter_expr

Tests:
- initial setup
- not forwards back to initial
- offers and/or
- offers and/or OR ) when in parens
- parse some vaguely complicated filter
- type, direction, login argument completion

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

Legend:

Unmodified
Added
Removed
  • t/completion.t

    re4f4287 r1167bf1  
    77use File::Basename;
    88BEGIN {require (dirname($0) . "/mock.pl");};
     9
     10use BarnOwl::Complete::Filter qw(complete_filter_expr);
    911
    1012=head1 DESCRIPTION
     
    253255              [qw(2)], \&complete_word);
    254256
     257
     258# Test the filter expression completer
     259test_complete('', '',
     260              [qw[( body class direction false filter hostname instance login not opcode perl realm recipient sender true type]],
     261              \&complete_filter_expr);
     262
     263test_complete('not ', '',
     264              [qw[( body class direction false filter hostname instance login not opcode perl realm recipient sender true type]],
     265              \&complete_filter_expr);
     266
     267test_complete('true ', '',
     268              [qw[and or]],
     269              \&complete_filter_expr);
     270
     271test_complete('( true ', '',
     272              [qw[and or )]],
     273              \&complete_filter_expr);
     274
     275test_complete('( body static and body analysis and not false and class davidben and ( instance python or instance hotd ', '',
     276              [qw[and or )]],
     277              \&complete_filter_expr);
     278
     279test_complete('type ', '',
     280              [qw[admin aim zephyr]],
     281              \&complete_filter_expr);
     282
     283test_complete('direction ', '',
     284              [qw[in out none]],
     285              \&complete_filter_expr);
     286
     287test_complete('login ', '',
     288              [qw[login logout none]],
     289              \&complete_filter_expr);
     290
    2552911;
    256292
Note: See TracChangeset for help on using the changeset viewer.