[PATCH 3/3] reg/tests: Split 'query' syntax tests into a separate function