def _check_(
        self,
        instruction_source: ParseSource,
        etc: ExpectationTypeConfigForPfh,
        main_result_for_positive_expectation: PassOrFail,
        rel_opt_config: RelativityOptionConfiguration,
        contents_of_relativity_option_root: DirContents = empty_dir_contents(),
        test_case_name: str = '',
        following_symbols_setup: SymbolsArrEx = SymbolsArrEx.empty()):

        with self.put.subTest(case_name=test_case_name,
                              expectation_type=etc.expectation_type.name,
                              arguments=instruction_source.source_string):
            instruction_check.check(
                self.put, self.parser, instruction_source,
                ArrangementPostAct(
                    pre_contents_population_action=
                    MAKE_CWD_OUTSIDE_OF_EVERY_REL_OPT_DIR,
                    tcds_contents=rel_opt_config.
                    populator_for_relativity_option_root(
                        contents_of_relativity_option_root),
                    symbols=_symbol_table_of(rel_opt_config.symbols,
                                             following_symbols_setup),
                ),
                Expectation(
                    main_result=etc.main_result(
                        main_result_for_positive_expectation),
                    symbol_usages=asrt.matches_sequence(
                        rel_opt_config.symbols.usage_expectation_assertions() +
                        following_symbols_setup.expected_usages_list),
                ))
    def check__with_source_variants(self, instruction_arguments: str,
                                    arrangement: ArrangementPostAct,
                                    expectation: Expectation):

        for source in equivalent_source_variants__with_source_check__consume_last_line(
                self.put, instruction_arguments):
            instruction_check.check(self.put, self.parser, source, arrangement,
                                    expectation)
    def check_rel_opt_variants_with_same_result_for_every_expectation_type(
        self,
        make_instruction_arguments: InstructionArgumentsVariantConstructor,
        main_result: Assertion,
        contents_of_relativity_option_root: DirContents = empty_dir_contents(),
        following_symbols_setup: SymbolsArrEx = SymbolsArrEx.empty()):

        for rel_opt_config in self.accepted_rel_opt_configurations:

            for expectation_type_of_test_case in ExpectationType:
                etc = pfh_expectation_type_config(
                    expectation_type_of_test_case)
                instruction_arguments = make_instruction_arguments.apply(
                    etc, rel_opt_config)
                instruction_source = remaining_source(instruction_arguments)

                with self.put.subTest(
                        expectation_type=etc.expectation_type.name,
                        arguments=instruction_arguments):
                    instruction_check.check(
                        self.put, self.parser, instruction_source,
                        ArrangementPostAct(
                            pre_contents_population_action=
                            MAKE_CWD_OUTSIDE_OF_EVERY_REL_OPT_DIR,
                            tcds_contents=rel_opt_config.
                            populator_for_relativity_option_root(
                                contents_of_relativity_option_root),
                            symbols=_symbol_table_of(rel_opt_config.symbols,
                                                     following_symbols_setup),
                        ),
                        Expectation(
                            main_result=main_result,
                            symbol_usages=asrt.matches_sequence(
                                rel_opt_config.symbols.
                                usage_expectation_assertions() +
                                following_symbols_setup.expected_usages_list)))
Ejemplo n.º 4
0
 def _check(self, parser: InstructionParser, source: ParseSource,
            arrangement: sut.ArrangementPostAct,
            expectation: sut.Expectation):
     sut.check(self.tc, parser, source, arrangement, expectation)
Ejemplo n.º 5
0
 def _check(self, source: ParseSource, arrangement: ArrangementPostAct,
            expectation: Expectation):
     instruction_check.check(self,
                             self._conf().parser, source, arrangement,
                             expectation)
Ejemplo n.º 6
0
 def _check(self, arguments: ArgumentElements,
            arrangement: ArrangementPostAct, expectation: Expectation):
     instruction_check.check(self, self.configuration.parser(),
                             arguments.as_remaining_source, arrangement,
                             expectation)
Ejemplo n.º 7
0
 def _check_with_source_variants(self,
                                 instruction_argument: Arguments,
                                 arrangement: ArrangementPostAct,
                                 expectation: Expectation):
     for source in equivalent_source_variants__with_source_check__multi_line(self, instruction_argument):
         instruction_check.check(self, self.configuration.new_parser(), source, arrangement, expectation)
Ejemplo n.º 8
0
 def _check(self,
            source: ParseSource,
            arrangement: ArrangementPostAct,
            expectation: Expectation):
     instruction_check.check(self, self.configuration.new_parser(), source, arrangement, expectation)
Ejemplo n.º 9
0
 def run_test_with_parser(self, put: unittest.TestCase,
                          parser: InstructionParser, source: ParseSource,
                          arrangement, expectation):
     check(put, parser, source, arrangement, expectation)