Add unit tests to validate the dump handler

The dump handler starts to work as expecting. There are still many
special cases that need testing. Especially, the last test case added
does not work with the current implementation.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>