Skip to content

Commit

Permalink
Fixing test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
salonijuneja21 authored and sparkprime committed Apr 13, 2023
1 parent 91ebf4b commit ff691b0
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions internal/testutils/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,12 @@ import (
"bytes"
"io/ioutil"
"os"
"bufio"
"fmt"

"github.com/sergi/go-diff/diffmatchpatch"
)
func check(err error) {
if err != nil {
panic(err)
}
}

// Diff produces a pretty diff of two files
func Diff(a, b string) string {
f, err := os.Create("/Users/salonijuneja/yourfile11.txt")
check(err)
defer f.Close()

w := bufio.NewWriter(f)

_, err = fmt.Fprintf(w, "%v\n", a)
check(err)
w.Flush()
dmp := diffmatchpatch.New()
diffs := dmp.DiffMain(a, b, false)
return dmp.DiffPrettyText(diffs)
Expand Down

0 comments on commit ff691b0

Please sign in to comment.