mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-01-12 02:17:43 +08:00
4edf360854
* Add tests for get-zones * fix CAA, SSHFP, TLSA and other bugs * New format for get-zones: "djs" which is js but uses "disco commas" * Print diffs using github.com/andreyvit/diff Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
660 B
660 B
diff
Quick'n'easy string diffing functions for Golang based on github.com/sergi/go-diff. Mainly for diffing strings in tests.
See the docs on GoDoc.
Get it:
go get -u github.com/andreyvit/diff
Example:
import (
"strings"
"testing"
"github.com/andreyvit/diff"
)
const expected = `
...
`
func TestFoo(t *testing.T) {
actual := Foo(...)
if a, e := strings.TrimSpace(actual), strings.TrimSpace(expected); a != e {
t.Errorf("Result not as expected:\n%v", diff.LineDiff(e, a))
}
}