The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Bash::Completion::Plugin::Test - Module for testing Bash::Completion plugins

VERSION

version 0.01

SYNOPSIS

  my $tester = Bash::Completion::Plugin::Test->new(
    plugin => $PLUGIN_NAME,
  );

  $test->check_completions('my-command ^', \@expected_completeions,
    $opt_name);

DESCRIPTION

Bash::Completion::Plugin::Test is a module for testing Bash::Completion plugins.

METHODS

Bash::Completion::Plugin::Test->new(%params)

Creates a new tester object. %params is a hash of named parameters; currently, the only supported one is plugin, which is the name of the plugin to test, and is required.

$tester->check_completions($command, \@expected, $name)

Runs the current completion plugin against $command, and verifies that the results it returns are the same as those in @expected. The order of the items in @expected does not matter. $name is an optional name for the test. The carat character '^' must be present in $command; it is removed and represents the location of the cursor when completion occurs.

SEE ALSO

Bash::Completion

AUTHOR

Rob Hoelz <rob@hoelz.ro>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Rob Hoelz.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/hoelzro/bash-completion-plugin-test/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.