@@ -24,13 +24,13 @@ argmin.f = c(0.5427730, 0.15)
2424min.f = 0.3978874
2525
2626library(testthat )
27- test_that(" f(armgin.f) == f.min" ,{expect_equal(f(matrix (argmin.f ,nrow = 1 ))[1 ,1 ],min.f ,tolerance = .0001 )})
28- test_that(" f_constr(armgin.f) == 0" ,{expect_equal(f(matrix (argmin.f ,nrow = 1 ))[1 ,2 ],0 ,tolerance = .0001 )})
27+ if ( ! isTRUE( test_that(" f(armgin.f) == f.min" ,{expect_equal(f(matrix (argmin.f ,nrow = 1 ))[1 ,1 ],min.f ,tolerance = .0001 )}))) quit( status = 1 )
28+ if ( ! isTRUE( test_that(" f_constr(armgin.f) == 0" ,{expect_equal(f(matrix (argmin.f ,nrow = 1 ))[1 ,2 ],0 ,tolerance = .0001 )}))) quit( status = 1 )
2929
3030test = function (algorithm_file ) {
3131 results = run.algorithm(algorithm_file , options = list (nugget = ' 0.1' , nugget_constr = ' 0.1' ),fun = list (input = input.f ,output = output.f ))
32- test_that(" branin constr min" ,{expect_equal(as.numeric(results $ min ),min.f ,tolerance = .1 )})
32+ if ( ! isTRUE( test_that(" branin constr min" ,{expect_equal(as.numeric(results $ min ),min.f ,tolerance = .1 )}))) quit( status = 1 )
3333 if (! is.numeric(results $ argmin )) results $ argmin = jsonlite :: fromJSON(results $ argmin )
34- test_that(" branin constr argmin" ,{expect_equal(sum((results $ argmin - argmin.f )^ 2 ),0 ,tolerance = .01 )})
34+ if ( ! isTRUE( test_that(" branin constr argmin" ,{expect_equal(sum((results $ argmin - argmin.f )^ 2 ),0 ,tolerance = .01 )}))) quit( status = 1 )
3535}
3636
0 commit comments