Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
eveninglily committed Feb 25, 2021
1 parent 5f0bf05 commit f303e2b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion hive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,25 @@ func TestFetchContext(t *testing.T) {
closeAll(t, connection, cursor)
}

func TestFetchLogs(t *testing.T) {
connection, cursor := prepareTable(t, 2, 1000)
cursor.Execute(context.Background(), "SELECT * FROM pokes", false)
if cursor.Error() != nil {
t.Fatal(cursor.Error())
}

logs := cursor.FetchLogs()
if logs == nil {
t.Fatal("Logs should not be nil")
}

if len(logs) == 0 {
t.Fatal("Logs should non-empty")
}

closeAll(t, connection, cursor)
}

func TestHasMoreContext(t *testing.T) {
connection, cursor := prepareTable(t, 2, 1)
cursor.Execute(context.Background(), "SELECT * FROM pokes", false)
Expand Down Expand Up @@ -691,7 +710,6 @@ func TestRowMap(t *testing.T) {
closeAll(t, connection, cursor)
}


func TestRowMapColumnRename(t *testing.T) {
connection, cursor := makeConnection(t, 1000)
cursor.Exec(context.Background(), "create table if not exists t(a int, b int)")
Expand Down

0 comments on commit f303e2b

Please sign in to comment.