build: check for debug symbols, enable optimizations.
tests: check expected result from write().