Add tests for miner

Fix compare bug (with key begin with '@')
Add test for size, first and last calls