|
> test('pipeline') |
|
Loading pipeline |
|
Testing pipeline |
|
proto with functions as data : |
|
|
|
Current environment |
|
<environment: 0x7f91a4fec5c0> |
|
|
|
---- Calling op directly |
|
|
|
Frame 0 |
|
|
|
Showing frame 0 with the following environment |
|
<environment: 0x7f91a81076d8> |
|
Variables: |
|
n: |
|
[1] 0 |
|
|
|
Frame 1 |
|
|
|
Showing frame 1 with the following environment |
|
<environment: 0x7f91a4fec5c0> |
|
Variables: |
|
command_result: |
|
[1] 100 |
|
|
|
Frame 2 |
|
|
|
Showing frame 2 with the following environment |
|
<environment: 0x7f91a4fe3898> |
|
Variables: |
|
enclos: |
|
<environment: base> |
|
envir: |
|
<environment: 0x7f91a4fec5c0> |
|
expr: |
|
{ |
|
command_result <- 100 |
|
op <- function() { |
|
show.frame <- function(upn) { |
|
if (upn < 0) { |
|
env <- .GlobalEnv |
|
} |
|
else { |
|
env <- parent.frame(n = upn + 1) |
|
} |
|
cat("\nShowing frame", upn, "with the following environment\n") |
|
print(env) |
|
cat("Variables:\n") |
|
vars <- ls(envir = env) |
|
for (vr in vars) { |
|
vrg <- get(vr, envir = env) |
|
if (!is.function(vrg)) { |
|
cat(vr, ":\n", sep = "") |
|
print(vrg) |
|
} |
|
} |
|
} |
|
for (n in c(0, 1, 2)) { |
|
cat("\nFrame", n, "\n") |
|
show.frame(n) |
|
} |
|
command_result |
|
} |
|
cat("\n\nCurrent environment\n") |
|
print(environment()) |
|
cat("\n---- Calling op directly\n") |
|
expect_equal(op(), command_result) |
|
cat("\n---- Calling op with do.call\n") |
|
expect_equal(do_call_test(op), command_result) |
|
cat("\n---- Calling op with do.call inside proto\n") |
|
cmd <- register("cmd", op) |
|
expect_equal(cmd$perform(), command_result) |
|
} |
|
. |
|
---- Calling op with do.call |
|
|
|
Frame 0 |
|
|
|
Showing frame 0 with the following environment |
|
<environment: 0x7f91a2354788> |
|
Variables: |
|
n: |
|
[1] 0 |
|
|
|
Frame 1 |
|
|
|
Showing frame 1 with the following environment |
|
<environment: 0x7f91a4fec5c0> |
|
Variables: |
|
command_result: |
|
[1] 100 |
|
|
|
Frame 2 |
|
|
|
Showing frame 2 with the following environment |
|
<environment: 0x7f91a4fe3898> |
|
Variables: |
|
enclos: |
|
<environment: base> |
|
envir: |
|
<environment: 0x7f91a4fec5c0> |
|
expr: |
|
{ |
|
command_result <- 100 |
|
op <- function() { |
|
show.frame <- function(upn) { |
|
if (upn < 0) { |
|
env <- .GlobalEnv |
|
} |
|
else { |
|
env <- parent.frame(n = upn + 1) |
|
} |
|
cat("\nShowing frame", upn, "with the following environment\n") |
|
print(env) |
|
cat("Variables:\n") |
|
vars <- ls(envir = env) |
|
for (vr in vars) { |
|
vrg <- get(vr, envir = env) |
|
if (!is.function(vrg)) { |
|
cat(vr, ":\n", sep = "") |
|
print(vrg) |
|
} |
|
} |
|
} |
|
for (n in c(0, 1, 2)) { |
|
cat("\nFrame", n, "\n") |
|
show.frame(n) |
|
} |
|
command_result |
|
} |
|
cat("\n\nCurrent environment\n") |
|
print(environment()) |
|
cat("\n---- Calling op directly\n") |
|
expect_equal(op(), command_result) |
|
cat("\n---- Calling op with do.call\n") |
|
expect_equal(do_call_test(op), command_result) |
|
cat("\n---- Calling op with do.call inside proto\n") |
|
cmd <- register("cmd", op) |
|
expect_equal(cmd$perform(), command_result) |
|
} |
|
. |
|
---- Calling op with do.call inside proto |
|
|
|
Frame 0 |
|
|
|
Showing frame 0 with the following environment |
|
<environment: 0x7f91a5e32320> |
|
Variables: |
|
n: |
|
[1] 0 |
|
|
|
Frame 1 |
|
|
|
Showing frame 1 with the following environment |
|
<environment: 0x7f91a4fec5c0> |
|
Variables: |
|
cmd: |
|
proto object |
|
$ perform:function (., ...) |
|
$ name : chr "cmd" |
|
$ func :function () |
|
command_result: |
|
[1] 100 |
|
|
|
Frame 2 |
|
|
|
Showing frame 2 with the following environment |
|
<environment: 0x7f91a4fe3898> |
|
Variables: |
|
enclos: |
|
<environment: base> |
|
envir: |
|
<environment: 0x7f91a4fec5c0> |
|
expr: |
|
{ |
|
command_result <- 100 |
|
op <- function() { |
|
show.frame <- function(upn) { |
|
if (upn < 0) { |
|
env <- .GlobalEnv |
|
} |
|
else { |
|
env <- parent.frame(n = upn + 1) |
|
} |
|
cat("\nShowing frame", upn, "with the following environment\n") |
|
print(env) |
|
cat("Variables:\n") |
|
vars <- ls(envir = env) |
|
for (vr in vars) { |
|
vrg <- get(vr, envir = env) |
|
if (!is.function(vrg)) { |
|
cat(vr, ":\n", sep = "") |
|
print(vrg) |
|
} |
|
} |
|
} |
|
for (n in c(0, 1, 2)) { |
|
cat("\nFrame", n, "\n") |
|
show.frame(n) |
|
} |
|
command_result |
|
} |
|
cat("\n\nCurrent environment\n") |
|
print(environment()) |
|
cat("\n---- Calling op directly\n") |
|
expect_equal(op(), command_result) |
|
cat("\n---- Calling op with do.call\n") |
|
expect_equal(do_call_test(op), command_result) |
|
cat("\n---- Calling op with do.call inside proto\n") |
|
cmd <- register("cmd", op) |
|
expect_equal(cmd$perform(), command_result) |
|
} |
|
1 |
|
Command : .. |
|
Cleaning up from previous runs : . |
|
Registering commands : |
|
Default namespace : ...... |
|
Multiple registrations : .. |
|
Custom namespace : .... |
|
Creating a pipeline : ...... |
|
|
|
|
|
1. Error: cmd execution ------------------------------------------------------------------------------------ |
|
object 'command_result' not found |
|
1: expect_equal(cmd$perform(), command_result) |
|
2: expect_that(object, equals(expected, label = expected.label, ...), info = info, label = label) |
|
3: condition(object) |
|
4: all.equal(expected, actual, ...) |
|
5: all.equal.numeric(expected, actual, ...) |
|
6: attr.all.equal(target, current, tolerance = tolerance, scale = scale, ...) |
|
7: mode(current) |
|
8: cmd$perform() |
|
9: get(x, envir = this, inherits = inh)(this, ...) |
|
10: do.call(func, list(), envir = environment(operation)) |
|
11: function () |
|
{ |
|
show.frame <- function(upn) { |
|
if (upn < 0) { |
|
env <- .GlobalEnv |
|
} |
|
else { |
|
env <- parent.frame(n = upn + 1) |
|
} |
|
cat("\nShowing frame", upn, "with the following environment\n") |
|
print(env) |
|
cat("Variables:\n") |
|
vars <- ls(envir = env) |
|
for (vr in vars) { |
|
vrg <- get(vr, envir = env) |
|
if (!is.function(vrg)) { |
|
cat(vr, ":\n", sep = "") |
|
print(vrg) |
|
} |
|
} |
|
} |
|
for (n in c(0, 1, 2)) { |
|
cat("\nFrame", n, "\n") |
|
show.frame(n) |
|
} |
|
command_result |
|
}() |
|
> |