Guest User

Untitled

a guest
Oct 21st, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.29 KB | None | 0 0
  1. > test('pipeline')
  2. Loading pipeline
  3. Testing pipeline
  4. proto with functions as data :
  5.  
  6. Current environment
  7. <environment: 0x7f91a4fec5c0>
  8.  
  9. ---- Calling op directly
  10.  
  11. Frame 0
  12.  
  13. Showing frame 0 with the following environment
  14. <environment: 0x7f91a81076d8>
  15. Variables:
  16. n:
  17. [1] 0
  18.  
  19. Frame 1
  20.  
  21. Showing frame 1 with the following environment
  22. <environment: 0x7f91a4fec5c0>
  23. Variables:
  24. command_result:
  25. [1] 100
  26.  
  27. Frame 2
  28.  
  29. Showing frame 2 with the following environment
  30. <environment: 0x7f91a4fe3898>
  31. Variables:
  32. enclos:
  33. <environment: base>
  34. envir:
  35. <environment: 0x7f91a4fec5c0>
  36. expr:
  37. {
  38. command_result <- 100
  39. op <- function() {
  40. show.frame <- function(upn) {
  41. if (upn < 0) {
  42. env <- .GlobalEnv
  43. }
  44. else {
  45. env <- parent.frame(n = upn + 1)
  46. }
  47. cat("\nShowing frame", upn, "with the following environment\n")
  48. print(env)
  49. cat("Variables:\n")
  50. vars <- ls(envir = env)
  51. for (vr in vars) {
  52. vrg <- get(vr, envir = env)
  53. if (!is.function(vrg)) {
  54. cat(vr, ":\n", sep = "")
  55. print(vrg)
  56. }
  57. }
  58. }
  59. for (n in c(0, 1, 2)) {
  60. cat("\nFrame", n, "\n")
  61. show.frame(n)
  62. }
  63. command_result
  64. }
  65. cat("\n\nCurrent environment\n")
  66. print(environment())
  67. cat("\n---- Calling op directly\n")
  68. expect_equal(op(), command_result)
  69. cat("\n---- Calling op with do.call\n")
  70. expect_equal(do_call_test(op), command_result)
  71. cat("\n---- Calling op with do.call inside proto\n")
  72. cmd <- register("cmd", op)
  73. expect_equal(cmd$perform(), command_result)
  74. }
  75. .
  76. ---- Calling op with do.call
  77.  
  78. Frame 0
  79.  
  80. Showing frame 0 with the following environment
  81. <environment: 0x7f91a2354788>
  82. Variables:
  83. n:
  84. [1] 0
  85.  
  86. Frame 1
  87.  
  88. Showing frame 1 with the following environment
  89. <environment: 0x7f91a4fec5c0>
  90. Variables:
  91. command_result:
  92. [1] 100
  93.  
  94. Frame 2
  95.  
  96. Showing frame 2 with the following environment
  97. <environment: 0x7f91a4fe3898>
  98. Variables:
  99. enclos:
  100. <environment: base>
  101. envir:
  102. <environment: 0x7f91a4fec5c0>
  103. expr:
  104. {
  105. command_result <- 100
  106. op <- function() {
  107. show.frame <- function(upn) {
  108. if (upn < 0) {
  109. env <- .GlobalEnv
  110. }
  111. else {
  112. env <- parent.frame(n = upn + 1)
  113. }
  114. cat("\nShowing frame", upn, "with the following environment\n")
  115. print(env)
  116. cat("Variables:\n")
  117. vars <- ls(envir = env)
  118. for (vr in vars) {
  119. vrg <- get(vr, envir = env)
  120. if (!is.function(vrg)) {
  121. cat(vr, ":\n", sep = "")
  122. print(vrg)
  123. }
  124. }
  125. }
  126. for (n in c(0, 1, 2)) {
  127. cat("\nFrame", n, "\n")
  128. show.frame(n)
  129. }
  130. command_result
  131. }
  132. cat("\n\nCurrent environment\n")
  133. print(environment())
  134. cat("\n---- Calling op directly\n")
  135. expect_equal(op(), command_result)
  136. cat("\n---- Calling op with do.call\n")
  137. expect_equal(do_call_test(op), command_result)
  138. cat("\n---- Calling op with do.call inside proto\n")
  139. cmd <- register("cmd", op)
  140. expect_equal(cmd$perform(), command_result)
  141. }
  142. .
  143. ---- Calling op with do.call inside proto
  144.  
  145. Frame 0
  146.  
  147. Showing frame 0 with the following environment
  148. <environment: 0x7f91a5e32320>
  149. Variables:
  150. n:
  151. [1] 0
  152.  
  153. Frame 1
  154.  
  155. Showing frame 1 with the following environment
  156. <environment: 0x7f91a4fec5c0>
  157. Variables:
  158. cmd:
  159. proto object
  160. $ perform:function (., ...)
  161. $ name : chr "cmd"
  162. $ func :function ()
  163. command_result:
  164. [1] 100
  165.  
  166. Frame 2
  167.  
  168. Showing frame 2 with the following environment
  169. <environment: 0x7f91a4fe3898>
  170. Variables:
  171. enclos:
  172. <environment: base>
  173. envir:
  174. <environment: 0x7f91a4fec5c0>
  175. expr:
  176. {
  177. command_result <- 100
  178. op <- function() {
  179. show.frame <- function(upn) {
  180. if (upn < 0) {
  181. env <- .GlobalEnv
  182. }
  183. else {
  184. env <- parent.frame(n = upn + 1)
  185. }
  186. cat("\nShowing frame", upn, "with the following environment\n")
  187. print(env)
  188. cat("Variables:\n")
  189. vars <- ls(envir = env)
  190. for (vr in vars) {
  191. vrg <- get(vr, envir = env)
  192. if (!is.function(vrg)) {
  193. cat(vr, ":\n", sep = "")
  194. print(vrg)
  195. }
  196. }
  197. }
  198. for (n in c(0, 1, 2)) {
  199. cat("\nFrame", n, "\n")
  200. show.frame(n)
  201. }
  202. command_result
  203. }
  204. cat("\n\nCurrent environment\n")
  205. print(environment())
  206. cat("\n---- Calling op directly\n")
  207. expect_equal(op(), command_result)
  208. cat("\n---- Calling op with do.call\n")
  209. expect_equal(do_call_test(op), command_result)
  210. cat("\n---- Calling op with do.call inside proto\n")
  211. cmd <- register("cmd", op)
  212. expect_equal(cmd$perform(), command_result)
  213. }
  214. 1
  215. Command : ..
  216. Cleaning up from previous runs : .
  217. Registering commands :
  218. Default namespace : ......
  219. Multiple registrations : ..
  220. Custom namespace : ....
  221. Creating a pipeline : ......
  222.  
  223.  
  224. 1. Error: cmd execution ------------------------------------------------------------------------------------
  225. object 'command_result' not found
  226. 1: expect_equal(cmd$perform(), command_result)
  227. 2: expect_that(object, equals(expected, label = expected.label, ...), info = info, label = label)
  228. 3: condition(object)
  229. 4: all.equal(expected, actual, ...)
  230. 5: all.equal.numeric(expected, actual, ...)
  231. 6: attr.all.equal(target, current, tolerance = tolerance, scale = scale, ...)
  232. 7: mode(current)
  233. 8: cmd$perform()
  234. 9: get(x, envir = this, inherits = inh)(this, ...)
  235. 10: do.call(func, list(), envir = environment(operation))
  236. 11: function ()
  237. {
  238. show.frame <- function(upn) {
  239. if (upn < 0) {
  240. env <- .GlobalEnv
  241. }
  242. else {
  243. env <- parent.frame(n = upn + 1)
  244. }
  245. cat("\nShowing frame", upn, "with the following environment\n")
  246. print(env)
  247. cat("Variables:\n")
  248. vars <- ls(envir = env)
  249. for (vr in vars) {
  250. vrg <- get(vr, envir = env)
  251. if (!is.function(vrg)) {
  252. cat(vr, ":\n", sep = "")
  253. print(vrg)
  254. }
  255. }
  256. }
  257. for (n in c(0, 1, 2)) {
  258. cat("\nFrame", n, "\n")
  259. show.frame(n)
  260. }
  261. command_result
  262. }()
  263. >
Add Comment
Please, Sign In to add comment