Git Product home page Git Product logo

Comments (2)

LukeSavefrogs avatar LukeSavefrogs commented on May 24, 2024

It's not an error. It is how shells work.

If the function (readParameter) expects data to be passed to stdin, then it will hang forever until an End-Of-File character is received (Ctrl+D).

If you need a default if no stdin is passed then it's exactly THAT the problem. The test shows that the function does not work as you intend, so you must handle it in the readParameter code

from shellspec.

UnasZole avatar UnasZole commented on May 24, 2024

Please read the title of the ticket again. The issue I'm complaining about is not "the call hangs waiting for stdin", which is indeed normal if using the stdin from the terminal.

What I'm saying is that in my opinion, shellspec SHOULD NOT be forwarding the terminal's stdin to the call in the first place.

For a tool designed to build automatable and reproducible test suites, plugging terminal stdin into the processing of individual tests is a weird design choice at best, and a bug at worst (tests results may change if the impatient user presses any key on his terminal while the campaign progresses).

Again, all I'm saying is that when no Data block is specified, the "call" stdin should receive an empty string, and NOT the terminal's stdin.
In other words, no Data block should be equivalent to an empty Data block.

If there really are use cases where it makes sense to forward the calling terminal stdin to the test functions, I'm very curious to read about it.
And even if there are :

  • It may be more reliable to disable that binding by default, and provide a way to enable it explicitly,
  • And most importantly, this behaviour should be explicitly specified and documented.

from shellspec.

Related Issues (20)

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.