@@ -9,7 +9,7 @@ test_that("PipeOp - General functions", {
99 expect_false(po_1 $ is_trained )
1010 expect_class(po_1 $ param_set , " ParamSet" )
1111 expect_list(po_1 $ param_set $ values , names = " unique" )
12- expect_output (print(po_1 ), " PipeOp: " )
12+ expect_message (print(po_1 ), " PipeOp" )
1313 expect_equal(po_1 $ packages , " mlr3pipelines" )
1414 expect_null(po_1 $ state )
1515 assert_subset(po_1 $ tags , mlr_reflections $ pipeops $ valid_tags )
@@ -29,22 +29,29 @@ test_that("PipeOp - simple tests with PipeOpScale", {
2929})
3030
3131test_that(" PipeOp printer" , {
32- expect_output(print(PipeOpNOP $ new()),
33- " PipeOp.*<nop>.*not trained.*values.*list().*Input channels.*input \\ [\\ *,\\ *\\ ]\n .*Output channels.*output \\ [\\ *,\\ *\\ ]$" )
34-
35-
36- expect_output(print(PipeOpDebugMulti $ new(3 , 4 )),
37- " PipeOp.*<debug.multi>.*not trained.*values.*list().*Input channels.*input_1 \\ [\\ *,\\ *\\ ], input_2 \\ [\\ *,\\ *\\ ], input_3 \\ [\\ *,\\ *\\ ]\n .*Output channels.*output_1 \\ [\\ *,\\ *\\ ], output_2 \\ [\\ *,\\ *\\ ], output_3 \\ [\\ *,\\ *\\ ], output_4 \\ [\\ *,\\ *\\ ]$" )
38-
39-
40- expect_output(print(PipeOpDebugMulti $ new(100 , 0 )),
41- " \\ [\\ .\\ .\\ . \\ ([0-9]+ lines omitted\\ )\\ ]" )
42-
43- expect_output(print(PipeOpBranch $ new(c(" odin" , " dva" , " tri" ))),
44- " Output channels.*odin \\ [\\ *,\\ *\\ ], dva \\ [\\ *,\\ *\\ ], tri \\ [\\ *,\\ *\\ ]$" )
45-
46- expect_output(print(PipeOpLearner $ new(mlr_learners $ get(" classif.debug" ))),
47- " PipeOp.*<classif.debug>.*Input channels.*input \\ [TaskClassif,TaskClassif\\ ]\n Output channels.*output \\ [NULL,PredictionClassif\\ ]$" )
32+ expect_snapshot(print(PipeOpNOP $ new()))
33+ expect_snapshot(print(PipeOpDebugMulti $ new(3 , 4 )))
34+ expect_snapshot(print(PipeOpDebugMulti $ new(100 , 0 )))
35+ expect_snapshot(print(PipeOpBranch $ new(c(" odin" , " dva" , " tri" ))))
36+ expect_snapshot(print(PipeOpLearner $ new(mlr_learners $ get(" classif.debug" ))))
37+
38+
39+ # expect_output(print(PipeOpNOP$new()),
40+ # "PipeOp.*<nop>.*not trained.*values.*list().*Input channels.*input \\[\\*,\\*\\]\n.*Output channels.*output \\[\\*,\\*\\]$")
41+ #
42+ #
43+ # expect_output(print(PipeOpDebugMulti$new(3, 4)),
44+ # "PipeOp.*<debug.multi>.*not trained.*values.*list().*Input channels.*input_1 \\[\\*,\\*\\], input_2 \\[\\*,\\*\\], input_3 \\[\\*,\\*\\]\n.*Output channels.*output_1 \\[\\*,\\*\\], output_2 \\[\\*,\\*\\], output_3 \\[\\*,\\*\\], output_4 \\[\\*,\\*\\]$")
45+ #
46+ #
47+ # expect_output(print(PipeOpDebugMulti$new(100, 0)),
48+ # "\\[\\.\\.\\. \\([0-9]+ lines omitted\\)\\]")
49+ #
50+ # expect_output(print(PipeOpBranch$new(c("odin", "dva", "tri"))),
51+ # "Output channels.*odin \\[\\*,\\*\\], dva \\[\\*,\\*\\], tri \\[\\*,\\*\\]$")
52+ #
53+ # expect_output(print(PipeOpLearner$new(mlr_learners$get("classif.debug"))),
54+ # "PipeOp.*<classif.debug>.*Input channels.*input \\[TaskClassif,TaskClassif\\]\nOutput channels.*output \\[NULL,PredictionClassif\\]$")
4855})
4956
5057test_that(" Prevent creation of PipeOps with no channels" , {
0 commit comments