pr feedback

This commit is contained in:
William Banfield
2021-07-23 16:40:51 -04:00
parent cbdf0072fc
commit 0e22c88229
2 changed files with 4 additions and 7 deletions
+3 -3
View File
@@ -1,16 +1,16 @@
package server_test
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/test/fuzz/rpc/jsonrpc/server"
)
const testdataDir = "./testdata"
const testdataDir = "testdata"
func TestServerOnTestData(t *testing.T) {
entries, err := os.ReadDir(testdataDir)
@@ -23,7 +23,7 @@ func TestServerOnTestData(t *testing.T) {
r := recover()
require.Nilf(t, r, "testdata test panic")
}()
f, err := os.Open(fmt.Sprintf("%s/%s", testdataDir, e.Name()))
f, err := os.Open(filepath.Join(testdataDir, entry.Name()))
require.NoError(t, err)
input, err := ioutil.ReadAll(f)
require.NoError(t, err)
+1 -4
View File
@@ -60,8 +60,5 @@ func Fuzz(data []byte) int {
func inputJSONIsSlice(input []byte) bool {
slice := []interface{}{}
err := json.Unmarshal(input, &slice)
if err != nil {
return false
}
return true
return err == nil
}