meientau / pstest

A PostScript unit test framework, written in PostScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add assert-error

meientau opened this issue · comments

spec proc errormsg assert-error any*

Execute proc expecting an error. Fails if the error is not indicated or does not contain errormsg.

I've no idea yet how to do this.

  • Is there a standard approach to set up an error handler?
  • Override the standard error handling procedure by shadowing internal procedures?

Dropped the idea of checking for a specific error. Maybe add that later.

Instead, added the concept of a cleanup method to be executed if the test fails. I hope users will know what to clean up when the test fails (you can do that in the initial proc), and what if the test passes (that's in the extra clean proc).