add tests for generation from rules