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: exec_join_left_test.go
    path of file: ./repos/corteza/server/pkg/dal
    
    the code of the file until where you have to start completion: package dal

import (
	"context"
	"testing"

	"github.com/cortezaproject/corteza/server/pkg/filter"
	"github.com/stretchr/testify/require"
)

func TestStepJoinLocal(t *testing.T) {
	crs1 := &filter.PagingCursor{}
	crs1.Set("l_pk", 1, false)
	crs1.Set("l_val", "l1 v1", false)
	crs1.Set("f_pk", 1, false)
	crs1.Set("f_fk", 1, false)
	crs1.Set("f_val", "f1 v1", false)

	basicAttrs := []simpleAttribute{
		{ident: "l_pk", t: TypeID{}, primary: true},
		{ident: "l_val", t: TypeText{}},
		{ident: "f_pk", t: TypeID{}, primary: true},
		{ident: "f_fk", t: TypeRef{}},
		{ident: "f_val", t: TypeText{}},
	}
	basicLocalAttrs := []simpleAttribute{
		{ident: "l_pk", t: TypeID{}},
		{ident: "l_val", t: TypeText{}},
	}
	basicForeignAttrs := []simpleAttribute{
		{ident: "f_pk", t: TypeID{}},
		{ident: "f_fk", t: TypeRef{}},
		{ident: "f_val", t: TypeText{}},
	}

	type (
		testCase struct {
			name string

			outAttributes   []simpleAttribute
			leftAttributes  []simpleAttribute
			rightAttributes []simpleAttribute
			joinPred        JoinPredicate

			lIn []simpleRow
			fIn []simpleRow
			out []simpleRow

			f internalFilter
		}
	)

	baseBehavior := []testCase{
		{
			name:            "basic link",

    
func TestStepJoinValidation(t *testing.T) {
	ctx := context.Background()

	basicLocalAttrs := []simpleAttribute{
		{ident: "l_pk", t: TypeID{}},
		{ident: "l_val", t: TypeText{}},
	}
	basicForeignAttrs := []simpleAttribute{
		{ident: "f_pk", t: TypeID{}},
		{ident: "f_fk", t: TypeRef{}},
		{ident: "f_val", t: TypeText{}},
	}
	basicPred := JoinPredicate{Left: "l_pk", Right: "f_fk"}

	run := func(t *testing.T, attrs []simpleAttribute) (err error) {
		sa := &Join{
			Ident:           "jn",
			LeftAttributes:  saToMapping(basicLocalAttrs...),
			RightAttributes: saToMapping(basicForeignAttrs...),

			On: basicPred,

			OutAttributes: saToMapping(attrs...),
		}

		return sa.dryrun(ctx)
	}

	runP := func(t *testing.T, pred JoinPredicate, attrs []simpleAttribute) (err error) {
		sa := &Join{
			Ident:           "jn",
			LeftAttributes:  saToMapping(basicLocalAttrs...),
			RightAttributes: saToMapping(basicForeignAttrs...),

			On: pred,

			OutAttributes: saToMapping(attrs...),
		}

		return sa.dryrun(ctx)
	}

	runF := func(t *testing.T, f internalFilter, attrs []simpleAttribute) (err error) {
		sa := &Join{
			Ident:           "jn",
			LeftAttributes:  saToMapping(basicLocalAttrs...),
			RightAttributes: saToMapping(basicForeignAttrs...),

			On: basicPred,

			Filter: f,

			OutAttributes: saToMapping(attrs...),
		}

		return sa.dryrun(ctx)
	}

	basicAttrs := []simpleAttribute{
		{ident: "l_pk", t: TypeID{}},
		{ident: "l_val", t: TypeText{}},
		{ident: "f_pk", t: TypeID{}},
		{ident: "f_fk", t: TypeRef{}},
		{ident: "f_val", t: TypeText{}},
	}
	_ = basicAttrs

	t.Run("out ident doesn't exist", func(t *testing.T) {
		basicAttrs := []simpleAttribute{
			{ident: "i_not_real"},
		}

		err := run(t, basicAttrs)
		require.Error(t, err)
		require.Contains(t, err.Error(), "i_not_real")
	})

	t.Run("left predicate doesn't exist", func(t *testing.T) {
		err := runP(t, JoinPredicate{Left: "i_not_exist", Right: "f_fk"}, basicAttrs)
		require.Error(t, err)
		require.Contains(t, err.Error(), "i_not_exist")
	})

	t.Run("right predicate doesn't exist", func(t *testing.T) {
		err := runP(t, JoinPredicate{Left: "l_pk", Right: "i_not_exist"}, basicAttrs)
		require.Error(t, err)
		require.Contains(t, err.Error(), "i_not_exist")
	})

	t.Run("sort ident does not exist", func(t *testing.T) {
		err := runF(t, internalFilter{orderBy: filter.SortExprSet{{Column: "i_not_yes"}}}, basicAttrs)
		require.Error(t, err)
		require.Contains(t, err.Error(), "i_not_yes")
	})
}