Sort tests.
flush and write functions.