Giter VIP home page Giter VIP logo

vim-perl-testing's Introduction

vim-perl-testing

A set of utilities to help you write and run your perl tests directly from your favorite editor.

Available commands..

... you might want to map to handy keystrokes:

:call GotoCorresponding( <open_with:tabnew|split|..[default=edit]> )

If you are currently editing a module, this function will open the corresponding .t file. If you are currently editing a test file, it will open the corresponding module. Of course, this requires you to have a correspondance of tests and modules in the first place.

If the corresponding file is already open, it will bring you to the right buffer.

See http://blogs.perl.org/users/ovid/2013/03/discoverable-tests-and-creating-testing-standards.html for the details of this and also to learn about the inspiration for this plugin.

:call RunTestForCurrentSub()

When working on a subroutine, you may feel like running the corresponding test. The function will find your corresponding test file and will try to run the subroutine in that test file that is supposed to test the subroutine you are currently changing.

To execute only a given subroutine from your testfile you should add something like the following after your "use"-statements:

if ( $ARGV[ 0 ] ) {
    no strict 'refs';
    &{$ARGV[ 0 ]}();
    done_testing;
exit 0;

TESTING THE PLUGIN

This plugin comes with a set of unit tests. To run the tests, you need to install another vim plugin: vim-unittest. It is available on github: https://github.com/h1mesuke/vim-unittest

With vim-unittest installed, cd to the directory where you installed vim-perl-testing to and open a vim instance with one of the file in the test/ directory. Then simply run :UnitTest

LICENSE

See :help license.

vim-perl-testing's People

Contributors

mannih avatar

Watchers

 avatar  avatar

Forkers

tonil

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.