Create comprehensive documentation for future Claude Code instances working in this repository, including: - Development commands for testing, building, and code quality - Core architecture overview of the SQL query builder system - Directory structure and component explanations - Testing patterns and conventions - Key dependencies and their purposes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
package exp_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.fsdpf.net/go/db/exp"
|
|
"github.com/stretchr/testify/suite"
|
|
)
|
|
|
|
type lateralExpressionSuite struct {
|
|
suite.Suite
|
|
}
|
|
|
|
func TestLateralExpressionSuite(t *testing.T) {
|
|
suite.Run(t, &lateralExpressionSuite{})
|
|
}
|
|
|
|
func (les *lateralExpressionSuite) TestClone() {
|
|
le := exp.NewLateralExpression(newTestAppendableExpression(`SELECT * FROM "test"`, []interface{}{}))
|
|
les.Equal(exp.NewLateralExpression(newTestAppendableExpression(`SELECT * FROM "test"`, []interface{}{})), le.Clone())
|
|
}
|
|
|
|
func (les *lateralExpressionSuite) TestExpression() {
|
|
le := exp.NewLateralExpression(newTestAppendableExpression(`SELECT * FROM "test"`, []interface{}{}))
|
|
les.Equal(le, le.Expression())
|
|
}
|
|
|
|
func (les *lateralExpressionSuite) TestLateral() {
|
|
le := exp.NewLateralExpression(newTestAppendableExpression(`SELECT * FROM "test"`, []interface{}{}))
|
|
les.Equal(newTestAppendableExpression(`SELECT * FROM "test"`, []interface{}{}), le.Table())
|
|
}
|
|
|
|
func (les *lateralExpressionSuite) TestAs() {
|
|
le := exp.NewLateralExpression(newTestAppendableExpression(`SELECT * FROM "test"`, []interface{}{}))
|
|
les.Equal(exp.NewAliasExpression(le, "foo"), le.As("foo"))
|
|
}
|