Add tests for format
Update format.cpp