Skip to content

Commit

Permalink
lets see what we have won...
Browse files Browse the repository at this point in the history
  • Loading branch information
ilaflott committed Jan 23, 2025
1 parent e4c20ab commit 76b3b32
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions t/t001-list_paths.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ setup() {
}

teardown() {
echo FOO #rm -rf ${testDir}
rm -rf ${testDir}
}

@test "list_paths prints version" {
Expand All @@ -26,7 +26,6 @@ teardown() {
}

@test "list_paths using default out file" {
[ -e ${BATS_TEST_DIRNAME}/src ]
run list_paths -vvv ${BATS_TEST_DIRNAME}/src
[ "$status" -eq 0 ]
[ -e path_names ]
Expand All @@ -35,12 +34,8 @@ teardown() {
num_paths=$(cat path_names | wc -l)
echo $num_paths
cat path_names
# [ $num_paths -eq 7 ]
# [ $num_paths -eq 6 ]
[ "$(wc -l < path_names)" -eq "7" ]
[ "$(wc -l < path_names)" -eq 7 ]
[ $(wc -l < path_names) -eq "7" ]
[ $(wc -l < path_names) -eq 7 ]
[ $num_paths -eq 7 ]
}

@test "list_paths verbose output" {
Expand All @@ -50,44 +45,42 @@ teardown() {
num_paths=$(cat path_names | wc -l)
echo $num_paths
cat path_names
[ $num_paths -eq 6 ]
# [ $num_paths -eq 6 ]
[ $num_paths -eq 7 ]
}

@test "list_paths find files in t and test_* directories" {
run list_paths -t ${BATS_TEST_DIRNAME}/src
[ "$status" -eq 0 ]
[ -e path_names ]
pwd
ls path_names
num_paths=$(cat path_names | wc -l)
echo $num_paths
cat path_names
[ "$(wc -l < path_names)" -eq 8 ]
# [ $num_paths -eq 8 ]
[ $num_paths -eq 9 ]
}

@test "list_paths find specific files in t or test_* directories" {
run list_paths ${BATS_TEST_DIRNAME}/src ${BATS_TEST_DIRNAME}/src/t/file7.F90
[ "$status" -eq 0 ]
[ -e path_names ]
pwd
ls path_names
num_paths=$(cat path_names | wc -l)
echo $num_paths
cat path_names
[ "$(wc -l < path_names)" -eq 7 ]
# [ $num_paths -eq 7 ]
[ $num_paths -eq 8 ]
}

@test "list_paths with specified out file" {
outFileName=$(mktemp -u output.XXXXXXXX)
run list_paths -o ${outFileName} ${BATS_TEST_DIRNAME}/src
[ "$status" -eq 0 ]
[ -e ${outFileName} ]
pwd
ls $outFileName
num_paths=$(cat $outFileName | wc -l)
echo $num_paths
cat path_names
[ "$(wc -l < $outFileName)" = "6" ]
# [ $num_paths -eq 6 ]
[ $num_paths -eq 7 ]
}

@test "list_paths finds html files" {
Expand All @@ -100,7 +93,8 @@ teardown() {
num_paths=$(cat path_names | wc -l)
echo $num_paths
cat path_names
[ "$(wc -l < path_names.html)" -eq 5 ]
# [ $num_paths -eq 5 ]
[ $num_paths -eq 6 ]
}

@test "list_paths find symlinks" {
Expand All @@ -112,5 +106,6 @@ teardown() {
num_paths=$(cat path_names | wc -l)
echo $num_paths
cat path_names
[ "$(wc -l < path_names)" -eq 7 ]
# [ $num_paths -eq 7 ]
[ $num_paths -eq 8 ]
}

0 comments on commit 76b3b32

Please sign in to comment.