Skip to content

Commit

Permalink
improve code style in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed Apr 22, 2022
1 parent 8da10cf commit 0df57e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cli/error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func generateString(size int) string {

func TestGetLineByOffset(t *testing.T) {
numbers := generateString(500)
var testCases = []struct {
testCases := []struct {
str string
offset int
linestr string
Expand Down Expand Up @@ -172,7 +172,7 @@ func TestGetLineByOffset(t *testing.T) {
}

func TestGetLineByLine(t *testing.T) {
var testCases = []struct {
testCases := []struct {
str string
line int
linestr string
Expand Down
6 changes: 4 additions & 2 deletions query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ func TestQueryRun_Strings(t *testing.T) {
if err, ok := v.(error); ok {
t.Fatal(err)
}
if expected := []interface{}{0x00, int('\\'), 0x1f, int('"'), int('\n'), int('\n'), int('\n'),
int('\n'), int('\n'), int('\n'), int('/'), 0x7f, 0xfffd, 128516}; !reflect.DeepEqual(v, expected) {
if expected := []interface{}{
0x00, int('\\'), 0x1f, int('"'), int('\n'), int('\n'), int('\n'),
int('\n'), int('\n'), int('\n'), int('/'), 0x7f, 0xfffd, 128516,
}; !reflect.DeepEqual(v, expected) {
t.Errorf("expected: %v, got: %v", expected, v)
}
}
Expand Down

0 comments on commit 0df57e8

Please sign in to comment.