Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed Apr 22, 2024
1 parent bb14522 commit 0013b84
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions clients/snowflake/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,35 @@ func TestAddPrefixToTableName(t *testing.T) {
const prefix = "%"
type _testCase struct {
name string
fqTableName TableIdentifier
tableID TableIdentifier
expectedFqTableName string
}

testCases := []_testCase{
{
name: "happy path",
fqTableName: NewTableIdentifier("database", "schema", "tableName", true),
tableID: NewTableIdentifier("database", "schema", "tableName", true),
expectedFqTableName: "database.schema.%tableName",
},
{
name: "tableName only",
fqTableName: NewTableIdentifier("", "", "orders", true),
tableID: NewTableIdentifier("", "", "orders", true),
expectedFqTableName: "..%orders",
},
{
name: "schema and tableName only",
fqTableName: NewTableIdentifier("", "public", "orders", true),
tableID: NewTableIdentifier("", "public", "orders", true),
expectedFqTableName: ".public.%orders",
},
{
name: "db and tableName only",
fqTableName: NewTableIdentifier("db", "", "tableName", true),
tableID: NewTableIdentifier("db", "", "tableName", true),
expectedFqTableName: "db..%tableName",
},
}

for _, testCase := range testCases {
assert.Equal(t, addPrefixToTableName(testCase.fqTableName, prefix), testCase.expectedFqTableName, testCase.name)
assert.Equal(t, addPrefixToTableName(testCase.tableID, prefix), testCase.expectedFqTableName, testCase.name)
}
}

Expand Down

0 comments on commit 0013b84

Please sign in to comment.