def decorator(cls):
    def make_test_function(input, expected):

        def test_func(self):
            parser = Parser()
            result = parser.parse(input).to_ecma()
            self.assertMultiLineEqual(result, expected)

        return test_func

    for index, input in enumerate(cls.TEST_CASES):
        input = textwrap.dedent(input).strip()
        func = make_test_function(input, input)
        setattr(cls, 'test_case_%d' % index, func)

    return cls
dataset/ETHPy150Open rspivak/slimit/src/slimit/tests/test_ecmavisitor.py/decorator/original