Permalink
Browse files

Fix regression in Config->setenv affecting post-processing scripts. I…

…ncludes regression test
  • Loading branch information...
1 parent bba69ed commit 634ccb33ab5218dfc38323b62c75bdd57fedff3a @alexrj committed Feb 9, 2014
Showing with 21 additions and 1 deletion.
  1. +1 −1 lib/Slic3r/Config.pm
  2. +20 −0 t/config.t
View
@@ -171,7 +171,7 @@ sub save {
sub setenv {
my $self = shift;
- foreach my $opt_key (sort keys %$Options) {
+ foreach my $opt_key (@{$self->get_keys}) {
$ENV{"SLIC3R_" . uc $opt_key} = $self->serialize($opt_key);
}
}
View
@@ -0,0 +1,20 @@
+use Test::More tests => 1;
+use strict;
+use warnings;
+
+BEGIN {
+ use FindBin;
+ use lib "$FindBin::Bin/../lib";
+}
+
+use Slic3r;
+use Slic3r::Test;
+
+{
+ my $config = Slic3r::Config->new_from_defaults;
+ $config->set('layer_height', 0.123);
+ $config->setenv;
+ is $ENV{SLIC3R_LAYER_HEIGHT}, '0.123', 'setenv';
+}
+
+__END__

0 comments on commit 634ccb3

Please sign in to comment.