Skip to content

Commit

Permalink
Merge pull request #400 from liquidata-inc/tim/arg-parsing-bats
Browse files Browse the repository at this point in the history
Added 2 skipped argument parsing bats tests.
  • Loading branch information
Tim Sehn authored Feb 15, 2020
2 parents cca79fb + 55cea44 commit 23ae662
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions bats/arg-parsing.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bats
load $BATS_TEST_DIRNAME/helper/common.bash

setup() {
setup_common
mkdir $BATS_TMPDIR/config-test$$
nativevar DOLT_ROOT_PATH $BATS_TMPDIR/config-test$$ /p
cd $BATS_TMPDIR/dolt-repo-$$
}

teardown() {
teardown_common
rm -rf "$BATS_TMPDIR/config-test$$"
}

@test "dolt supports Nix style argument parsing" {
dolt checkout -b this-should-work
run dolt branch
[ $status -eq 0 ]
[[ "$output" =~ "this-should-work" ]] || false
dolt checkout master
dolt branch -d this-should-work

dolt checkout -b "this-should-work"
run dolt branch
[ $status -eq 0 ]
[[ "$output" =~ "this-should-work" ]] || false
dolt checkout master
dolt branch -d "this-should-work"

dolt checkout --b "this-should-work"
run dolt branch
[ $status -eq 0 ]
[[ "$output" =~ "this-should-work" ]] || false
dolt checkout master
dolt branch --d "this-should-work"

skip "Need spaces after single dash arguments"
dolt checkout -bthis-should-work
run dolt branch
[ $status -eq 0 ]
[[ "$output" =~ "this-should-work" ]] || false
dolt checkout master
dolt branch -dthis-should-work
}

@test "dolt supports chaining of modal arguments" {
dolt sql -q "create table test(pk int, primary key (pk))"
skip "Can't chain modal arguments"
dolt table import -fc test `batshelper 1pk5col-ints.csv`
}

0 comments on commit 23ae662

Please sign in to comment.