You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: util_test.go
    path of file: ./repos/casdoor/ldap
    
    the code of the file until where you have to start completion: package ldap

import (
	"testing"

	"github.com/stretchr/testify/assert"

	ber "github.com/go-asn1-ber/asn1-ber"
	goldap "github.com/go-ldap/ldap/v3"
	"github.com/lor00x/goldap/message"
	"github.com/xorm-io/builder"
)

func args(exp ...interface{}) []interface{} {
	return exp
}

func TestLdapFilterAsQuery(t *testing.T) {
	scenarios := []struct {
		description  string
		input        string
		expectedExpr string
		expectedArgs []interface{}
	}{
		{"Should be SQL for FilterAnd", "(&(mail=2)(email=1))", "email=? AND email=?", args("2", "1")},
		{"Should be SQL for FilterOr", "(|(mail=2)(email=1))", "email=? OR email=?", args("2", "1")},
		{"Should be SQL for FilterNot", "(!(mail=2))", "NOT email=?", args("2")},
		{"Should be SQL for FilterEqualityMatch", "(mail=2)", "email=?", args("2")},
		{"Should be SQL for FilterPresent", "(mail=*)", "email IS NOT NULL", nil},
		{"Should be SQL for FilterGreaterOrEqual", "(mail>=admin)", "email>=?", args("admin")},
		{"Should be SQL for FilterLessOrEqual", "(mail<=admin)", "email<=?", args("admin")},
		{"Should be SQL for FilterSubstrings", "(mail=admin*ex*c*m)", "email LIKE ?", args("admin%ex%c%m")},
	}

	for _, scenery := range scenarios {
		t.Run(scenery.description, func(t *testing.T) {
			searchRequest, err := buildLdapSearchRequest(scenery.input)
			if err != nil {
				assert.FailNow(t, "Unable to create searchRequest", err)
			}
			m, err 
    
func TestLdapFilterAsQuery(t *testing.T) {
	scenarios := []struct {
		description  string
		input        string
		expectedExpr string
		expectedArgs []interface{}
	}{
		{"Should be SQL for FilterAnd", "(&(mail=2)(email=1))", "email=? AND email=?", args("2", "1")},
		{"Should be SQL for FilterOr", "(|(mail=2)(email=1))", "email=? OR email=?", args("2", "1")},
		{"Should be SQL for FilterNot", "(!(mail=2))", "NOT email=?", args("2")},
		{"Should be SQL for FilterEqualityMatch", "(mail=2)", "email=?", args("2")},
		{"Should be SQL for FilterPresent", "(mail=*)", "email IS NOT NULL", nil},
		{"Should be SQL for FilterGreaterOrEqual", "(mail>=admin)", "email>=?", args("admin")},
		{"Should be SQL for FilterLessOrEqual", "(mail<=admin)", "email<=?", args("admin")},
		{"Should be SQL for FilterSubstrings", "(mail=admin*ex*c*m)", "email LIKE ?", args("admin%ex%c%m")},
	}

	for _, scenery := range scenarios {
		t.Run(scenery.description, func(t *testing.T) {
			searchRequest, err := buildLdapSearchRequest(scenery.input)
			if err != nil {
				assert.FailNow(t, "Unable to create searchRequest", err)
			}
			m, err := message.ReadLDAPMessage(message.NewBytes(0, searchRequest.Bytes()))
			if err != nil {
				assert.FailNow(t, "Unable to create searchRequest", err)
			}
			req := m.ProtocolOp().(message.SearchRequest)

			cond, err := buildUserFilterCondition(req.Filter())
			if err != nil {
				assert.FailNow(t, "Unable to build condition", err)
			}
			expr, args, err := builder.ToSQL(cond)
			if err != nil {
				assert.FailNow(t, "Unable to build sql", err)
			}

			assert.Equal(t, scenery.expectedExpr, expr)
			assert.Equal(t, scenery.expectedArgs, args)
		})
	}
}