core: new unit test for an old bug altered but unfixed by refactor