Skip to content

Commit 9fc5f72

Browse files
authored
Merge pull request #3 from mongodb-forks/bugfix_relative_import
fix relative path import
2 parents 119b499 + 7133aa4 commit 9fc5f72

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

difflib/bytes/bytes_test.go

+10-9
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import (
66
"math"
77
"reflect"
88
"runtime"
9+
"sort"
910
"strings"
1011
"testing"
11-
"sort"
12-
"../tester"
12+
13+
"github.com/mongodb-forks/go-difflib/difflib/tester"
1314
)
1415

1516
func assertAlmostEqual(t *testing.T, a, b float64, places int) {
@@ -35,15 +36,15 @@ func splitChars(s string) [][]byte {
3536

3637
func stringsToBytes(in ...string) (out [][]byte) {
3738
out = make([][]byte, len(in))
38-
for i, s := range(in) {
39+
for i, s := range in {
3940
out[i] = []byte(s)
4041
}
4142
return
4243
}
4344

4445
func bytesToStrings(in ...[]byte) (out []string) {
4546
out = make([]string, len(in))
46-
for i, s := range(in) {
47+
for i, s := range in {
4748
out[i] = string(s)
4849
}
4950
return
@@ -332,7 +333,7 @@ func TestOutputFormatRangeFormatUnified(t *testing.T) {
332333
// If a range is empty, its beginning line number shall be the number of
333334
// the line just before the range, or 0 if the empty range starts the file.
334335
fmt := formatRangeUnified
335-
fm := func (a, b int) string { return string(fmt(a,b)) }
336+
fm := func(a, b int) string { return string(fmt(a, b)) }
336337
assertEqual(t, fm(3, 3), "3,0")
337338
assertEqual(t, fm(3, 4), "4")
338339
assertEqual(t, fm(3, 5), "4,2")
@@ -357,7 +358,7 @@ func TestOutputFormatRangeFormatContext(t *testing.T) {
357358
// and the following format otherwise:
358359
// "--- %d ----\n", <ending line number>
359360
fmt := formatRangeContext
360-
fm := func (a, b int) string { return string(fmt(a,b)) }
361+
fm := func(a, b int) string { return string(fmt(a, b)) }
361362
assertEqual(t, fm(3, 3), "3")
362363
assertEqual(t, fm(3, 4), "4")
363364
assertEqual(t, fm(3, 5), "4,5")
@@ -476,7 +477,7 @@ func BenchmarkSplitLines10000(b *testing.B) {
476477

477478
func prepareFilesToDiff(count, seed int) (As, Bs [][][]byte) {
478479
defer runtime.GC()
479-
aux := func () { // to ensure temp variables go out of scope
480+
aux := func() { // to ensure temp variables go out of scope
480481
stringsA, stringsB := tester.PrepareStringsToDiff(count, seed)
481482
As = make([][][]byte, len(stringsA))
482483
Bs = make([][][]byte, len(stringsB))
@@ -547,7 +548,7 @@ func TestDifferStructuredDump(t *testing.T) {
547548
stringsToBytes("foo", "bar", "baz", "quux", "qwerty"),
548549
1, 3)
549550
expected := []DiffLine{DiffLine{'+', []byte("bar")},
550-
DiffLine{'+', []byte("baz")}}
551+
DiffLine{'+', []byte("baz")}}
551552
if !reflect.DeepEqual(out, expected) {
552553
t.Fatal("Differ StructuredDump failure:", out)
553554
}
@@ -661,7 +662,7 @@ func TestGetUnifiedDiffString(t *testing.T) {
661662
// Build diff
662663
diff := UnifiedDiff{A: SplitLines(A),
663664
FromFile: "file", FromDate: "then",
664-
B: SplitLines(B),
665+
B: SplitLines(B),
665666
ToFile: "tile", ToDate: "now", Eol: []byte{}, Context: 1}
666667
// Run test
667668
diffStr, err := GetUnifiedDiffString(diff)

difflib/difflib_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import (
88
"runtime"
99
"strings"
1010
"testing"
11-
"./tester"
11+
12+
"github.com/mongodb-forks/go-difflib/difflib/tester"
1213
)
1314

1415
func assertAlmostEqual(t *testing.T, a, b float64, places int) {
@@ -602,7 +603,7 @@ func TestGetUnifiedDiffString(t *testing.T) {
602603
// Build diff
603604
diff := LineDiffParams{A: SplitLines(A),
604605
FromFile: "file", FromDate: "then",
605-
B: SplitLines(B),
606+
B: SplitLines(B),
606607
ToFile: "tile", ToDate: "now", Eol: "", Context: 1}
607608
// Run test
608609
diffStr, err := GetUnifiedDiffString(diff)

0 commit comments

Comments
 (0)