Skip to content

Commit

Permalink
h2non#422 update existing unit tests to not break on new function sig…
Browse files Browse the repository at this point in the history
…nature
  • Loading branch information
EyePulp committed Jan 26, 2024
1 parent 9127d59 commit 8c261a6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions source_body_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestBodyImageSource(t *testing.T) {
t.Fatal("Cannot match the request")
}

body, err = source.GetImage(r)
body, _, err = source.GetImage(r)
if err != nil {
t.Fatalf("Error while reading the body: %s", err)
}
Expand Down Expand Up @@ -59,7 +59,7 @@ func testReadBody(t *testing.T) {
t.Fatal("Cannot match the request")
}

body, err = source.GetImage(r)
body, _, err = source.GetImage(r)
if err != nil {
t.Fatalf("Error while reading the body: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion source_fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestFileSystemImageSource(t *testing.T) {
t.Fatal("Cannot match the request")
}

body, err = source.GetImage(r)
body, _, err = source.GetImage(r)
if err != nil {
t.Fatalf("Error while reading the body: %s", err)
}
Expand Down
10 changes: 5 additions & 5 deletions source_http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestHttpImageSource(t *testing.T) {
t.Fatal("Cannot match the request")
}

body, err = source.GetImage(r)
body, _, err = source.GetImage(r)
if err != nil {
t.Fatalf("Error while reading the body: %s", err)
}
Expand Down Expand Up @@ -59,7 +59,7 @@ func TestHttpImageSourceAllowedOrigin(t *testing.T) {
t.Fatal("Cannot match the request")
}

body, err := source.GetImage(r)
body, _, err := source.GetImage(r)
if err != nil {
t.Fatalf("Error while reading the body: %s", err)
}
Expand All @@ -85,7 +85,7 @@ func TestHttpImageSourceNotAllowedOrigin(t *testing.T) {
t.Fatal("Cannot match the request")
}

_, err := source.GetImage(r)
_, _, err := source.GetImage(r)
if err == nil {
t.Fatal("Error cannot be empty")
}
Expand Down Expand Up @@ -256,7 +256,7 @@ func TestHttpImageSourceError(t *testing.T) {
t.Fatal("Cannot match the request")
}

_, err = source.GetImage(r)
_, _, err = source.GetImage(r)
if err == nil {
t.Fatalf("Server response should not be valid: %s", err)
}
Expand Down Expand Up @@ -285,7 +285,7 @@ func TestHttpImageSourceExceedsMaximumAllowedLength(t *testing.T) {
t.Fatal("Cannot match the request")
}

body, err = source.GetImage(r)
body, _, err = source.GetImage(r)
if err == nil {
t.Fatalf("It should not allow a request to image exceeding maximum allowed size: %s", err)
}
Expand Down

0 comments on commit 8c261a6

Please sign in to comment.