Expose static PrintConfig objects to Perl and test apply()

This commit is contained in:
Alessandro Ranellucci 2013-12-21 16:32:11 +01:00
parent 56d4da2ac7
commit e0c0a42a8b
5 changed files with 35 additions and 6 deletions

View file

@ -4,11 +4,9 @@ use strict;
use warnings;
use Slic3r::XS;
use Test::More tests => 33;
use Test::More tests => 67;
{
my $config = Slic3r::Config->new;
foreach my $config (Slic3r::Config->new, Slic3r::Config::Print->new) {
$config->set('layer_height', 0.3);
ok abs($config->get('layer_height') - 0.3) < 1e-4, 'set/get float';
is $config->serialize('layer_height'), '0.3', 'serialize float';
@ -77,4 +75,13 @@ use Test::More tests => 33;
is_deeply $config->get('wipe'), [0,1,1], 'deserialize bools';
}
{
my $config = Slic3r::Config->new;
$config->set('perimeters', 2);
my $config2 = Slic3r::Config::Print->new;
$config2->apply_dynamic($config);
is $config2->get('perimeters'), 2, 'apply (dynamic -> static)';
}
__END__