Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorenricoturri1966 <enricoturri@seznam.cz>2022-01-29 11:17:30 +0300
committerenricoturri1966 <enricoturri@seznam.cz>2022-01-29 11:17:30 +0300
commit8d94841fa366454b88e27274d7f59e40c13b966d (patch)
tree732ceb1e2c567306fad557872248fa961b0750db /tests
parentaea68c75f39ecf065aa9f20c8b636d0108c2a106 (diff)
parentddb14fa7f965591630a65461fc91d6136628329e (diff)
Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into dev
Diffstat (limited to 'tests')
-rw-r--r--tests/fff_print/test_gcodefindreplace.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/tests/fff_print/test_gcodefindreplace.cpp b/tests/fff_print/test_gcodefindreplace.cpp
index e8a69bee2..1d714d1c3 100644
--- a/tests/fff_print/test_gcodefindreplace.cpp
+++ b/tests/fff_print/test_gcodefindreplace.cpp
@@ -15,7 +15,7 @@ SCENARIO("Find/Replace with plain text", "[GCodeFindReplace]") {
"G1 X13 Y32 Z1; infill\n"
"G1 X13 Y32 Z1; wipe\n";
WHEN("Replace \"move up\" with \"move down\", case sensitive") {
- GCodeFindReplace find_replace({ "move up", "move down", "" });
+ GCodeFindReplace find_replace({ "move up", "move down", "", "" });
REQUIRE(find_replace.process_layer(gcode) ==
"G1 Z0; home\n"
// substituted
@@ -25,7 +25,7 @@ SCENARIO("Find/Replace with plain text", "[GCodeFindReplace]") {
"G1 X13 Y32 Z1; wipe\n");
}
WHEN("Replace \"move up\" with \"move down\", case insensitive") {
- GCodeFindReplace find_replace({ "move up", "move down", "i" });
+ GCodeFindReplace find_replace({ "move up", "move down", "i", "" });
REQUIRE(find_replace.process_layer(gcode) ==
"G1 Z0; home\n"
// substituted
@@ -35,7 +35,7 @@ SCENARIO("Find/Replace with plain text", "[GCodeFindReplace]") {
"G1 X13 Y32 Z1; wipe\n");
}
WHEN("Replace \"move UP\" with \"move down\", case insensitive") {
- GCodeFindReplace find_replace({ "move UP", "move down", "i" });
+ GCodeFindReplace find_replace({ "move UP", "move down", "i", "" });
REQUIRE(find_replace.process_layer(gcode) ==
"G1 Z0; home\n"
// substituted
@@ -45,13 +45,13 @@ SCENARIO("Find/Replace with plain text", "[GCodeFindReplace]") {
"G1 X13 Y32 Z1; wipe\n");
}
WHEN("Replace \"move up\" with \"move down\", case sensitive") {
- GCodeFindReplace find_replace({ "move UP", "move down", "" });
+ GCodeFindReplace find_replace({ "move UP", "move down", "", "" });
REQUIRE(find_replace.process_layer(gcode) == gcode);
}
// Whole word
WHEN("Replace \"move up\" with \"move down\", whole word") {
- GCodeFindReplace find_replace({ "move up", "move down", "w" });
+ GCodeFindReplace find_replace({ "move up", "move down", "w", "" });
REQUIRE(find_replace.process_layer(gcode) ==
"G1 Z0; home\n"
// substituted
@@ -61,17 +61,17 @@ SCENARIO("Find/Replace with plain text", "[GCodeFindReplace]") {
"G1 X13 Y32 Z1; wipe\n");
}
WHEN("Replace \"move u\" with \"move down\", whole word") {
- GCodeFindReplace find_replace({ "move u", "move down", "w" });
+ GCodeFindReplace find_replace({ "move u", "move down", "w", "" });
REQUIRE(find_replace.process_layer(gcode) == gcode);
}
WHEN("Replace \"ove up\" with \"move down\", whole word") {
- GCodeFindReplace find_replace({ "move u", "move down", "w" });
+ GCodeFindReplace find_replace({ "move u", "move down", "w", "" });
REQUIRE(find_replace.process_layer(gcode) == gcode);
}
// Multi-line replace
WHEN("Replace \"move up\\nG1 X0 \" with \"move down\\nG0 X1 \"") {
- GCodeFindReplace find_replace({ "move up\\nG1 X0 ", "move down\\nG0 X1 ", "" });
+ GCodeFindReplace find_replace({ "move up\\nG1 X0 ", "move down\\nG0 X1 ", "", "" });
REQUIRE(find_replace.process_layer(gcode) ==
"G1 Z0; home\n"
// substituted
@@ -82,7 +82,7 @@ SCENARIO("Find/Replace with plain text", "[GCodeFindReplace]") {
}
// Multi-line replace, whole word.
WHEN("Replace \"move up\\nG1 X0\" with \"move down\\nG0 X1\", whole word") {
- GCodeFindReplace find_replace({ "move up\\nG1 X0", "move down\\nG0 X1", "w" });
+ GCodeFindReplace find_replace({ "move up\\nG1 X0", "move down\\nG0 X1", "w", "" });
REQUIRE(find_replace.process_layer(gcode) ==
"G1 Z0; home\n"
// substituted
@@ -93,7 +93,7 @@ SCENARIO("Find/Replace with plain text", "[GCodeFindReplace]") {
}
// Multi-line replace, whole word, fails.
WHEN("Replace \"move up\\nG1 X\" with \"move down\\nG0 X\", whole word") {
- GCodeFindReplace find_replace({ "move up\\nG1 X", "move down\\nG0 X", "w" });
+ GCodeFindReplace find_replace({ "move up\\nG1 X", "move down\\nG0 X", "w", "" });
REQUIRE(find_replace.process_layer(gcode) == gcode);
}
}
@@ -104,7 +104,7 @@ SCENARIO("Find/Replace with plain text", "[GCodeFindReplace]") {
"G1 Z1.21; move up\n"
"G1 X0 Y.33 Z.431 E1.2; perimeter\n";
WHEN("Regular expression NOT processed in non-regex mode") {
- GCodeFindReplace find_replace({ "( [XYZEF]-?)\\.([0-9]+)", "\\10.\\2", "" });
+ GCodeFindReplace find_replace({ "( [XYZEF]-?)\\.([0-9]+)", "\\10.\\2", "", "" });
REQUIRE(find_replace.process_layer(gcode) == gcode);
}
}
@@ -119,7 +119,7 @@ SCENARIO("Find/Replace with regexp", "[GCodeFindReplace]") {
"G1 X13 Y32 Z1; infill\n"
"G1 X13 Y32 Z1; wipe\n";
WHEN("Replace \"move up\" with \"move down\", case sensitive") {
- GCodeFindReplace find_replace({ "move up", "move down", "r" });
+ GCodeFindReplace find_replace({ "move up", "move down", "r", "" });
REQUIRE(find_replace.process_layer(gcode) ==
"G1 Z0; home\n"
// substituted
@@ -129,7 +129,7 @@ SCENARIO("Find/Replace with regexp", "[GCodeFindReplace]") {
"G1 X13 Y32 Z1; wipe\n");
}
WHEN("Replace \"move up\" with \"move down\", case insensitive") {
- GCodeFindReplace find_replace({ "move up", "move down", "ri" });
+ GCodeFindReplace find_replace({ "move up", "move down", "ri", "" });
REQUIRE(find_replace.process_layer(gcode) ==
"G1 Z0; home\n"
// substituted
@@ -139,7 +139,7 @@ SCENARIO("Find/Replace with regexp", "[GCodeFindReplace]") {
"G1 X13 Y32 Z1; wipe\n");
}
WHEN("Replace \"move UP\" with \"move down\", case insensitive") {
- GCodeFindReplace find_replace({ "move UP", "move down", "ri" });
+ GCodeFindReplace find_replace({ "move UP", "move down", "ri", "" });
REQUIRE(find_replace.process_layer(gcode) ==
"G1 Z0; home\n"
// substituted
@@ -149,13 +149,13 @@ SCENARIO("Find/Replace with regexp", "[GCodeFindReplace]") {
"G1 X13 Y32 Z1; wipe\n");
}
WHEN("Replace \"move up\" with \"move down\", case sensitive") {
- GCodeFindReplace find_replace({ "move UP", "move down", "r" });
+ GCodeFindReplace find_replace({ "move UP", "move down", "r", "" });
REQUIRE(find_replace.process_layer(gcode) == gcode);
}
// Whole word
WHEN("Replace \"move up\" with \"move down\", whole word") {
- GCodeFindReplace find_replace({ "move up", "move down", "rw" });
+ GCodeFindReplace find_replace({ "move up", "move down", "rw", "" });
REQUIRE(find_replace.process_layer(gcode) ==
"G1 Z0; home\n"
// substituted
@@ -165,17 +165,17 @@ SCENARIO("Find/Replace with regexp", "[GCodeFindReplace]") {
"G1 X13 Y32 Z1; wipe\n");
}
WHEN("Replace \"move u\" with \"move down\", whole word") {
- GCodeFindReplace find_replace({ "move u", "move down", "rw" });
+ GCodeFindReplace find_replace({ "move u", "move down", "rw", "" });
REQUIRE(find_replace.process_layer(gcode) == gcode);
}
WHEN("Replace \"ove up\" with \"move down\", whole word") {
- GCodeFindReplace find_replace({ "move u", "move down", "rw" });
+ GCodeFindReplace find_replace({ "move u", "move down", "rw", "" });
REQUIRE(find_replace.process_layer(gcode) == gcode);
}
// Multi-line replace
WHEN("Replace \"move up\\nG1 X0 \" with \"move down\\nG0 X1 \"") {
- GCodeFindReplace find_replace({ "move up\\nG1 X0 ", "move down\\nG0 X1 ", "r" });
+ GCodeFindReplace find_replace({ "move up\\nG1 X0 ", "move down\\nG0 X1 ", "r", "" });
REQUIRE(find_replace.process_layer(gcode) ==
"G1 Z0; home\n"
// substituted
@@ -186,7 +186,7 @@ SCENARIO("Find/Replace with regexp", "[GCodeFindReplace]") {
}
// Multi-line replace, whole word.
WHEN("Replace \"move up\\nG1 X0\" with \"move down\\nG0 X1\", whole word") {
- GCodeFindReplace find_replace({ "move up\\nG1 X0", "move down\\nG0 X1", "rw" });
+ GCodeFindReplace find_replace({ "move up\\nG1 X0", "move down\\nG0 X1", "rw", "" });
REQUIRE(find_replace.process_layer(gcode) ==
"G1 Z0; home\n"
// substituted
@@ -197,7 +197,7 @@ SCENARIO("Find/Replace with regexp", "[GCodeFindReplace]") {
}
// Multi-line replace, whole word, fails.
WHEN("Replace \"move up\\nG1 X\" with \"move down\\nG0 X\", whole word") {
- GCodeFindReplace find_replace({ "move up\\nG1 X", "move down\\nG0 X", "rw" });
+ GCodeFindReplace find_replace({ "move up\\nG1 X", "move down\\nG0 X", "rw", "" });
REQUIRE(find_replace.process_layer(gcode) == gcode);
}
}
@@ -208,7 +208,7 @@ SCENARIO("Find/Replace with regexp", "[GCodeFindReplace]") {
"G1 Z1.21; move up\n"
"G1 X0 Y.33 Z.431 E1.2; perimeter\n";
WHEN("Missing zeros before dot filled in") {
- GCodeFindReplace find_replace({ "( [XYZEF]-?)\\.([0-9]+)", "\\10.\\2", "r" });
+ GCodeFindReplace find_replace({ "( [XYZEF]-?)\\.([0-9]+)", "\\10.\\2", "r", "" });
REQUIRE(find_replace.process_layer(gcode) ==
"G1 Z0.123; home\n"
"G1 Z1.21; move up\n"
@@ -237,7 +237,7 @@ SCENARIO("Find/Replace with regexp", "[GCodeFindReplace]") {
";TYPE:External perimeter\n"
"G1 X1 Y.3 Z.431 E0.1\n";
WHEN("Change extrusion rate of top solid infill, single line modifier") {
- GCodeFindReplace find_replace({ "(;TYPE:Top solid infill\\n)(.*?)(;TYPE:[^T][^o][^p][^ ][^s]|$)", "${1}M221 S98\\n${2}M221 S95\\n${3}", "rs" });
+ GCodeFindReplace find_replace({ "(;TYPE:Top solid infill\\n)(.*?)(;TYPE:[^T][^o][^p][^ ][^s]|$)", "${1}M221 S98\\n${2}M221 S95\\n${3}", "rs", "" });
REQUIRE(find_replace.process_layer(gcode) ==
"G1 Z1.21; move up\n"
";TYPE:Infill\n"
@@ -262,7 +262,7 @@ SCENARIO("Find/Replace with regexp", "[GCodeFindReplace]") {
"G1 X1 Y.3 Z.431 E0.1\n");
}
WHEN("Change extrusion rate of top solid infill, no single line modifier (incorrect)") {
- GCodeFindReplace find_replace({ "(;TYPE:Top solid infill\\n)(.*?)(;TYPE:[^T][^o][^p][^ ][^s]|$)", "${1}M221 S98\\n${2}\\nM221 S95${3}", "r" });
+ GCodeFindReplace find_replace({ "(;TYPE:Top solid infill\\n)(.*?)(;TYPE:[^T][^o][^p][^ ][^s]|$)", "${1}M221 S98\\n${2}\\nM221 S95${3}", "r", "" });
REQUIRE(find_replace.process_layer(gcode) ==
"G1 Z1.21; move up\n"
";TYPE:Infill\n"