The R Project SVN R

Rev

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

Rev 55988 Rev 56036
Line 126... Line 126...
126
            )
126
            )
127
 
127
 
128
f4 <- new("foo4", flag = "another test", bar = 1:3)
128
f4 <- new("foo4", flag = "another test", bar = 1:3)
129
stopifnot(identical(f4@made, R.version))
129
stopifnot(identical(f4@made, R.version))
130
 
130
 
-
 
131
## a trivial class with no fields, using fields = list(), failed up to rev 56035
-
 
132
foo5 <- setRefClass("foo5", fields = list(),
-
 
133
                    methods = list(bar = function(test) paste("*",test,"*")))
-
 
134
 
-
 
135
f5 <- foo5$new()
-
 
136
stopifnot(identical( f5$bar("xxx"), paste("*","xxx", "*")))
-
 
137
 
-
 
138
 
131
## simple active binding test
139
## simple active binding test
132
abGen <- setRefClass("ab",
140
abGen <- setRefClass("ab",
133
                  fields = list(a = "ANY",
141
                  fields = list(a = "ANY",
134
                  b = function(x) if(missing(x)) a else {a <<- x; x}))
142
                  b = function(x) if(missing(x)) a else {a <<- x; x}))
135
 
143