Skip to content
This repository was archived by the owner on Nov 29, 2020. It is now read-only.

Commit 7da3102

Browse files
committed
include_check.py
1 parent ffaabb0 commit 7da3102

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

include_check.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import os, re
2+
3+
for i in os.listdir() :
4+
if not i.endswith('.cpp') :
5+
continue
6+
a = open(i).read()
7+
try :
8+
for j in re.findall('#include <(\w+)>', a) :
9+
if j == 'cassert' :
10+
assert 'assert(' in a
11+
elif j == 'algorithm' :
12+
assert 'std::max_element' in a
13+
elif j == 'cmath' :
14+
assert 'pow' in a
15+
elif j == 'iomanip' :
16+
assert 'std::left' in a
17+
elif j == 'exception' :
18+
assert 'std::invalid_argument' in a
19+
elif j == 'map' :
20+
assert 'std::map' in a or 'std::pair' in a
21+
elif j in ['list', 'set'] :
22+
assert 'std::' + j in a
23+
else :
24+
assert(False)
25+
except AssertionError :
26+
print('in:', i)
27+
print('include:', j)
28+

0 commit comments

Comments
 (0)