mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 07:41:09 -06:00
Expose static PrintConfig objects to Perl and test apply()
This commit is contained in:
parent
56d4da2ac7
commit
e0c0a42a8b
5 changed files with 35 additions and 6 deletions
|
@ -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__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue