Skip to content

Commit

Permalink
Some tests to pin the new statistical capabilities (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Sep 20, 2022
1 parent bf63a13 commit 47e2370
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/journey/ein.sh
Expand Up @@ -55,6 +55,24 @@ title "Porcelain ${kind}"
expect_run_sh $SUCCESSFULLY "$exe t estimate-hours --omit-unify-identities 2>/dev/null"
}
)
(with "the --file-stats argument"
it "succeeds and shows file statistics" && {
WITH_SNAPSHOT="$snapshot/file-stats-success" \
expect_run_sh $SUCCESSFULLY "$exe tool estimate-hours --file-stats 2>/dev/null"
}
)
(with "the --line-stats argument"
it "succeeds and shows line statistics" && {
WITH_SNAPSHOT="$snapshot/line-stats-success" \
expect_run_sh $SUCCESSFULLY "$exe tool estimate-hours --line-stats 2>/dev/null"
}
)
(with "all --stats arguments and pii"
it "succeeds and shows all statistics" && {
WITH_SNAPSHOT="$snapshot/all-stats-success" \
expect_run_sh $SUCCESSFULLY "$exe tool estimate-hours -pfl 2>/dev/null"
}
)
(with "a branch name that doesn't exist"
it "fails and shows a decent enough error message" && {
WITH_SNAPSHOT="$snapshot/invalid-branch-name-failure" \
Expand Down
13 changes: 13 additions & 0 deletions tests/snapshots/porcelain/estimate-hours/all-stats-success
@@ -0,0 +1,13 @@
Sebastian Thiel <git@example.com>
3 commits found
total time spent: 2.00h (0.25 8h days, 100.00%)
total files added/removed/modified: 1/0/1 (100.00%)
total lines added/removed: 1/0 (100.00%)

total hours: 2.00
total 8h days: 0.25
total commits = 3
total authors: 1
total files added/removed/modified: 1/0/1
total lines added/removed: 1/0
total unique authors: 1 (0.00% duplication)
6 changes: 6 additions & 0 deletions tests/snapshots/porcelain/estimate-hours/file-stats-success
@@ -0,0 +1,6 @@
total hours: 2.00
total 8h days: 0.25
total commits = 3
total authors: 1
total files added/removed/modified: 1/0/1
total unique authors: 1 (0.00% duplication)
6 changes: 6 additions & 0 deletions tests/snapshots/porcelain/estimate-hours/line-stats-success
@@ -0,0 +1,6 @@
total hours: 2.00
total 8h days: 0.25
total commits = 3
total authors: 1
total lines added/removed: 1/0
total unique authors: 1 (0.00% duplication)

0 comments on commit 47e2370

Please sign in to comment.