The R Project SVN R

Rev

Rev 84105 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 84105 Rev 84107
Line 135... Line 135...
135
  stop("called @.Person()\n")
135
  stop("called @.Person()\n")
136
}
136
}
137
 
137
 
138
p <- new("Person", name = "Who", age = -1)
138
p <- new("Person", name = "Who", age = -1)
139
stopifnot(p@name == "Who")
139
stopifnot(p@name == "Who")
-
 
140
 
-
 
141
 
-
 
142
## Some tests for `chooseOpsMethod()`, called from C DispatchGroup() when
-
 
143
## 2 methods are found
-
 
144
foo_obj <- structure(1, class = "foo")
-
 
145
bar_obj <- structure(1, class = "bar")
-
 
146
 
-
 
147
`+.foo` <- function(e1, e2) "foo"
-
 
148
`+.bar` <- function(e1, e2) "bar"
-
 
149
 
-
 
150
invisible(foo_obj + bar_obj)  # Warning: Incompatible methods
-
 
151
 
-
 
152
chooseOpsMethod.bar <- function(x, y, mx, my, cl, reverse) TRUE
-
 
153
 
-
 
154
stopifnot(exprs = {
-
 
155
    identical(foo_obj + bar_obj, "bar")
-
 
156
    identical(bar_obj + foo_obj, "bar")
-
 
157
})