Comments (4)
@dylanhitt What do you think about printing the diff as a table?
For each test a table:
Expected | Operator | Result |
---|---|---|
1 | Equal | 3 |
True | Equal | False |
Hello | contained in | Hey World |
As a summary:
Or as complete summary like this (maybe a readable like a sentence with the Operation
column):
Test | Expected | Operation | Result |
---|---|---|---|
it should be equal | 1 | does not equal | 3 |
it is true | True | does not equal | False |
it contains hello | Hello | is not contained in | Hey World |
Some more ideas:
- If a text is too long it will be cropped, i.e. after 100 characters
- If a text is more than, i.e. 10 lines, it will be cropped
- The operator is filled defined in the corresponding Matcher
The table would have the benefit that it is always consistent. The disadvantage is that it is not as verbose and detailed as it is currently.
Imho it could be one of many output formats for the result and will be added along the current one.
from commander.
Let's start with that. I was thinking about how to deal with large text files. A bit of a cop out but it would help, we could scan the string until we reach the first point where there is a difference and pinpoint that spot something like hello w^rld
. Of course we could print something cleaner than this example. But i'd say switching to table would be best.
I like the second table a lot actually. I didn't quite pick up that could be read like a sentence when I first read it. I need to stop skimming text 🙃
from commander.
You don't necessarily have to print the whole string just the context and the area around it that is different, maybe include the line number where it is first different. I'm not really proposing we do this now, it was mainly just spitting out ideas.
from commander.
Yes, a good diff library would be very cool. But I think we can't achieve a good (human) readability and displaying the difference in the results.
For example what do we do if the diff is too big?
from commander.
Related Issues (20)
- "Test may not be filtered when --dir is enabled" HOT 5
- Test Suite aggregation should occur in runtime HOT 2
- Create a custom GitHub action for Commander HOT 1
- Properly mock file and dirs in app tests to not read from the filesystem
- config value dir, should work for file assertion
- user should be able to set the working dir with `--workdir` HOT 1
- Add junit ouput support HOT 1
- Move away from travisCI HOT 5
- Add yaml linter in CI
- documented install command fails with go 1.16 HOT 5
- Upgrade docker version
- Change []runtime.TestCase in Suite to an array of pointers
- Unable to run docker via kind cluster HOT 11
- SSH public key authentication broken in commander 2.4.0 on CentOS 8.4.2105 HOT 1
- Enable regular expression for stdout, stderr assertion HOT 3
- Add proper error handling and coroutine cancellation
- Rename TestCommandContext to TestCommandConfig
- Support bash and awk verifiers HOT 1
- Commands in Installation section try to download non-existing version HOT 1
- dotfiles in test dir cause a panic HOT 1
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 commander.