mirror of
https://github.com/dolthub/dolt.git
synced 2025-12-31 00:50:14 -06:00
Add vinai's changes
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
#!/usr/bin/env bats
|
||||
load $BATS_TEST_DIRNAME/helper/common.bash
|
||||
|
||||
setup() {
|
||||
setup_common
|
||||
|
||||
dolt sql <<SQL
|
||||
CREATE TABLE test (
|
||||
pk int primary key
|
||||
);
|
||||
CREATE TABLE test2 (
|
||||
pk int primary key
|
||||
);
|
||||
INSERT INTO test VALUES (0),(1),(2);
|
||||
SQL
|
||||
}
|
||||
|
||||
teardown() {
|
||||
assert_feature_version
|
||||
teardown_common
|
||||
}
|
||||
|
||||
@test "active_branch() func" {
|
||||
run dolt sql -q 'select active_branch()' -r csv
|
||||
[ $status -eq 0 ]
|
||||
# TODO: Get rid of this echo.
|
||||
echo $output
|
||||
[[ "$output" =~ "ACTIVE_BRANCH()" ]] || false
|
||||
[[ "$output" =~ "master" ]] || false
|
||||
}
|
||||
|
||||
@test "active_branch() func on feature branch" {
|
||||
run dolt branch tmp_br
|
||||
run dolt checkout tmp_br
|
||||
run dolt sql -q 'select active_branch()' -r csv
|
||||
[ $status -eq 0 ]
|
||||
[[ "$output" =~ "ACTIVE_BRANCH()" ]] || false
|
||||
[[ "$output" =~ "tmp_br" ]] || false
|
||||
}
|
||||
@@ -946,3 +946,19 @@ SQL
|
||||
[[ ! "$output" =~ ',p2,PROCEDURE,' ]] || false
|
||||
[[ "${#lines[@]}" = "1" ]] || false
|
||||
}
|
||||
|
||||
@test "sql: active_branch() func" {
|
||||
run dolt sql -q 'select active_branch()' -r csv
|
||||
[ $status -eq 0 ]
|
||||
[[ "$output" =~ "ACTIVE_BRANCH()" ]] || false
|
||||
[[ "$output" =~ "master" ]] || false
|
||||
}
|
||||
|
||||
@test "sql: active_branch() func on feature branch" {
|
||||
run dolt branch tmp_br
|
||||
run dolt checkout tmp_br
|
||||
run dolt sql -q 'select active_branch()' -r csv
|
||||
[ $status -eq 0 ]
|
||||
[[ "$output" =~ "ACTIVE_BRANCH()" ]] || false
|
||||
[[ "$output" =~ "tmp_br" ]] || false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user