tests: add tests for top-level redefinitions