cast_ut.pyx 360 B

12345678910111213
  1. # cython: c_string_type=str, c_string_encoding=utf8
  2. from util.string.cast cimport FromString, ToString
  3. import unittest
  4. class TestFromString(unittest.TestCase):
  5. def test_from_int(self):
  6. self.assertEquals(FromString[int]("42"), 42)
  7. class TestToString(unittest.TestCase):
  8. def test_from_int(self):
  9. self.assertEquals(ToString(42), "42")