Пример #1
0
 def minimize_as_integer(self, full=False):
     Integer.shrink(
         self.current_int,
         lambda c: c == self.current_int or self.incorporate_int(c),
         random=self.random,
         full=full,
     )
Пример #2
0
 def minimize_as_integer(self, full=False):
     Integer.shrink(
         self.current_int,
         lambda c: c == self.current_int or self.incorporate_int(c),
         random=self.random,
         full=full,
     )
Пример #3
0
    def shrink_indices(self):
        # We take a bet that there is some monotonic lower bound such that
        # whenever current >= lower_bound the result works.
        for i in hrange(self.size):
            prefix = self.current[:i]
            suffix = self.current[i + 1:]

            Integer.shrink(self.current[i],
                           lambda c: self.current[i] == c or self.incorporate(
                               prefix + hbytes([c]) + suffix),
                           random=self.random)