]> granicus.if.org Git - python/commitdiff
Test an edge case for sample().
authorRaymond Hettinger <python@rcn.com>
Sat, 4 Jan 2003 05:55:11 +0000 (05:55 +0000)
committerRaymond Hettinger <python@rcn.com>
Sat, 4 Jan 2003 05:55:11 +0000 (05:55 +0000)
Lib/test/test_random.py

index d0a2a15599001b002c6718693881110527d90147..b5fe1e55a5f6868e6e1a889b7ec7cbdef7c14a80 100644 (file)
@@ -63,6 +63,7 @@ class TestBasicOps(unittest.TestCase):
             uniq = dict.fromkeys(s)
             self.assertEqual(len(uniq), k)
             self.failIf(None in uniq)
+        self.assertEqual(self.gen.sample([], 0), [])  # test edge case N==k==0
 
     def test_gauss(self):
         # Ensure that the seed() method initializes all the hidden state.  In