Fixed bug on print

- print function can now work properly even after output buffer is
resized.
- parser test is added.