Skip to content

Commit

Permalink
#25 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Oct 13, 2023
1 parent c9af517 commit dad7524
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions tests/metrics/test-pmd.sh
Expand Up @@ -34,6 +34,8 @@ ruby --version > /dev/null
java="${temp}/Foo long 'weird' name (--).java"
mkdir -p "$(dirname "${java}")"
echo "class Foo {}" > "${java}"
"${LOCAL}/metrics/pmd.sh" "${java}" "${temp}/stdout" >> "${stdout}" 2>&1
grep "coco 0" "${temp}/stdout" >> "${stdout}" 2>&1
{
"${LOCAL}/metrics/pmd.sh" "${java}" "${temp}/stdout"
grep "coco 0" "${temp}/stdout"
} >> "${stdout}" 2>&1
echo "👍🏻 Correctly calculated congitive complexity"
10 changes: 6 additions & 4 deletions tests/steps/test-measure.sh
Expand Up @@ -31,8 +31,10 @@ java="${TARGET}/github/${repo}/${name}"
mkdir -p "$(dirname "${java}")"
echo "class Foo {}" > "${java}"
msg=$("${LOCAL}/steps/measure.sh")
echo "${msg}" | grep "for Foo.java (1/1)" >> "${stdout}" 2>&1
echo "${msg}" | grep "All metrics calculated in 1 files" >> "${stdout}" 2>&1
test -e "${TARGET}/measurements/${repo}/${name}.m"
test ! -e "${TARGET}/measurements/${repo}/${name}.m.NHD"
{
echo "${msg}" | grep "for Foo.java (1/1)"
echo "${msg}" | grep "All metrics calculated in 1 files"
test -e "${TARGET}/measurements/${repo}/${name}.m"
test ! -e "${TARGET}/measurements/${repo}/${name}.m.NHD"
} >> "${stdout}" 2>&1
echo "👍🏻 Measured metrics correctly"
2 changes: 1 addition & 1 deletion tests/steps/test-polish.sh
Expand Up @@ -44,4 +44,4 @@ echo "👍🏻 An obsolete directory was deleted"
TARGET=${TARGET}/dir-is-absent
msg=$("${LOCAL}/steps/polish.sh")
echo "${msg}" | grep "Nothing to polish, the directory is absent" >> "${stdout}" 2>&1
echo "👍🏻 An empty directory passes filtering"
echo "👍🏻 An empty directory passed filtering"

0 comments on commit dad7524

Please sign in to comment.