Path: redb/redb.Tests.Integration/Tests/Unit/QuoteIdentifierDoublingTests.cs Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Tests.Integration/Tests/Unit/QuoteIdentifierDoublingTests.cs ---- using AwesomeAssertions; using redb.MSSql.Sql; using redb.Postgres.Sql; using redb.SQLite.Sql; using Xunit; namespace redb.Tests.Integration.Tests.Unit; /// /// A quoted identifier must escape its own closing quote by doubling it. Without that, a name that /// carries a closing quote ends the identifier and the remainder becomes SQL (SQLI-PoC p.7). The /// correct pattern already lived in MssqlQueryProvider.QuoteGwndIdent; the dialects did not /// follow it. /// public class QuoteIdentifierDoublingTests { [Fact] public void MsSql_DoublesClosingBracket() => new MsSqlDialect().QuoteIdentifier("a]b; SELECT 1--").Should().Be("[a]]b; SELECT 1--]"); [Fact] public void Postgres_DoublesDoubleQuote() => new PostgreSqlDialect().QuoteIdentifier("a\"b").Should().Be("\"a\"\"b\""); [Fact] public void Sqlite_DoublesDoubleQuote() => new SqliteDialect().QuoteIdentifier("a\"b").Should().Be("\"a\"\"b\""); [Fact] public void PlainNameIsUnchanged() { new MsSqlDialect().QuoteIdentifier("Age").Should().Be("[Age]"); new PostgreSqlDialect().QuoteIdentifier("Age").Should().Be("\"Age\""); new SqliteDialect().QuoteIdentifier("Age").Should().Be("\"Age\""); } }