Exemple #1
0
def test_foo():
    f1 = Foo(10)
    f2 = Foo(10)
    f3 = Foo(10)

    s = {f1, f2, f3}

    assert len(s) == 1
    assert hash(f1) == hash(f2)
    assert hash(f2) == hash(f3)
Exemple #2
0
 def test3(self):
     foo = Foo()
     s = 'facebookmicrosoftfacebookgooglemicrosoft'
     p = 'xyxzy'
     res = foo.match(s, p)
     self.assertEqual(res, True)
Exemple #3
0
 def test1(self):
     foo = Foo()
     s = 'ababab'
     p = 'xxx'
     res = foo.match(s, p)
     self.assertEqual(res, True)
Exemple #4
0
 def test2(self):
     foo = Foo()
     s = 'ababa'
     p = 'xxx'
     res = foo.match(s, p)
     self.assertEqual(res, False)