add tests to cabal.  fix test case failure.