Пример #1
0
    def test_blank_file(self):
        for name, parser in parsers.items():
            with self.subTest(name, parser=name):
                result = list(parser.parse_fasm_filename(
                    example('blank.fasm')))
                self.assertEqual(result, [])

                check_round_trip(self, parser, result)
Пример #2
0
    def test_comment_file(self):
        for name, parser in parsers.items():
            with self.subTest(name, parser=name):
                result = list(
                    parser.parse_fasm_filename(example('comment.fasm')))
                self.assertEqual(result, [
                    fasm.FasmLine(
                        set_feature=None,
                        annotations=None,
                        comment=' Only a comment.',
                    )
                ])

                check_round_trip(self, parser, result)
Пример #3
0
    def test_one_line_feature(self):
        for name, parser in parsers.items():
            with self.subTest(name, parser=name):
                result = list(
                    parser.parse_fasm_filename(example('feature_only.fasm')))
                self.assertEqual(result, [
                    fasm.FasmLine(
                        set_feature=fasm.SetFasmFeature(
                            feature='EXAMPLE_FEATURE.X0.Y0.BLAH',
                            start=None,
                            end=None,
                            value=1,
                            value_format=None,
                        ),
                        annotations=None,
                        comment=None,
                    )
                ])

                self.assertEqual(fasm.fasm_tuple_to_string(result),
                                 'EXAMPLE_FEATURE.X0.Y0.BLAH\n')
                check_round_trip(self, parser, result)
Пример #4
0
 def test_examples_file(self):
     for name, parser in parsers.items():
         with self.subTest(name, parser=name):
             result = list(parser.parse_fasm_filename(example('many.fasm')))
             check_round_trip(self, parser, result)