tests: add utility function for 'ok' case
tests: add utility function for 'error' case