Giter Club home page Giter Club logo

livexample's People

Contributors

suin avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

livexample's Issues

Output statement in indented comment is ignored

Expected behavior

  • Pass tests.

Actual behavior

  • Fail tests.

Steps to reproduce actual behavior

❯ composer show -i | grep livexample
You are using the deprecated option "installed". Only installed packages are shown by default now. The --all option can be used to show all packages.
suin/livexample                    1.2.0 Ensures your example codes works well by unit testing.
  1. Create an example script which contains an output statement in an indented comment.
    <?php
    // example/indented.php
    
    try {
        throw new RuntimeException('Error!!');
    } catch (RuntimeException $e) {
        echo $e->getMessage();
        // Output:
        // Error!!
    }
  2. Run the script via php command:
    php example/indented.php
    Error!!
  3. Run it via PHPUnit:
    phpunit
    PHPUnit 6.5.5 by Sebastian Bergmann and contributors.
    
    Runtime:       PHP 7.1.11 with Xdebug 2.5.5
    Configuration: /.../phpunit.xml
    
    .....F..................                                          24 / 24 (100%)
    
    Time: 305 ms, Memory: 6.00MB
    
    There was 1 failure:
    
    1) Suin\ExampleTest::testExamples with data set #5 ('.../indented.php')
    Failed asserting that string matches format description.
    --- Expected
    +++ Actual
    
    .../vendor/suin/livexample/src/PHPUnit/ExampleTestCase.php:55

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.