Unit tests for ring buffer, from snippets