Skip to content

Commit

Permalink
Added test for greater than and fixed comparator type
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Pinto committed Nov 7, 2016
1 parent 1c3f867 commit e76c019
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/shared/functions.utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ function athena.utils.validate_version()
# RETURNS: 0 (true), 1 (false)
function athena.utils.compare_number()
{
local value=$1
local -i value=$1
local -i compareto_value=$2
local -i comparator=$3
local comparator=$3
case "$comparator" in
">" )
if [[ $value -gt $compareto_value ]]; then
Expand Down
1 change: 1 addition & 0 deletions tests/test.functions.utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ function testcase_athena.utils.validate_version()
bashunit.test.assert_return "athena.utils.validate_version" "1.0.1" "=1.0.1"
bashunit.test.assert_return.expects_fail "athena.utils.validate_version" "1.0.2" "=1.0.1"
bashunit.test.assert_return "athena.utils.validate_version" "1.0.1" "0.8.0"
bashunit.test.assert_return "athena.utils.validate_version" "1.0.1" ">=0.8.0"
}

function testcase_athena.utils.validate_version_format()
Expand Down

0 comments on commit e76c019

Please sign in to comment.