#!/bin/sh

##------------------------------------
# ShellUnit test framework functions
##------------------------------------
assertEquals() {
  if [ "${1}" != "${2}" ]; then
    echo >&2 "FAILED: Expected ${1}, actual ${2}"
    exit 1
  fi
}


assertFileEquals() {
  Diff=`diff ${1} ${2}`
  if [ -n "${Diff}" ]; then
    echo  >&2 "FAILED: Files differ ${1} ${2}"
    echo  >&2 "${Diff}"
    exit 1
  fi
}

assertTrue() {
  eval $@
  if [ 0 -ne $? ] ; then
    echo >&2 "FAILED: Assertion failed"
    echo >&2 "$@" 
    exit 1
  fi
}

runTest() {
  echo "[TEST:${1}]"
  ${1}
}
