added tests.
fixed the bug that the plugin added "0x0a" to the end of the file.