@@ -150,18 +150,7 @@ fn invalid_cases() {
150150 }
151151}
152152
153- #[ test]
154- fn digest ( ) {
155- let instance_path = testcase_dir ( )
156- . join ( "valid_solutions" )
157- . join ( "score10_n07l_lkc.in" ) ;
158- let solution_path = testcase_dir ( )
159- . join ( "valid_solutions" )
160- . join ( "score10_n07l_lkc.out" ) ;
161-
162- const IDIGEST : & str = "015e2a313c3470afe151d1ac2a20b0f3" ;
163- const SDIGEST : & str = "000a5d234052384b8fd9ea7bac0d3c17" ;
164-
153+ fn test_digest ( instance_path : & Path , idigest : & str , solution_path : & Path , sdigest : & str ) {
165154 for with_solution in [ false , true ] {
166155 let mut args = vec ! [
167156 String :: from( "check" ) ,
@@ -178,10 +167,40 @@ fn digest() {
178167 assert ! ( output. status. success( ) ) ;
179168 let stdout = String :: from_utf8 ( output. stdout ) . unwrap ( ) ;
180169
181- assert ! ( stdout. contains( format!( "#s idigest \" {IDIGEST }\" " ) . as_str( ) ) ) ;
170+ assert ! ( stdout. contains( format!( "#s idigest \" {idigest }\" " ) . as_str( ) ) ) ;
182171
183172 if with_solution {
184- assert ! ( stdout. contains( format!( "#s sdigest \" {SDIGEST }\" " ) . as_str( ) ) ) ;
173+ assert ! ( stdout. contains( format!( "#s sdigest \" {sdigest }\" " ) . as_str( ) ) ) ;
185174 }
186175 }
187176}
177+
178+ #[ test]
179+ fn digest ( ) {
180+ let instance_path = testcase_dir ( )
181+ . join ( "valid_solutions" )
182+ . join ( "score10_n07l_lkc.in" ) ;
183+ let solution_path = testcase_dir ( )
184+ . join ( "valid_solutions" )
185+ . join ( "score10_n07l_lkc.out" ) ;
186+
187+ const IDIGEST : & str = "015e2a313c3470afe151d1ac2a20b0f3" ;
188+ const SDIGEST : & str = "000a5d234052384b8fd9ea7bac0d3c17" ;
189+
190+ test_digest ( & instance_path, IDIGEST , & solution_path, SDIGEST ) ;
191+ }
192+
193+ #[ test]
194+ fn digest_with_approx ( ) {
195+ let instance_path = testcase_dir ( )
196+ . join ( "valid_solutions" )
197+ . join ( "score10_n07l_lkc_with_approx.in" ) ;
198+ let solution_path = testcase_dir ( )
199+ . join ( "valid_solutions" )
200+ . join ( "score10_n07l_lkc.out" ) ;
201+
202+ const IDIGEST : & str = "014a7e1e21661a4913f46daa871f53a3" ;
203+ const SDIGEST : & str = "000a5d234052384b8fd9ea7bac0d3c17" ;
204+
205+ test_digest ( & instance_path, IDIGEST , & solution_path, SDIGEST ) ;
206+ }
0 commit comments