File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 23
23
"test_builtin_int.py" ,
24
24
"test_builtin_len.py" ,
25
25
"test_builtin_float.py" ,
26
+ "test_builtin_str_02.py" ,
26
27
"test_math1.py" ,
27
28
"test_math_02.py" ,
28
29
"test_c_interop_01.py" ,
Original file line number Diff line number Diff line change
1
+ def _lpython_str_equal (a : str , b : str ) -> bool :
2
+ if len (a ) != len (b ):
3
+ return False
4
+ i : i32
5
+ for i in range (len (a )):
6
+ if a [i ] != b [i ]:
7
+ return False
8
+ return True
9
+
10
+ def f ():
11
+ assert _lpython_str_equal ("a" , "a" )
12
+ assert not _lpython_str_equal ("a2" , "a" )
13
+ assert not _lpython_str_equal ("a" , "a123" )
14
+ assert not _lpython_str_equal ("a23" , "a24" )
15
+ assert _lpython_str_equal ("a24" , "a24" )
16
+ assert _lpython_str_equal ("abcdefg" , "abcdefg" )
17
+ assert not _lpython_str_equal ("abcdef3" , "abcdefg" )
18
+
19
+ f ()
You can’t perform that action at this time.
0 commit comments