From d2a619496029fa38479c53a2d56c07d835d2fde9 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 5 Apr 2014 10:18:00 +0200 Subject: [PATCH] Fix the 'extruder' behavior in CLI and test that Print::Simple accepts an incomplete DynamicConfig object --- slic3r.pl | 5 ++++- t/multi.t | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/slic3r.pl b/slic3r.pl index 284f9169..f9e6f637 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -72,7 +72,10 @@ if ($opt{load}) { # merge configuration my $config = Slic3r::Config->new_from_defaults; -$config->apply($_) for @external_configs, $cli_config; +foreach my $c (@external_configs, $cli_config) { + $c->normalize; # expand shortcuts before applying, otherwise destination values would be already filled with defaults + $config->apply($c); +} # save configuration if ($opt{save}) { diff --git a/t/multi.t b/t/multi.t index c835400c..cc87083d 100644 --- a/t/multi.t +++ b/t/multi.t @@ -1,4 +1,4 @@ -use Test::More tests => 7; +use Test::More tests => 8; use strict; use warnings; @@ -67,7 +67,15 @@ use Slic3r::Test; } { - my $config = Slic3r::Config->new_from_defaults; + my $config = Slic3r::Config->new; + $config->set('extruder', 2); + + my $print = Slic3r::Test::init_print('20mm_cube', config => $config); + like Slic3r::Test::gcode($print), qr/ T1/, 'extruder shortcut'; +} + +{ + my $config = Slic3r::Config->new; $config->set('perimeter_extruder', 2); $config->set('infill_extruder', 2); $config->set('support_material_extruder', 2);