mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-13 18:49:55 -06:00
37 lines
996 B
Bash
37 lines
996 B
Bash
#!/usr/bin/env bats
|
|
|
|
setup() {
|
|
export PATH=$PATH:~/go/bin
|
|
export NOMS_VERSION_NEXT=1
|
|
cd $BATS_TMPDIR
|
|
mkdir "dolt-repo-$$"
|
|
cd "dolt-repo-$$"
|
|
dolt init
|
|
dolt table create -s=$BATS_TEST_DIRNAME/helper/1pk5col-ints.schema test
|
|
}
|
|
|
|
teardown() {
|
|
rm -rf "$BATS_TMPDIR/dolt-repo-$$"
|
|
}
|
|
|
|
@test "start a sql shell and exit using exit" {
|
|
run bash -c "echo exit | dolt sql"
|
|
[ $status -eq 0 ]
|
|
[[ "$output" =~ "# Welcome to the DoltSQL shell." ]] || false
|
|
[[ "$output" =~ "Bye" ]] || false
|
|
}
|
|
|
|
@test "start a sql shell and exit using quit" {
|
|
run bash -c "echo quit | dolt sql"
|
|
[ $status -eq 0 ]
|
|
[[ "$output" =~ "# Welcome to the DoltSQL shell." ]] || false
|
|
[[ "$output" =~ "Bye" ]] || false
|
|
}
|
|
|
|
@test "run a query in sql shell" {
|
|
run bash -c "echo 'select * from test;' | dolt sql"
|
|
[ $status -eq 0 ]
|
|
[[ "$output" =~ "# Welcome to the DoltSQL shell." ]] || false
|
|
[[ "$output" =~ "pk" ]] || false
|
|
[[ "$output" =~ "Bye" ]] || false
|
|
} |