diff --git a/src/test/libslic3r/test_printgcode.cpp b/src/test/libslic3r/test_printgcode.cpp index 67577875b..299cbc792 100644 --- a/src/test/libslic3r/test_printgcode.cpp +++ b/src/test/libslic3r/test_printgcode.cpp @@ -207,8 +207,6 @@ SCENARIO( "PrintGCode basic functionality") { REQUIRE(exported.find("M107") != std::string::npos); } } - - WHEN("end_gcode exists with layer_num and layer_z") { config->set("end_gcode", "; Layer_num [layer_num]\n; Layer_z [layer_z]"); config->set("layer_height", 0.1); @@ -224,6 +222,21 @@ SCENARIO( "PrintGCode basic functionality") { REQUIRE(exported.find("; Layer_z 20") != std::string::npos); } } + WHEN("current_extruder exists in start_gcode") { + config->set("start_gcode", "; Extruder [current_extruder]"); + Slic3r::Model model; + auto print {Slic3r::Test::init_print({TestMesh::cube_20x20x20}, model, config)}; + Slic3r::Test::gcode(gcode, print); + auto exported {gcode.str()}; + THEN("current_extruder is processed in the start gcode and set for first extruder") { + REQUIRE(exported.find("; Extruder 0") != std::string::npos); + } + Slic3r::Test::gcode(gcode, print); + auto exported {gcode.str()}; + THEN("current_extruder is processed in the start gcode and set for second extruder") { + REQUIRE(exported.find("; Extruder 1") != std::string::npos); + } + } gcode.clear(); }