Skip to content
formatted diffs for failing go examples
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
testdata
LICENSE
README.md
index_test.go
main.go
parsing_test.go

README.md

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

You can’t perform that action at this time.