mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-30 08:32:42 +00:00
Expose static PrintConfig objects to Perl and test apply()
This commit is contained in:
@@ -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__
|
||||
|
||||
Reference in New Issue
Block a user