Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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

About

formatted diffs for failing go examples

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages