diff options
Diffstat (limited to 'tests/Utils')
-rw-r--r-- | tests/Utils/CLITest.php | 2 | ||||
-rw-r--r-- | tests/Utils/FormatterTest.php | 36 |
2 files changed, 25 insertions, 13 deletions
diff --git a/tests/Utils/CLITest.php b/tests/Utils/CLITest.php index a97d98f..41d3965 100644 --- a/tests/Utils/CLITest.php +++ b/tests/Utils/CLITest.php @@ -39,7 +39,7 @@ class CLITest extends TestCase ), array( array('q' => 'SELECT /* comment */ 1 /* other */', 'f' => 'text'), - "SELECT\n /* comment */ 1 /* other */\n", + "SELECT\n /* comment */ 1 /* other */\n", 0, ), array( diff --git a/tests/Utils/FormatterTest.php b/tests/Utils/FormatterTest.php index 60db8ca..55246e0 100644 --- a/tests/Utils/FormatterTest.php +++ b/tests/Utils/FormatterTest.php @@ -250,12 +250,36 @@ class FormatTest extends TestCase array('type' => 'html'), ), array( + 'SELECT /* Comment */ 1' . "\n" . + 'FROM tbl # Comment' . "\n" . + 'WHERE 1 -- Comment', + 'SELECT' . "\n" . + ' /* Comment */ 1' . "\n" . + 'FROM' . "\n" . + ' tbl # Comment' . "\n" . + 'WHERE' . "\n" . + ' 1 -- Comment', + array('type' => 'text'), + ), + array( 'SELECT 1 # Comment', '<span class="sql-reserved">SELECT</span>' . '<br/>' . ' <span class="sql-number">1</span> <span class="sql-comment"># Comment</span>', array('type' => 'html'), ), array( + 'SELECT 1 -- comment', + '<span class="sql-reserved">SELECT</span>' . '<br/>' . + ' <span class="sql-number">1</span> <span class="sql-comment">-- comment</span>', + array('type' => 'html'), + ), + array( + 'SELECT 1 -- comment', + '<span class="sql-reserved">SELECT</span>' . '<br/>' . + ' <span class="sql-number">1</span>', + array('type' => 'html', 'remove_comments' => true), + ), + array( 'SELECT HEX("1")', '<span class="sql-reserved">SELECT</span>' . '<br/>' . ' <span class="sql-keyword">HEX</span>(<span class="sql-string">"1"</span>)', @@ -317,18 +341,6 @@ class FormatTest extends TestCase array('type' => 'html'), ), array( - 'SELECT 1 -- comment', - '<span class="sql-reserved">SELECT</span>' . '<br/>' . - ' <span class="sql-number">1</span> <span class="sql-comment">-- comment</span>', - array('type' => 'html'), - ), - array( - 'SELECT 1 -- comment', - '<span class="sql-reserved">SELECT</span>' . '<br/>' . - ' <span class="sql-number">1</span>', - array('type' => 'html', 'remove_comments' => true), - ), - array( 'CREATE TABLE IF NOT EXISTS `pma__bookmark` (' . "\n" . ' `id` int(11) NOT NULL auto_increment,' . "\n" . ' `dbase` varchar(255) NOT NULL default "",' . "\n" . |