Fix test for weechat-0.4.1 (and make it generic).

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>