Port from groonga.org for test