Skip to content

Commit

Permalink
Test if the line in contrib/postgres/test.sql is the culprit
Browse files Browse the repository at this point in the history
  • Loading branch information
murfffi committed Dec 7, 2024
1 parent e0e0807 commit 8c5c3b8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions contrib/mysql/test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ insert into authors (name) values

\echo `echo hello`

select :"COLNAME" from authors where :COLNAME like '%' || :'NAME' || '%'

\print \raw

\g
Expand Down
2 changes: 0 additions & 2 deletions contrib/postgres/test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ insert into authors (name) values

\echo `echo hello`

select :"COLNAME" from authors where :COLNAME like '%' || :'NAME' || '%'

\print \raw

\g
Expand Down
2 changes: 0 additions & 2 deletions contrib/sqlite3/test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ insert into authors (name) values

\echo `echo hello`

select :"COLNAME" from authors where :COLNAME like '%' || :'NAME' || '%'

\print \raw

\g
Expand Down
2 changes: 0 additions & 2 deletions contrib/sqlserver/test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ insert into authors (name) values

\echo `echo hello`

select :"COLNAME" from authors where :COLNAME like '%' || :'NAME' || '%'

\print \raw

\g
Expand Down
10 changes: 8 additions & 2 deletions testcli.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"log"
"os"
"regexp"
"strings"
"time"

gexpect "github.com/google/goexpect"
Expand Down Expand Up @@ -119,6 +120,7 @@ func (test Test) do(ctx context.Context, binpath string, timeout time.Duration)
gexpect.SetEnv(test.env),
gexpect.Tee(&noopWriteCloser{os.Stdout}),
)
exp.Options(gexpect.Verbose(true))
if err != nil {
return err
}
Expand All @@ -127,8 +129,12 @@ func (test Test) do(ctx context.Context, binpath string, timeout time.Duration)
return err
}
for _, line := range bytes.Split(buf, []byte{'\n'}) {
if err := exp.Send(string(line) + "\n"); err != nil {
return err
lineStr := strings.TrimSpace(string(line))
if lineStr != "" { // technically only trailing empty lines are a problem but they are harder to check for
time.Sleep(100 * time.Millisecond)
if err := exp.Send(string(line) + "\n"); err != nil {
return err
}
}
}
select {
Expand Down

0 comments on commit 8c5c3b8

Please sign in to comment.