tests for grammar extraction