Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix test_code 2 #718

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading