Пример #1
0
 def test_single_step(self):
     trace = [MacroStep(0, steps=[
         MicroStep(entered_states=['a', 'b', 'c'], transition=Transition('x')),
         MicroStep(entered_states=['a', 'b'], transition=Transition('x')),
         MicroStep(entered_states=['a']),
         MicroStep(entered_states=[])
     ])]
     self.assertEqual(coverage_from_trace(trace), (Counter(a=3, b=2, c=1), Counter({Transition('x'): 2})))
Пример #2
0
    def test_multiple_steps(self):
        trace = [MacroStep(0, steps=[
            MicroStep(entered_states=['a', 'b', 'c'], transition=Transition('x')),
            MicroStep(entered_states=['a', 'b'], transition=Transition('x')),
            MicroStep(entered_states=['a']),
            MicroStep(entered_states=[])
        ])]

        trace.extend(trace)
        self.assertEqual(coverage_from_trace(trace), (Counter(a=6, b=4, c=2), Counter({Transition('x'): 4})))
Пример #3
0
 def test_single_step(self):
     trace = [
         MacroStep(0,
                   steps=[
                       MicroStep(entered_states=['a', 'b', 'c'],
                                 transition=Transition('x')),
                       MicroStep(entered_states=['a', 'b'],
                                 transition=Transition('x')),
                       MicroStep(entered_states=['a']),
                       MicroStep(entered_states=[])
                   ])
     ]
     self.assertEqual(
         coverage_from_trace(trace),
         (Counter(a=3, b=2, c=1), Counter({Transition('x'): 2})))
Пример #4
0
    def test_multiple_steps(self):
        trace = [
            MacroStep(0,
                      steps=[
                          MicroStep(entered_states=['a', 'b', 'c'],
                                    transition=Transition('x')),
                          MicroStep(entered_states=['a', 'b'],
                                    transition=Transition('x')),
                          MicroStep(entered_states=['a']),
                          MicroStep(entered_states=[])
                      ])
        ]

        trace.extend(trace)
        self.assertEqual(
            coverage_from_trace(trace),
            (Counter(a=6, b=4, c=2), Counter({Transition('x'): 4})))
Пример #5
0
 def test_empty_trace(self):
     self.assertEqual(coverage_from_trace([]), (Counter(), Counter()))
Пример #6
0
 def test_empty_trace(self):
     self.assertEqual(coverage_from_trace([]), (Counter(), Counter()))