Git Product home page Git Product logo

p5-test-compiles's People

Contributors

1nickt avatar tobyink avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

1nickt clayne

p5-test-compiles's Issues

__END__ borks the tests

Hi Toby,

First, thanks for this and all your other great tools.

I stumbled into a bit of a weed patch when using compiles on a file that included the __END__ declaration. (Same with __DATA__.) I imagine it is because by default the code is compiled into the calling package, which then interprets the token as the time to stop reading in code to compile ... but I couldn't figure out how to use the package option to work around it (mind you I was in a PIR visitor callback in a loop ...)

The following demonstrates the issue: I am sure your module functions as designed but a clarification/warning in the doc may perhaps be helpful?

use Test::More tests => 3;
use Test::Compiles;

my $code = q{
    use strict; use warnings;
    my $foo = 'bar';
};

compiles $code; # pass

$code .= q{
__DATA__
something
};

compiles $code; # fail

$code =~ s/__DATA__/__END__/;

compiles $code; # fail

Test::Compiles doc bug

Migrated from rt.cpan.org #125974 (status was 'open')

Requestors:

From [email protected] on 2018-07-31 16:59:57
:

Hi,

I suspect that there's a documentation error in the Synopsis ...
compiles_ok q{ print "hello world" };
should read
compiles q{ print "hello world" };

Thanks for all those lovely modules !

"How do we convince people that in programming simplicity and clarity 'in short: what mathematicians call "elegance"' are not a dispensable luxury, but a crucial matter that decides between success and failure?"
... Edsger Wybe Dijkstra

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.