Skip to content

Commit

Permalink
fix test_code 2 (shhossain#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
shhossain authored Oct 31, 2023
1 parent 5310177 commit c10ab16
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/test_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ def analyze_code(self) -> None:
# change all header to <bits/stdc++.h>
self.code = re.sub(r'#include\s+<\w+>',
'#include <bits/stdc++.h>', self.code)
# change all header to <bits/stdc++.h>
if not self.code.startswith('#include <bits/stdc++.h>'):
self.code = '#include <bits/stdc++.h>\n' + self.code

def get_command(self):
if sys.platform == 'win32':
Expand Down Expand Up @@ -263,9 +264,9 @@ def fix_path(path):


class Test:
def __init__(self, path) -> None:
def __init__(self, path:str) -> None:
self.readme_path = fix_path(path)
self.codes = self.get_codes() if path.endswith('.md') else self.get_code(path)
self.codes = self.get_codes() if path.lower().endswith('.md') else self.get_code(path)
Log.debug("Testing code in ", path)

def get_codes(self):
Expand Down Expand Up @@ -491,7 +492,6 @@ def get_hash(self, file, repo):

if __name__ == "__main__":
curent_dir = os.getcwd()
cm = CompareGitRepo(
curent_dir, "https://github.com/shhossain/computer_science")
cm = CompareGitRepo(curent_dir, "https://github.com/shhossain/computer_science")
modified_files = cm.compare()
test_all(modified_files)

0 comments on commit c10ab16

Please sign in to comment.