mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-01 13:52:01 +08:00

The new travel has an initial flat part, sloped part and once the travel height reaches maxima a flat part again. Also, the notion of extruder lift is removed. It is used no more. Consequently the retract_lift parameter lost its original meaning.
35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
#include <catch2/catch.hpp>
|
|
|
|
#include <memory>
|
|
|
|
#include "libslic3r/GCode/GCodeWriter.hpp"
|
|
|
|
using namespace Slic3r;
|
|
|
|
SCENARIO("set_speed emits values with fixed-point output.", "[GCodeWriter]") {
|
|
|
|
GIVEN("GCodeWriter instance") {
|
|
GCodeWriter writer;
|
|
WHEN("set_speed is called to set speed to 99999.123") {
|
|
THEN("Output string is G1 F99999.123") {
|
|
REQUIRE_THAT(writer.set_speed(99999.123), Catch::Equals("G1 F99999.123\n"));
|
|
}
|
|
}
|
|
WHEN("set_speed is called to set speed to 1") {
|
|
THEN("Output string is G1 F1") {
|
|
REQUIRE_THAT(writer.set_speed(1.0), Catch::Equals("G1 F1\n"));
|
|
}
|
|
}
|
|
WHEN("set_speed is called to set speed to 203.200022") {
|
|
THEN("Output string is G1 F203.2") {
|
|
REQUIRE_THAT(writer.set_speed(203.200022), Catch::Equals("G1 F203.2\n"));
|
|
}
|
|
}
|
|
WHEN("set_speed is called to set speed to 203.200522") {
|
|
THEN("Output string is G1 F203.201") {
|
|
REQUIRE_THAT(writer.set_speed(203.200522), Catch::Equals("G1 F203.201\n"));
|
|
}
|
|
}
|
|
}
|
|
}
|