Add tests to gen_test for generator, seems to work