diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/ob_parse_control.sh | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/tests/ob_parse_control.sh b/tests/ob_parse_control.sh index 90bcb0e..26222f2 100755 --- a/tests/ob_parse_control.sh +++ b/tests/ob_parse_control.sh @@ -54,8 +54,12 @@ is() field_1() { - is 'maintainer field name' "${OB_CONTROL_NAME}" 'Maintainer' - is 'maintainer field value' "${OB_CONTROL_VALUE}" \ + local name="${1}" + local value="${2}" + shift 2 + + is 'maintainer field name' "${name}" 'Maintainer' + is 'maintainer field value' "${value}" \ '"J. Random Hacker" <jrandom@example.com>' return 0 @@ -63,8 +67,12 @@ field_1() field_2() { - is 'build-depends field name' "${OB_CONTROL_NAME}" 'Build-Depends' - is 'build-depends field value' "${OB_CONTROL_VALUE}" \ + local name="${1}" + local value="${2}" + shift 2 + + is 'build-depends field name' "${name}" 'Build-Depends' + is 'build-depends field value' "${value}" \ "opkhelper-3.0,${LF}libfoo-dev,${LF} libbar-dev," return 0 @@ -72,9 +80,12 @@ field_2() field_3() { - is 'homepage field name' "${OB_CONTROL_NAME}" 'Homepage' - is 'homepage field value' "${OB_CONTROL_VALUE}" \ - 'http://www.example.com/' + local name="${1}" + local value="${2}" + shift 2 + + is 'homepage field name' "${name}" 'Homepage' + is 'homepage field value' "${value}" 'http://www.example.com/' return 0 } @@ -87,7 +98,7 @@ field_4() field_cb() { field=$((${field} + 1)) - "field_${field}" + "field_${field}" "${@}" } ob_parse_control - field_cb 'Maintainer' 'Build-Depends Homepage' <<-EOF |