Giter VIP home page Giter VIP logo

Comments (5)

ckstettler avatar ckstettler commented on June 6, 2024

I totally see what you are describing. I will dig into it to isolate the issue. I suspect the " are getting on the input side somewhere down the line. Thank you for taking the time to submit the issue.

from bash_shell_mock.

ckstettler avatar ckstettler commented on June 6, 2024

I understand the issue better, however, whats the best way to solve it? When mocking I use a quoted string that contains all of the arguments and some could contain quotes. The inner quotes around the arguments are visible and part of the data that currently gets matched. However then the mock is run I can not capture the raw quotes that get passed in a runtime. The shell will eat those and I just have the arguments.

I think I need to maintain the quoted string approach when defining the mock, but store as an array of arguments instead of a quoted string. When match I should make sure the arg array matches.

The one issue with that is the regex matcher. To use that as intended I would need to reconstruct the arg list as a string before matching. When doing that when should I add quotes to the arglist? Maybe when there is white space in the arg? or for simplicity I could leave them out of together, but that is not quite right. I would rather account for them but I would never be able to account for ' vs ". I would need to use one or the other when matching.

from bash_shell_mock.

stale avatar stale commented on June 6, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from bash_shell_mock.

ckstettler avatar ckstettler commented on June 6, 2024

The latest version has support for passing and validating quoted arguments. There are some limitations ie the tool can not distinguish between single or double quotes so when verifying the mock you must always use double quotes.

from bash_shell_mock.

ckstettler avatar ckstettler commented on June 6, 2024

PR#25 resolves this issue with some limitations. The tool can detect quotes have been used, however, can not distinguish between single or double quotes. As a result when verifying matches we normalized on double quotes.

from bash_shell_mock.

Related Issues (13)

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.