Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Commit 0ac578a

Browse files
author
Ehsan Totoni
committed
test string const, equality
1 parent a597473 commit 0ac578a

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

hpat/tests/test_strings.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,22 @@ def test_impl(_str):
1313
arg = ['test_str1', 'test_str2']
1414
self.assertEqual(hpat_func(arg), test_impl(arg))
1515

16+
def test_const(self):
17+
def test_impl():
18+
return 'test_str'
19+
hpat_func = hpat.jit(test_impl)
20+
self.assertEqual(hpat_func(), test_impl())
21+
22+
def test_equality(self):
23+
def test_impl(_str):
24+
return (_str=='test_str')
25+
hpat_func = hpat.jit(test_impl)
26+
arg = 'test_str'
27+
self.assertEqual(hpat_func(arg), test_impl(arg))
28+
def test_impl(_str):
29+
return (_str!='test_str')
30+
hpat_func = hpat.jit(test_impl)
31+
self.assertEqual(hpat_func(arg), test_impl(arg))
32+
1633
if __name__ == "__main__":
1734
unittest.main()

0 commit comments

Comments
 (0)