raft: add tests for raft.compact