added tests and fixed grammar for test code generation