Skip to content

Commit

Permalink
Add test_gcode.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
lordofhyphens committed Mar 31, 2019
1 parent 8cf8736 commit ac3f4f2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/libslic3r/test_gcode.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <catch.hpp>


#include "GCode/CoolingBuffer.hpp"
#include "GCode.hpp"

SCENARIO("Cooling buffer speed factor rewrite enforces precision") {
GIVEN("GCode line of set speed") {
std::string gcode_string = "G1 F1000000.000";
WHEN("40% speed factor is applied to a speed of 1000000 with 3-digit precision") {
Slic3r::apply_speed_factor(gcode_string, (1.0f/3.0f), 30.0);
REQUIRE_THAT(gcode_string, Catch::Equals("G1 F333333.344"));
}
}
}

0 comments on commit ac3f4f2

Please sign in to comment.