-
-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #400 from liquidata-inc/tim/arg-parsing-bats
Added 2 skipped argument parsing bats tests.
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` | ||
} |