Skip to content

Commit 8c5c3b8

Browse files
committed
Test if the line in contrib/postgres/test.sql is the culprit
1 parent e0e0807 commit 8c5c3b8

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

contrib/mysql/test.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ insert into authors (name) values
6262

6363
\echo `echo hello`
6464

65-
select :"COLNAME" from authors where :COLNAME like '%' || :'NAME' || '%'
66-
6765
\print \raw
6866

6967
\g

contrib/postgres/test.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ insert into authors (name) values
6666

6767
\echo `echo hello`
6868

69-
select :"COLNAME" from authors where :COLNAME like '%' || :'NAME' || '%'
70-
7169
\print \raw
7270

7371
\g

contrib/sqlite3/test.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ insert into authors (name) values
6060

6161
\echo `echo hello`
6262

63-
select :"COLNAME" from authors where :COLNAME like '%' || :'NAME' || '%'
64-
6563
\print \raw
6664

6765
\g

contrib/sqlserver/test.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ insert into authors (name) values
5252

5353
\echo `echo hello`
5454

55-
select :"COLNAME" from authors where :COLNAME like '%' || :'NAME' || '%'
56-
5755
\print \raw
5856

5957
\g

testcli.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"log"
1313
"os"
1414
"regexp"
15+
"strings"
1516
"time"
1617

1718
gexpect "github.com/google/goexpect"
@@ -119,6 +120,7 @@ func (test Test) do(ctx context.Context, binpath string, timeout time.Duration)
119120
gexpect.SetEnv(test.env),
120121
gexpect.Tee(&noopWriteCloser{os.Stdout}),
121122
)
123+
exp.Options(gexpect.Verbose(true))
122124
if err != nil {
123125
return err
124126
}
@@ -127,8 +129,12 @@ func (test Test) do(ctx context.Context, binpath string, timeout time.Duration)
127129
return err
128130
}
129131
for _, line := range bytes.Split(buf, []byte{'\n'}) {
130-
if err := exp.Send(string(line) + "\n"); err != nil {
131-
return err
132+
lineStr := strings.TrimSpace(string(line))
133+
if lineStr != "" { // technically only trailing empty lines are a problem but they are harder to check for
134+
time.Sleep(100 * time.Millisecond)
135+
if err := exp.Send(string(line) + "\n"); err != nil {
136+
return err
137+
}
132138
}
133139
}
134140
select {

0 commit comments

Comments
 (0)