Skip to content

Commit

Permalink
Updated tests for CliTable, updated deps (#280)
Browse files Browse the repository at this point in the history
* Updated tests for CliTable, updated deps

* Fixed test

---------

Co-authored-by: nick <nick@manticoresearch.com>
  • Loading branch information
Nick-S-2018 and nick committed May 9, 2024
1 parent 2b6e7d0 commit 32a0ff5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions test/Buddy/functional/CliTableTest.php
Expand Up @@ -61,6 +61,22 @@ public function testCliQueryOk(): void {
$query = "INSERT INTO test(f) VALUES('$multiLineValue')";
$out = static::runHTTPQuery($query, true, 'cli');

$query = 'SELECT 1,2 FROM test';
$out = static::runHTTPQuery($query, true, 'cli');
if (isset($out[0]['columns'])) {
$result = preg_match(
"/\+-+\+-+\+\n"
. "\| 1\s+\| 2\s+\|\n"
. "\+-+\+-+\+\n"
. "\| 1\s+\| 2\s+\|\n"
. "\| 1\s+\| 2\s+\|\n"
. "\+-+\+-+\+\n"
. "2 rows in set \(\d\.\d{3} sec\)\n/s",
$out[0]['columns']
);
$this->assertEquals(1, $result);
}

$query = 'SELECT * FROM test';
$out = static::runHTTPQuery($query, true, 'cli');
if (isset($out[0]['columns'])) {
Expand Down

0 comments on commit 32a0ff5

Please sign in to comment.