Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
fanyang01 committed Jan 6, 2025
1 parent eaab772 commit e8713b2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/bats/mysql/table_statement.bats
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/usr/bin/env bats
bats_require_minimum_version 1.5.0

load helper

setup_file() {
mysql_exec_stdin <<-'EOF'
CREATE DATABASE table_statement_test;
USE table_statement_test;
CREATE TABLE peildatum (id INT, name VARCHAR(255));
INSERT INTO peildatum VALUES (1, 'test1'), (2, 'test2');
CREATE TABLE t (id INT, name VARCHAR(255));
INSERT INTO t VALUES (1, 'test1'), (2, 'test2');
EOF
}

Expand All @@ -18,8 +19,10 @@ EOF
}

@test "TABLE statement should return all rows from the table" {
run mysql_exec "TABLE table_statement_test.peildatum"
[ "$status" -eq 0 ]
run -0 mysql_exec_stdin <<-'EOF'
USE table_statement_test;
TABLE t;
EOF
[ "${lines[0]}" = "1 test1" ]
[ "${lines[1]}" = "2 test2" ]
}

0 comments on commit e8713b2

Please sign in to comment.