aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/hash_ut.pyx
diff options
context:
space:
mode:
authorVlad Yaroslavlev <vladon@vladon.com>2022-02-10 16:46:23 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:23 +0300
commit706b83ed7de5a473436620367af31fc0ceecde07 (patch)
tree103305d30dec77e8f6367753367f59b3cd68f9f1 /util/generic/hash_ut.pyx
parent918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff)
downloadydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'util/generic/hash_ut.pyx')
-rw-r--r--util/generic/hash_ut.pyx22
1 files changed, 11 insertions, 11 deletions
diff --git a/util/generic/hash_ut.pyx b/util/generic/hash_ut.pyx
index ecf6dac2e6..ba630cecfd 100644
--- a/util/generic/hash_ut.pyx
+++ b/util/generic/hash_ut.pyx
@@ -1,6 +1,6 @@
# cython: c_string_type=str, c_string_encoding=utf8
-from util.generic.hash cimport THashMap
+from util.generic.hash cimport THashMap
from util.generic.string cimport TString
import pytest
@@ -10,17 +10,17 @@ from libcpp.pair cimport pair
from cython.operator cimport dereference as deref
-def _check_convert(THashMap[TString, int] x):
+def _check_convert(THashMap[TString, int] x):
return x
class TestHash(unittest.TestCase):
def test_constructors_and_assignments(self):
- cdef THashMap[TString, int] c1
+ cdef THashMap[TString, int] c1
c1["one"] = 1
c1["two"] = 2
- cdef THashMap[TString, int] c2 = THashMap[TString, int](c1)
+ cdef THashMap[TString, int] c2 = THashMap[TString, int](c1)
self.assertEqual(2, c1.size())
self.assertEqual(2, c2.size())
self.assertEqual(1, c1.at("one"))
@@ -34,14 +34,14 @@ class TestHash(unittest.TestCase):
self.assertEqual(3, c1.at("three"))
def test_equality_operator(self):
- cdef THashMap[TString, int] base
+ cdef THashMap[TString, int] base
base["one"] = 1
base["two"] = 2
- cdef THashMap[TString, int] c1 = THashMap[TString, int](base)
+ cdef THashMap[TString, int] c1 = THashMap[TString, int](base)
self.assertTrue(c1==base)
- cdef THashMap[TString, int] c2
+ cdef THashMap[TString, int] c2
c2["one"] = 1
c2["two"] = 2
self.assertTrue(c2 == base)
@@ -49,12 +49,12 @@ class TestHash(unittest.TestCase):
c2["three"] = 3
self.assertTrue(c2 != base)
- cdef THashMap[TString, int] c3 = THashMap[TString, int](base)
+ cdef THashMap[TString, int] c3 = THashMap[TString, int](base)
c3["one"] = 0
self.assertTrue(c3 != base)
def test_insert_erase(self):
- cdef THashMap[TString, int] tmp
+ cdef THashMap[TString, int] tmp
self.assertTrue(tmp.insert(pair[TString, int]("one", 0)).second)
self.assertFalse(tmp.insert(pair[TString, int]("one", 1)).second)
self.assertTrue(tmp.insert(pair[TString, int]("two", 2)).second)
@@ -66,12 +66,12 @@ class TestHash(unittest.TestCase):
self.assertTrue(tmp.empty())
def test_iterators_and_find(self):
- cdef THashMap[TString, int] tmp
+ cdef THashMap[TString, int] tmp
self.assertTrue(tmp.begin() == tmp.end())
self.assertTrue(tmp.find("1") == tmp.end())
tmp["1"] = 1
self.assertTrue(tmp.begin() != tmp.end())
- cdef THashMap[TString, int].iterator it = tmp.find("1")
+ cdef THashMap[TString, int].iterator it = tmp.find("1")
self.assertTrue(it != tmp.end())
self.assertEqual(deref(it).second, 1)