# Path: py3kwarn2to3/tests/support.py
# def parse_string(string):
# def run_all_tests(test_mod=None, tests=None):
# def reformat(string):
# def get_refactorer(fixer_pkg="py3kwarn2to3", fixers=None, options=None):
# def all_project_files():
# 
# Path: py3kwarn2to3/pgen2/tokenize.py
# def tokenize(readline, tokeneater=printtoken):
#     """
#     The tokenize() function accepts two parameters: one representing the
#     input stream, and one providing an output mechanism for tokenize().
# 
#     The first parameter, readline, must be a callable object which provides
#     the same interface as the readline() method of built-in file objects.
#     Each call to the function should return one line of input as a string.
# 
#     The second parameter, tokeneater, must also be a callable object. It is
#     called once for each token, with five arguments, corresponding to the
#     tuples generated by generate_tokens().
#     """
#     try:
#         tokenize_loop(readline, tokeneater)
#     except StopTokenizing:
#         pass
# 
# Path: py3kwarn2to3/pygram.py
# _GRAMMAR_FILE = os.path.join(os.path.dirname(__file__), "Grammar.txt")
# _PATTERN_GRAMMAR_FILE = os.path.join(os.path.dirname(__file__),
#                                      "PatternGrammar.txt")
# class Symbols(object):
#     def __init__(self, grammar):


from . import support
from .support import driver, test_dir
from py3kwarn2to3.pgen2 import tokenize
from ..pgen2.parse import ParseError
from py3kwarn2to3.pygram import python_symbols as syms
import os
import sys
"""Test suite for 2to3's parser and grammar files.

This is the place to add tests for changes to 2to3's grammar, such as those
merging the grammars for Python 2 and 3. In addition to specific tests for
parts of the grammar we've changed, we also make sure we can parse the
test_grammar.py files from both Python 2 and Python 3.
"""

from __future__ import with_statement

# Testing imports

# Python imports

# Local imports


class TestDriver(support.TestCase):

    def test_formfeed(self):
        s = """print 1\n\x0Cprint 2\n"""
        t = driver.parse_string(s)

# Path: py3kwarn2to3/tests/support.py
# def parse_string(string):
# def run_all_tests(test_mod=None, tests=None):
# def reformat(string):
# def get_refactorer(fixer_pkg="py3kwarn2to3", fixers=None, options=None):
# def all_project_files():
# 
# Path: py3kwarn2to3/pgen2/tokenize.py
# def tokenize(readline, tokeneater=printtoken):
#     """
#     The tokenize() function accepts two parameters: one representing the
#     input stream, and one providing an output mechanism for tokenize().
# 
#     The first parameter, readline, must be a callable object which provides
#     the same interface as the readline() method of built-in file objects.
#     Each call to the function should return one line of input as a string.
# 
#     The second parameter, tokeneater, must also be a callable object. It is
#     called once for each token, with five arguments, corresponding to the
#     tuples generated by generate_tokens().
#     """
#     try:
#         tokenize_loop(readline, tokeneater)
#     except StopTokenizing:
#         pass
# 
# Path: py3kwarn2to3/pygram.py
# _GRAMMAR_FILE = os.path.join(os.path.dirname(__file__), "Grammar.txt")
# _PATTERN_GRAMMAR_FILE = os.path.join(os.path.dirname(__file__),
#                                      "PatternGrammar.txt")
# class Symbols(object):
#     def __init__(self, grammar):


# Path: py3kwarn2to3/tests/test_parser.py
from . import support
from .support import driver, test_dir
from py3kwarn2to3.pgen2 import tokenize
from ..pgen2.parse import ParseError
from py3kwarn2to3.pygram import python_symbols as syms
import os
import sys

"""Test suite for 2to3's parser and grammar files.

This is the place to add tests for changes to 2to3's grammar, such as those
merging the grammars for Python 2 and 3. In addition to specific tests for
parts of the grammar we've changed, we also make sure we can parse the
test_grammar.py files from both Python 2 and Python 3.
"""

from __future__ import with_statement

# Testing imports

# Python imports

# Local imports


class TestDriver(support.TestCase):

    def test_formfeed(self):
        s = """print 1\n\x0Cprint 2\n"""
        t = driver.parse_string(s)

        self.assertEqual(t.children[0].children[0].type, syms.print_stmt)