Comments (5)
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.
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.
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.
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.
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)
- Please add SPDX header to license so license can be identified by automated scanning tools HOT 1
- Regex matching of arguments being passed HOT 5
- Using echo $? returns incorrect status value, from a mock HOT 1
- Contributors agreement HOT 3
- mock custom functions HOT 7
- Verify that command receives specific data through stdin HOT 14
- Mishandling of " contained in mock matches. HOT 4
- Add the use of shellcheck to do some "linting" and make the script better and more transportable HOT 1
- Change file descriptor to stderr if status is greater than 0 HOT 2
- Automate test execution during PRs HOT 5
- Documentation bug. HOT 1
- Bash logo in README HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bash_shell_mock.