Core: add unit test for #1223