mirror of
https://github.com/chaisql/chai.git
synced 2025-10-30 10:26:59 +08:00
28 lines
561 B
Go
28 lines
561 B
Go
package expr_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/chaisql/chai/internal/testutil"
|
|
"github.com/chaisql/chai/internal/types"
|
|
)
|
|
|
|
func TestConcatExpr(t *testing.T) {
|
|
tests := []struct {
|
|
expr string
|
|
res types.Value
|
|
fails bool
|
|
}{
|
|
{"'a' || 'b'", types.NewTextValue("ab"), false},
|
|
{"'a' || NULL", nullLiteral, false},
|
|
{"'a' || notFound", nullLiteral, false},
|
|
{"'a' || 1", nullLiteral, false},
|
|
}
|
|
|
|
for _, test := range tests {
|
|
t.Run(test.expr, func(t *testing.T) {
|
|
testutil.TestExpr(t, test.expr, envWithDoc, test.res, test.fails)
|
|
})
|
|
}
|
|
}
|