Add tests for sync and write operations