Add testcases for build metadata set and compare

This should identify testcases that exhibit the bug behaviour as
described in issue #2.