added test and merged both to trunk.