Fix test
Deduplicate macro shape checking code