Updating test cases as per PR comments.

This commit is contained in:
mike12345567 2024-02-28 10:16:21 +00:00
parent 4068df6025
commit 0c51a60e9a
1 changed files with 11 additions and 4 deletions

View File

@ -176,11 +176,18 @@ describe("Captures of real examples", () => {
})
describe("check some edge cases", () => {
const dotTableNames = ["hello.world", "foo.bar.baz"]
it("should handle table names/columns with dots in them", () => {
const tableNames = ["hello.world", "foo.bar.baz"]
const aliasing = new AliasTables(tableNames)
const aliased = aliasing.aliasField("hello.world.field")
expect(aliased).toEqual("a.field")
const aliasing = new AliasTables(dotTableNames)
const aliased = aliasing.aliasField(`"hello.world"."field"`)
expect(aliased).toEqual(`"a"."field"`)
})
it("should confirm table with dots in them works with grave accents", () => {
const aliasing = new AliasTables(dotTableNames)
const aliased = aliasing.aliasField("`hello.world`.`field`")
expect(aliased).toEqual("`a`.`field`")
})
})
})