The R Project SVN R

Rev

Rev 53068 | Rev 53274 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 53068 Rev 53212
Line 238... Line 238...
238
ff$undo()
238
ff$undo()
239
stopifnot(all.equal(ff$data, xMat))
239
stopifnot(all.equal(ff$data, xMat))
240
rm(ff)
240
rm(ff)
241
gc()
241
gc()
242
stopifnot(identical(markViewer, "OFF")) #check finalize
242
stopifnot(identical(markViewer, "OFF")) #check finalize
-
 
243
 
-
 
244
## deal correctly with inherited methods and overriding existing
-
 
245
## methods from $methods(...)
-
 
246
refClassA <- setRefClass("refClassA", methods=list(foo=function() "A"))
-
 
247
refClassB <- setRefClass("refClassB", contains="refClassA")
-
 
248
mnames <- objects(getClass("refClassB")@refMethods)
-
 
249
refClassB$methods(foo=function() callSuper())
-
 
250
stopifnot(identical(refClassB$new()$foo(), "A"))
-
 
251
mnames2 <- objects(getClass("refClassB")@refMethods)
-
 
252
stopifnot(identical(mnames2[is.na(match(mnames2,mnames))], "foo#refClassA"))
-
 
253
refClassB$methods(foo=function() paste(callSuper(), "Version 2"))
-
 
254
stopifnot(identical(refClassB$new()$foo(), "A Version 2"))
-
 
255
stopifnot(identical(mnames2, objects(getClass("refClassB")@refMethods)))