@@ -68,7 +68,7 @@ with(e, {
6868 bknots = c(- 1 , 1 )
6969
7070 x <- tryCatch(bsplines(xvec , iknots = iknots , bknots = bknots ), error = function (e ) {e })
71- stopifnot(inherits(x , " simpleError " ))
71+ stopifnot(inherits(x , " error " ))
7272 stopifnot(identical(x $ message , " Knots are not sorted." ))
7373
7474 x <- tryCatch(bsplines(xvec , iknots = sort(iknots ), bknots = bknots ), error = function (e ) {e })
@@ -92,7 +92,7 @@ with(e, {
9292e <- new.env()
9393with(e , {
9494 x <- tryCatch(bsplines(list (1 : 10 )), error = function (e ) { e })
95- stopifnot(inherits(x , " simpleError " ))
95+ stopifnot(inherits(x , " error " ))
9696 stopifnot(" error if list passed to bsplines" = identical(x $ message , " x is a list. Use btensor instead of bsplines." ))
9797})
9898
@@ -104,7 +104,7 @@ with(e, {
104104 bknots <- c(- 1 , 1 )
105105
106106 x <- tryCatch(bsplines(xvec , df = 2 , bknots = bknots ), warning = function (w ) {w })
107- stopifnot(identical(class( x ), c( " simpleWarning " , " warning" , " condition " ) ))
107+ stopifnot(inherits( x , " warning" ))
108108 stopifnot(identical(x $ message , " df being set to order" ))
109109
110110 x <- suppressWarnings(bsplines(xvec , df = 2 , bknots = bknots ))
@@ -118,7 +118,7 @@ with(e, {
118118 stopifnot(isTRUE(all.equal(x , z , check.attributes = FALSE )))
119119
120120 x <- tryCatch(bsplines(xvec , iknots = 0.2 , df = 6 , bknots = bknots ), warning = function (w ) {w })
121- stopifnot(identical(class( x ), c( " simpleWarning " , " warning" , " condition " ) ))
121+ stopifnot(inherits( x , " warning" ))
122122 stopifnot(identical(x $ message , " Both iknots and df defined, using iknots" ))
123123
124124 x <- suppressWarnings(bsplines(xvec , iknots = 0.2 , df = 6 , bknots = bknots ))
@@ -210,16 +210,16 @@ with(e, {
210210 stopifnot(isTRUE( all.equal(cprD2 [- 100 , ], baseD2 [- 100 , ])))
211211
212212 x <- tryCatch(bsplineD(xvec , derivative = 1.5 ), error = function (e ) {e })
213- stopifnot(identical(class( x ), c( " simpleError " , " error" , " condition " ) ))
213+ stopifnot(inherits( x , " error" ))
214214 stopifnot(identical(x $ message , " Only first and second derivatives are supported" ))
215215 rm(x )
216216
217217 x <- tryCatch(bsplineD(xvec , derivative = 3 ), error = function (e ) {e })
218- stopifnot(identical(class( x ), c( " simpleError " , " error" , " condition " ) ))
218+ stopifnot(inherits( x , " error" ))
219219 stopifnot(identical(x $ message , " Only first and second derivatives are supported" ))
220220
221221 x <- tryCatch(bsplineD(xvec , order = 2 , derivative = 2 ), error = function (e ) {e })
222- stopifnot(identical(class( x ), c( " simpleError " , " error" , " condition " ) ))
222+ stopifnot(inherits( x , " error" ))
223223 stopifnot(identical(x $ message , " (order - 2) <= 0" ))
224224})
225225
@@ -233,16 +233,16 @@ with(e, {
233233 bmatD1 <- tryCatch(bsplineD(xvec , bknots = bknots , order = 1 , derivative = 1L ), error = function (e ) e )
234234 bmatD2 <- tryCatch(bsplineD(xvec , bknots = bknots , order = 1 , derivative = 2L ), error = function (e ) e )
235235
236- stopifnot(inherits(bmat , " simpleError " ))
237- stopifnot(inherits(bmatD1 , " simpleError " ))
238- stopifnot(inherits(bmatD2 , " simpleError " ))
236+ stopifnot(inherits(bmat , " error " ))
237+ stopifnot(inherits(bmatD1 , " error " ))
238+ stopifnot(inherits(bmatD2 , " error " ))
239239
240240 stopifnot(identical(bmat $ message , " order needs to be an integer value >= 2." ))
241241 stopifnot(identical(bmatD1 $ message , " order needs to be an integer value >= 2." ))
242242 stopifnot(identical(bmatD2 $ message , " order needs to be an integer value >= 2." ))
243243
244244 bmat <- tryCatch(bsplines(xvec , bknots = bknots , order = 1.9 ), error = function (e ) e )
245- stopifnot(inherits(bmat , " simpleError " ))
245+ stopifnot(inherits(bmat , " error " ))
246246 stopifnot(identical(bmat $ message , " order needs to be an integer value >= 2." ))
247247
248248 bmat <- tryCatch(bsplines(xvec , bknots = bknots , order = 2.9 ), error = function (e ) e )
0 commit comments