This commit is contained in:
Colin P. McCabe
2026-10-09 12:25:26 -07:00
parent ca38924882
commit 384a1dfceb
23 changed files with 4175 additions and 4 deletions
+36 -3
View File
@@ -266,8 +266,41 @@ describe("remote catalog", () => {
"limit",
);
}
await expect(catalog.connectDatabase("a$b")).rejects.toThrow(
"Invalid database name",
);
});
it.each([
"",
".",
"..",
"/db",
"db/",
"a//b",
"a/./b",
"a/../b",
"a b",
"a:b",
"a$b",
"a%b",
"a?b",
"a#b",
"a\\b",
"café",
"a\nb",
])(
"rejects invalid database name %j before sending requests",
async (name) => {
await withCatalog([], async (catalog, requests) => {
for (const method of [
"createDatabase",
"connectDatabase",
"dropDatabase",
] as const) {
await expect(catalog[method](name)).rejects.toThrow(
"invalid database name",
);
}
expect(requests).toEqual([]);
});
},
);
});