add test for reader and writer