Skip to content

Commit

Permalink
Test identifier formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Mar 25, 2024
1 parent 0183193 commit f6bc957
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import io.trino.sql.tree.Expression;
import io.trino.sql.tree.GenericLiteral;
import io.trino.sql.tree.Identifier;
import io.trino.sql.tree.IntervalLiteral;
import io.trino.sql.tree.StringLiteral;
import org.junit.jupiter.api.Test;
Expand All @@ -30,6 +31,20 @@

public class TestExpressionFormatter
{
@Test
public void testIdentifier()
{
assertFormattedExpression(
new Identifier("abc"),
"abc");
assertFormattedExpression(
new Identifier("with a space"),
"\"with a space\"");
assertFormattedExpression(
new Identifier("with \" quote, $ dollar and ' apostrophe"),
"\"with \"\" quote, $ dollar and ' apostrophe\"");
}

@Test
public void testStringLiteral()
{
Expand Down

0 comments on commit f6bc957

Please sign in to comment.