summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDamian Dlugosz <bigfootdd@gmail.com>2017-01-08 18:24:34 +0100
committerDamian Dlugosz <bigfootdd@gmail.com>2017-02-01 23:33:23 +0100
commite4f682702c43e5251e9868035e4f7d970d97d370 (patch)
treed4a9f081f3f30c15e4e12b39543f55d5c401b8ab /tests
parent7f61c4b57fafce54d77bfded84314b57d5182080 (diff)
downloadsql-parser-e4f682702c43e5251e9868035e4f7d970d97d370.zip
sql-parser-e4f682702c43e5251e9868035e4f7d970d97d370.tar.gz
sql-parser-e4f682702c43e5251e9868035e4f7d970d97d370.tar.bz2
select with comment
Diffstat (limited to 'tests')
-rw-r--r--tests/Utils/FormatterTest.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/Utils/FormatterTest.php b/tests/Utils/FormatterTest.php
index 1c11709..af1966f 100644
--- a/tests/Utils/FormatterTest.php
+++ b/tests/Utils/FormatterTest.php
@@ -265,6 +265,19 @@ class FormatTest extends TestCase
'<span class="sql-reserved">SELECT</span>' . '<br/>' .
'&nbsp;&nbsp;&nbsp;&nbsp;*',
),
+ 'select with comment' => array(
+ 'query' => 'select 1 # Comment',
+ 'text' =>
+ "SELECT\n" .
+ " 1 # Comment" . "\n",
+ 'cli' =>
+ "\x1b[35mSELECT" . "\n" .
+ " \x1b[92m1 \x1b[37m# Comment\\x0A" . "\x1b[0m",
+ 'html' =>
+ '<span class="sql-reserved">SELECT</span>' . '<br/>' .
+ '&nbsp;&nbsp;&nbsp;&nbsp;<span class="sql-number">1</span> <span class="sql-comment"># Comment' . "\n" .
+ '</span>',
+ ),
);
}