summaryrefslogtreecommitdiff
path: root/test/dialect/mssql/test_compiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/dialect/mssql/test_compiler.py')
-rw-r--r--test/dialect/mssql/test_compiler.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/test/dialect/mssql/test_compiler.py b/test/dialect/mssql/test_compiler.py
index 732ff1f55..83a610888 100644
--- a/test/dialect/mssql/test_compiler.py
+++ b/test/dialect/mssql/test_compiler.py
@@ -40,10 +40,23 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
self.assert_compile(sql.false(), "0")
self.assert_compile(sql.true(), "1")
- def test_select(self):
- t = table("sometable", column("somecolumn"))
+ @testing.combinations(
+ ("plain", "sometable", "sometable"),
+ ("matched_square_brackets", "colo[u]r", "[colo[u]]r]"),
+ ("unmatched_left_square_bracket", "colo[ur", "[colo[ur]"),
+ ("unmatched_right_square_bracket", "colou]r", "[colou]]r]"),
+ ("double quotes", 'Edwin "Buzz" Aldrin', '[Edwin "Buzz" Aldrin]'),
+ ("dash", "Dash-8", "[Dash-8]"),
+ ("slash", "tl/dr", "[tl/dr]"),
+ ("space", "Red Deer", "[Red Deer]"),
+ ("question mark", "OK?", "[OK?]"),
+ ("percent", "GST%", "[GST%]"),
+ id_="iaa",
+ )
+ def test_identifier_rendering(self, table_name, rendered_name):
+ t = table(table_name, column("somecolumn"))
self.assert_compile(
- t.select(), "SELECT sometable.somecolumn FROM sometable"
+ t.select(), "SELECT {0}.somecolumn FROM {0}".format(rendered_name)
)
def test_select_with_nolock(self):