Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 09397b0

Browse files
committed
Removing AreJSONEqual function
1 parent 54787d1 commit 09397b0

File tree

8 files changed

+34
-70
lines changed

8 files changed

+34
-70
lines changed

_testdata/analyzer/manifest.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"dependencies": {
3-
"github.com/pkg/errors": {
4-
"version": ">=0.8.0, <1.0.0"
5-
},
6-
"github.com/sdboyer/gps": {
7-
"version": ">=0.12.0, <1.0.0"
8-
}
9-
}
2+
"dependencies": {
3+
"github.com/pkg/errors": {
4+
"version": ">=0.8.0, <1.0.0"
5+
},
6+
"github.com/sdboyer/gps": {
7+
"version": ">=0.12.0, <1.0.0"
8+
}
9+
}
1010
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"memo": "595716d270828e763c811ef79c9c41f85b1d1bfbdfe85280036405c03772206c",
3-
"projects": [
4-
{
5-
"name": "github.com/sdboyer/dep-test",
6-
"version": "1.0.0",
7-
"revision": "2a3a211e171803acb82d1d5d42ceb53228f51751",
8-
"packages": [
9-
"."
10-
]
11-
}
12-
]
2+
"memo": "595716d270828e763c811ef79c9c41f85b1d1bfbdfe85280036405c03772206c",
3+
"projects": [
4+
{
5+
"name": "github.com/sdboyer/dep-test",
6+
"version": "1.0.0",
7+
"revision": "2a3a211e171803acb82d1d5d42ceb53228f51751",
8+
"packages": [
9+
"."
10+
]
11+
}
12+
]
1313
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"dependencies": {
3-
"github.com/sdboyer/dep-test": {
4-
"version": "1.0.0"
5-
}
6-
}
2+
"dependencies": {
3+
"github.com/sdboyer/dep-test": {
4+
"version": "1.0.0"
5+
}
6+
}
77
}

analyzer_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ func TestDeriveManifestAndLock(t *testing.T) {
3333
t.Fatal(err)
3434
}
3535

36-
if exp, err := test.AreEqualJSON(contents, string(b)); !exp {
37-
h.Must(err)
36+
if contents != string(b) {
3837
t.Fatalf("expected %s\n got %s", contents, string(b))
3938
}
4039

lock_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ func TestWriteLock(t *testing.T) {
6969
t.Fatalf("Error while marshaling valid lock to JSON: %q", err)
7070
}
7171

72-
if exp, err := test.AreEqualJSON(string(b), lg); !exp {
73-
h.Must(err)
72+
if string(b) != lg {
7473
t.Errorf("Valid lock did not marshal to JSON as expected:\n\t(GOT): %s\n\t(WNT): %s", string(b), lg)
7574
}
7675
}

manifest_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ func TestWriteManifest(t *testing.T) {
8888
t.Fatalf("Error while marshaling valid manifest to JSON: %q", err)
8989
}
9090

91-
if exp, err := test.AreEqualJSON(string(b), jg); !exp {
92-
h.Must(err)
91+
if string(b) != jg {
9392
t.Errorf("Valid manifest did not marshal to JSON as expected:\n\t(GOT): %s\n\t(WNT): %s", string(b), jg)
9493
}
9594
}

test/util.go

Lines changed: 0 additions & 26 deletions
This file was deleted.

txn_writer_test.go

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ func TestTxnWriter(t *testing.T) {
110110
h.MustNotExist(vpath)
111111

112112
diskm := h.ReadManifest()
113-
if exp, err := test.AreEqualJSON(expectedManifest, diskm); !exp {
114-
h.Must(err)
113+
if expectedManifest != diskm {
115114
t.Fatalf("expected %s, got %s", expectedManifest, diskm)
116115
}
117116

@@ -123,14 +122,12 @@ func TestTxnWriter(t *testing.T) {
123122
h.MustNotExist(vpath)
124123

125124
diskm = h.ReadManifest()
126-
if exp, err := test.AreEqualJSON(expectedManifest, diskm); !exp {
127-
h.Must(err)
125+
if expectedManifest != diskm {
128126
t.Fatalf("expected %s, got %s", expectedManifest, diskm)
129127
}
130128

131129
diskl := h.ReadLock()
132-
if exp, err := test.AreEqualJSON(expectedLock, diskl); !exp {
133-
h.Must(err)
130+
if expectedLock != diskl {
134131
t.Fatalf("expected %s, got %s", expectedLock, diskl)
135132
}
136133

@@ -141,14 +138,12 @@ func TestTxnWriter(t *testing.T) {
141138
h.MustExist(filepath.Join(vpath, "github.com", "sdboyer", "dep-test"))
142139

143140
diskm = h.ReadManifest()
144-
if exp, err := test.AreEqualJSON(expectedManifest, diskm); !exp {
145-
h.Must(err)
141+
if expectedManifest != diskm {
146142
t.Fatalf("expected %s, got %s", expectedManifest, diskm)
147143
}
148144

149145
diskl = h.ReadLock()
150-
if exp, err := test.AreEqualJSON(expectedLock, diskl); !exp {
151-
h.Must(err)
146+
if expectedLock != diskl {
152147
t.Fatalf("expected %s, got %s", expectedLock, diskl)
153148
}
154149

@@ -175,8 +170,7 @@ func TestTxnWriter(t *testing.T) {
175170
h.MustExist(filepath.Join(vpath, "github.com", "sdboyer", "dep-test"))
176171

177172
diskl = h.ReadLock()
178-
if exp, err := test.AreEqualJSON(expectedLock, diskl); !exp {
179-
h.Must(err)
173+
if expectedLock != diskl {
180174
t.Fatalf("expected %s, got %s", expectedLock, diskl)
181175
}
182176

@@ -189,8 +183,7 @@ func TestTxnWriter(t *testing.T) {
189183
h.MustExist(filepath.Join(vpath, "github.com", "sdboyer", "dep-test"))
190184

191185
diskl = h.ReadLock()
192-
if exp, err := test.AreEqualJSON(expectedLock, diskl); !exp {
193-
h.Must(err)
186+
if expectedLock != diskl {
194187
t.Fatalf("expected %s, got %s", expectedLock, diskl)
195188
}
196189

0 commit comments

Comments
 (0)