test: add hook macro test

From issue #357.