More func tests.

This commit is contained in:
go-jet 2019-07-20 14:23:42 +02:00
parent 35d607a62c
commit f0cb772b7a
7 changed files with 19 additions and 8 deletions

View file

@ -127,7 +127,10 @@ func TestStringOperators(t *testing.T) {
LOWER(AllTypes.CharacterVaryingPtr),
UPPER(AllTypes.Character),
BTRIM(AllTypes.CharacterVarying),
BTRIM(AllTypes.CharacterVarying, String("AA")),
LTRIM(AllTypes.CharacterVarying),
LTRIM(AllTypes.CharacterVarying, String("A")),
RTRIM(AllTypes.CharacterVarying),
RTRIM(AllTypes.CharacterVarying, String("B")),
CHR(Int(65)),
//CONCAT(String("string1"), Int(1), Float(11.12)),
@ -143,13 +146,16 @@ func TestStringOperators(t *testing.T) {
RIGHT(String("abcde"), Int(2)),
LENGTH(String("jose")),
LENGTH(String("jose"), String("UTF8")),
LPAD(String("Hi"), Int(5)),
LPAD(String("Hi"), Int(5), String("xy")),
RPAD(String("Hi"), Int(5)),
RPAD(String("Hi"), Int(5), String("xy")),
MD5(AllTypes.CharacterVarying),
REPEAT(AllTypes.Text, Int(33)),
REPLACE(AllTypes.Character, String("BA"), String("AB")),
REVERSE(AllTypes.CharacterVarying),
STRPOS(AllTypes.Text, String("A")),
SUBSTR(AllTypes.CharacterPtr, Int(3)),
SUBSTR(AllTypes.CharacterPtr, Int(3), Int(2)),
TO_HEX(AllTypes.IntegerPtr),
)

View file

@ -73,7 +73,7 @@ func TestDeleteQueryContext(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Microsecond)
defer cancel()
time.Sleep(10 * time.Microsecond)
time.Sleep(10 * time.Millisecond)
dest := []model.Link{}
err := deleteStmt.QueryContext(ctx, db, &dest)
@ -91,7 +91,7 @@ func TestDeleteExecContext(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Microsecond)
defer cancel()
time.Sleep(10 * time.Microsecond)
time.Sleep(10 * time.Millisecond)
_, err := deleteStmt.ExecContext(ctx, db)

View file

@ -258,7 +258,7 @@ func TestInsertWithQueryContext(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Microsecond)
defer cancel()
time.Sleep(10 * time.Microsecond)
time.Sleep(10 * time.Millisecond)
dest := []model.Link{}
err := stmt.QueryContext(ctx, db, &dest)
@ -275,7 +275,7 @@ func TestInsertWithExecContext(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Microsecond)
defer cancel()
time.Sleep(10 * time.Microsecond)
time.Sleep(10 * time.Millisecond)
_, err := stmt.ExecContext(ctx, db)

View file

@ -62,7 +62,7 @@ func TestLockExecContext(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Microsecond)
defer cancel()
time.Sleep(10 * time.Microsecond)
time.Sleep(10 * time.Millisecond)
tx, _ := db.Begin()
defer tx.Rollback()

View file

@ -254,7 +254,7 @@ func TestUpdateQueryContext(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Microsecond)
defer cancel()
time.Sleep(10 * time.Microsecond)
time.Sleep(10 * time.Millisecond)
dest := []model.Link{}
err := updateStmt.QueryContext(ctx, db, &dest)
@ -273,7 +273,7 @@ func TestUpdateExecContext(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Microsecond)
defer cancel()
time.Sleep(10 * time.Microsecond)
time.Sleep(10 * time.Millisecond)
_, err := updateStmt.ExecContext(ctx, db)