+class FloatTests(ValueTestCase):
+ # Note:
+ # I'm not sure if this is a good idea, due to the potential for loss of precision.
+ # It seems that, at least with my installation of Python, floats are 64-bit IEEE, and so, for now, this works.
+
+ encoder = staticmethod(encode_float)
+ reader = staticmethod(read_float)
+
+ def test_random(self):
+ for value in (random.uniform(1.0, float(random.randint(2, 2**10))) for i in xrange(0, 1000)):
+ self.assert_roundtrip(value)
+
+
+class StringTests(ValueTestCase):
+ encoder = staticmethod(encode_string)
+ reader = staticmethod(read_string)
+ letters = ''.join(chr(i) for i in xrange(1, 127))
+
+ def test_random(self):
+ for length in (random.randint(0, 2**10) for i in xrange(0, 1000)):
+ astring = ''.join(random.sample(self.letters * ((length // len(self.letters)) + 1), length))
+ self.assert_roundtrip(astring)
+ self.assert_roundtrip(astring, length=length*2)
+
+
+class UnicodeStringTests(ValueTestCase):
+ encoder = staticmethod(encode_unicode_string)
+ reader = staticmethod(read_unicode_string)
+ letters = u''.join(unichr(i) for i in xrange(1, sys.maxunicode + 1))
+
+ def test_random(self):
+ for length in (random.randint(0, 2**10) for i in xrange(0, 1000)):
+ ustring = u''.join(random.sample(self.letters * ((length // len(self.letters)) + 1), length))
+ ustring = ustring.encode('utf_8').decode('utf_8')
+ self.assert_roundtrip(ustring)
+ self.assert_roundtrip(ustring, length=length*5)
+
+
+class DateTests(ValueTestCase):
+ encoder = staticmethod(encode_date)
+ reader = staticmethod(read_date)
+
+ def test_random(self):
+ pass
+
+