aboutsummaryrefslogtreecommitdiffstats
path: root/util/string/cast_ut.pyx
blob: be95ce76aac0ebcc4ba97b9f28bd84ed526ed3dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
# cython: c_string_type=str, c_string_encoding=utf8

from util.string.cast cimport FromString, ToString

import unittest

class TestFromString(unittest.TestCase):
    def test_from_int(self):
        self.assertEqual(FromString[int]("42"), 42)

class TestToString(unittest.TestCase):
    def test_from_int(self):
        self.assertEqual(ToString(42), "42")