Is there something analogous to the assert command offered by various programming languages to assert certain conditions?
In particular I am looking for a way to outfit my .tex files with assertions about the engine used (e.g. LuaLaTeX or PDFLaTeX). I know I can use ifluatex to check for it being used, but that still requires me to use a rather verbose notation of what I want (besides, I still haven't figured out how to throw an error and show a message of my choice).
So just to clarify: I am looking for a primitive like assert that will cause an error if the assertion isn't satisfied and will not do anything otherwise. The only other question regarding assertions which I could find was this one, but the answers dodge that and instead provide solutions tailored to the question. I am looking for a generic way to assert certain conditions, though.
ifxetexpackage offers\RequireXeTeXwhich raises an error. Unfortunatelyifluatexdoesn't seem to have a counterpart. – Henri Menke Feb 23 '19 at 22:16