I have no idea what the previous test was trying to do, but it was clearly wrong and misleading. First, it placed the fragment for no reason in file_name_buf because it then replaced it with a NUL, making you believe it's part of it but when it really was not. Then, it opened the original index.html to write XXX to it, so the fragment filename never actually existed in the first place, and was never tested.