Skip to content

Commit 6b9ec76

Browse files
Merge pull request 4GeeksAcademy#34 from Sadiel0/array-methods
added \s to test to pass when space is added
2 parents e93d16f + 08156f8 commit 6b9ec76

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

exercises/10-Array-Methods/app.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
names = ['John', 'Kenny', 'Tom', 'Bob', 'Dilan']
22
## CREATE YOUR FUNCTION HERE
33

4-
54
print(sort_names(names))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def sort_names (arr):
2+
return sorted(arr)

exercises/10-Array-Methods/tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def test_declare_variable():
55
path = os.path.dirname(os.path.abspath(__file__))+'/app.py'
66
with open(path, 'r') as content_file:
77
content = content_file.read()
8-
regex = re.compile(r"def sort_names\(.*\)\:")
8+
regex = re.compile(r"def\s*sort_names\s*\(")
99
assert bool(regex.search(content)) == True
1010

1111

0 commit comments

Comments
 (0)