(self)
Test that the De Bruijn sequence is correct.
Test that the De Bruijn sequence is correct.
Test that the De Bruijn sequence is correct .
def testDeBruijn(self):
        """Test that the De Bruijn sequence is correct."""
        for s in range(2,7):
            for n in range(1,6):
                db = DeBruijnSequence(s,n)
                self.assertEqual(len(db), s**n)
                db = db + db    # duplicate so we can wrap easier
                subs = set(tuple(db[i:i+n]) for i in range(s**n))
                self.assertEqual(len(subs), s**n)
def testDeBruijn ( self ) : for s in range ( 2 , 7 ) : for n in range ( 1 , 6 ) : db = DeBruijnSequence ( s , n ) self . assertEqual ( len ( db ) , s ** n ) db = db + db # duplicate so we can wrap easier subs = set ( tuple ( db [ i : i + n ] ) for i in range ( s ** n ) ) self . assertEqual ( len ( subs ) , s ** n )