Files
coder/coderd/database/dbtestutil/postgres_internal_test.go
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
727 B
Go
Raw Normal View History

package dbtestutil
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestCopyStrategyClauseForVersion(t *testing.T) {
t.Parallel()
tests := []struct {
name string
versionNum int
want string
}{
{name: "PostgreSQL13HasNoStrategyOption", versionNum: 130022, want: ""},
{name: "PostgreSQL14HasNoStrategyOption", versionNum: 140019, want: ""},
{name: "PostgreSQL15UsesFileCopy", versionNum: 150000, want: " STRATEGY FILE_COPY"},
{name: "PostgreSQL17UsesFileCopy", versionNum: 170006, want: " STRATEGY FILE_COPY"},
}
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
require.Equal(t, tc.want, copyStrategyClauseForVersion(tc.versionNum))
})
}
}