@@ -116,7 +116,7 @@ def test_smoke(self) -> None:
116
116
self .assertEqual (subprocess .check_output ([str (pathlib .Path ('a.out' ).resolve ())]), ('Hello World' + os .linesep ).encode ())
117
117
118
118
def test_complicated (self ) -> None :
119
- library_files = {
119
+ library_files_1 = {
120
120
pathlib .Path ('library' , 'macro.hpp' ): textwrap .dedent ("""\
121
121
#pragma once
122
122
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
@@ -125,6 +125,8 @@ def test_complicated(self) -> None:
125
125
#define REP3R(i, m, n) for (int i = (int)(n) - 1; (i) >= (int)(m); -- (i))
126
126
#define ALL(x) std::begin(x), std::end(x)
127
127
""" ).encode (),
128
+ }
129
+ library_files_2 = {
128
130
pathlib .Path ('library' , 'fibonacci.hpp' ): textwrap .dedent ("""\
129
131
#pragma once
130
132
#include <cstdint>
@@ -161,12 +163,13 @@ def test_complicated(self) -> None:
161
163
with tempfile .TemporaryDirectory () as tempdir_dst_ :
162
164
tempdir_dst = pathlib .Path (tempdir_dst_ )
163
165
164
- with tests .utils .load_files_pathlib (library_files ) as tempdir_src_library :
165
- with tests .utils .load_files_pathlib (test_files ) as tempdir_src_test :
166
- with open (tempdir_dst / 'main.bundled.cpp' , 'w' ) as fh :
167
- with contextlib .redirect_stdout (fh ):
168
- args = ['-I' , str (tempdir_src_library ), str (tempdir_src_test / 'test' / 'main.cpp' )]
169
- onlinejudge_bundle .main .main (args = args )
166
+ with tests .utils .load_files_pathlib (library_files_1 ) as tempdir_src_library_1 :
167
+ with tests .utils .load_files_pathlib (library_files_2 ) as tempdir_src_library_2 :
168
+ with tests .utils .load_files_pathlib (test_files ) as tempdir_src_test :
169
+ with open (tempdir_dst / 'main.bundled.cpp' , 'w' ) as fh :
170
+ with contextlib .redirect_stdout (fh ):
171
+ args = ['-I' , str (tempdir_src_library_1 ), '-I' , str (tempdir_src_library_2 ), str (tempdir_src_test / 'test' / 'main.cpp' )]
172
+ onlinejudge_bundle .main .main (args = args )
170
173
171
174
# compile
172
175
subprocess .check_call (['g++' , '-o' , str (tempdir_dst / 'a.out' ), str (tempdir_dst / 'main.bundled.cpp' )], stderr = sys .stderr )
@@ -207,4 +210,4 @@ def test_standard_headers(self) -> None:
207
210
onlinejudge_bundle .main .main (args = args )
208
211
209
212
# compile
210
- subprocess .check_call (['g++' , str (tempdir_dst / 'main.bundled.cpp' )], stderr = sys .stderr )
213
+ subprocess .check_call (['g++' , str (tempdir_dst / 'main.bundled.cpp' )], stderr = sys .stderr )
0 commit comments