Skip to content

Commit

Permalink
Update test to reflect code changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bdoner committed Jan 20, 2023
1 parent be05cde commit 88c8b9d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/remote/scanner_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
package remote

import (
"github.com/stretchr/testify/assert"
"fmt"
"path/filepath"
"testing"

"github.com/stretchr/testify/assert"
)

func Test_ValidatePlugin_Errors(t *testing.T) {
invalidPluginAbsPath, err := filepath.Abs("testdata/invalid.so")
if err != nil {
assert.FailNow(t, "failed to get the absolute path of test file: %v", err)
}

testcases := []struct {
name string
path string
Expand All @@ -19,7 +27,7 @@ func Test_ValidatePlugin_Errors(t *testing.T) {
{
name: "test with invalid plugin",
path: "testdata/invalid.so",
wantErr: "given plugin testdata/invalid.so is not valid",
wantErr: fmt.Sprintf("given plugin testdata/invalid.so is not valid: plugin.Open(\"testdata/invalid.so\"): %s: file too short", invalidPluginAbsPath),
},
}

Expand Down

0 comments on commit 88c8b9d

Please sign in to comment.