File tree Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -38,28 +38,41 @@ def test_str_slice():
38
38
# assert a[0:5:-1] == ""
39
39
40
40
def test_str_isalpha ():
41
- a :str = "helloworld"
42
- b :str = "hj kl"
41
+ a : str = "helloworld"
42
+ b : str = "hj kl"
43
+ c : str = "a12(){}A"
43
44
res : bool = a .isalpha ()
44
45
res2 : bool = b .isalpha ()
46
+ res3 : bool = c .isalpha ()
45
47
assert res == True
46
48
assert res2 == False
49
+ assert res3 == False
50
+
47
51
48
52
def test_str_title ():
49
- a :str = "hello world"
50
- b :str = "hj'kl"
53
+ a : str = "hello world"
54
+ b : str = "hj'kl"
55
+ c : str = "hELlo wOrlD"
56
+ d : str = "{Hel1o}world"
51
57
res : str = a .title ()
52
58
res2 : str = b .title ()
59
+ res3 : str = c .title ()
60
+ res4 : str = d .title ()
53
61
assert res == "Hello World"
54
62
assert res2 == "Hj'Kl"
63
+ assert res3 == "Hello World"
64
+ assert res4 == "{Hel1O}World"
55
65
56
66
def test_str_istitle ():
57
- a :str = "Hello World"
58
- b :str = "Hj'kl"
67
+ a : str = "Hello World"
68
+ b : str = "Hj'kl"
69
+ c : str = "hELlo wOrlD"
59
70
res : bool = a .istitle ()
60
71
res2 : bool = b .istitle ()
72
+ res3 : bool = c .istitle ()
61
73
assert res == True
62
74
assert res2 == False
75
+ assert res3 == False
63
76
64
77
def test_str_repeat ():
65
78
a : str
Original file line number Diff line number Diff line change @@ -685,7 +685,6 @@ def _lpython_str_join(s:str, lis:list[str]) -> str:
685
685
res += s + lis [i ]
686
686
return res
687
687
688
- @overload
689
688
def _lpython_str_isalpha (s : str ) -> bool :
690
689
ch : str
691
690
for ch in s :
@@ -697,7 +696,6 @@ def _lpython_str_isalpha(s: str) -> bool:
697
696
return False
698
697
return True
699
698
700
- @overload
701
699
def _lpython_str_title (s : str ) -> str :
702
700
result : str = ""
703
701
capitalize_next : bool = True
@@ -722,7 +720,6 @@ def _lpython_str_title(s: str) -> str:
722
720
723
721
return result
724
722
725
- @overload
726
723
def _lpython_str_istitle (s : str ) -> bool :
727
724
length : i32 = len (s )
728
725
You can’t perform that action at this time.
0 commit comments