https://github.com/fordhurley/egdiff
formatted diffs for failing go examples
https://github.com/fordhurley/egdiff
golang testing
Last synced: about 1 year ago
JSON representation
formatted diffs for failing go examples
- Host: GitHub
- URL: https://github.com/fordhurley/egdiff
- Owner: fordhurley
- License: unlicense
- Created: 2019-02-16T14:44:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-21T14:22:47.000Z (over 7 years ago)
- Last Synced: 2025-02-12T19:02:05.890Z (over 1 year ago)
- Topics: golang, testing
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
`egdiff` -- add formatted diffs for failing go examples
Turn this:
$ go test -v ./...
=== RUN Example_replaceLineEndings
--- FAIL: Example_replaceLineEndings (0.00s)
got:
"a\n\nb\n\nc"
"a\nb\nc"
"a\nb\nc"
"abc"
want:
"a\n\nb\n\nc"
"a\nb/nc"
"a\nb\nc"
"abc"
FAIL
Into this:
$ go test -v ./... | egdiff
=== RUN Example_replaceLineEndings
--- FAIL: Example_replaceLineEndings (0.00s)
got:
"a\n\nb\n\nc"
"a\nb\nc"
"a\nb\nc"
"abc"
want:
"a\n\nb\n\nc"
"a\nb/nc"
"a\nb\nc"
"abc"
--- Want
+++ Got
@@ -1,4 +1,4 @@
"a\n\nb\n\nc"
-"a\nb/nc"
+"a\nb\nc"
"a\nb\nc"
"abc"
FAIL
Install
go get -u github.com/fordhurley/egdiff
Pipe *verbose* test output to it:
go test -v . | egdiff
**TODO:** don't require verbose flag