mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-02 12:41:18 -07:00
Add unit test to check that nested config options work
This commit is contained in:
parent
15f07197d8
commit
db754dca4d
1 changed files with 34 additions and 23 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
use Test::More tests => 1;
|
use Test::More tests => 2;
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
|
|
@ -10,9 +10,10 @@ BEGIN {
|
||||||
use Slic3r;
|
use Slic3r;
|
||||||
use Slic3r::Test;
|
use Slic3r::Test;
|
||||||
|
|
||||||
my $config = Slic3r::Config->new_from_defaults;
|
{
|
||||||
|
my $config = Slic3r::Config->new_from_defaults;
|
||||||
|
|
||||||
my $test = sub {
|
my $test = sub {
|
||||||
my ($conf) = @_;
|
my ($conf) = @_;
|
||||||
$conf ||= $config;
|
$conf ||= $config;
|
||||||
|
|
||||||
|
|
@ -33,9 +34,19 @@ my $test = sub {
|
||||||
});
|
});
|
||||||
|
|
||||||
1;
|
1;
|
||||||
};
|
};
|
||||||
|
|
||||||
$config->set('layer_gcode', '_MY_CUSTOM_GCODE_');
|
$config->set('layer_gcode', '_MY_CUSTOM_GCODE_');
|
||||||
ok $test->(), "custom layer G-code is applied after Z move and before other moves";
|
ok $test->(), "custom layer G-code is applied after Z move and before other moves";
|
||||||
|
}
|
||||||
|
|
||||||
|
#==========================================================
|
||||||
|
|
||||||
|
{
|
||||||
|
my $config = Slic3r::Config->new_from_defaults;
|
||||||
|
is $config->replace_options('[temperature_[foo]]', { foo => '0' }),
|
||||||
|
200,
|
||||||
|
"nested config options";
|
||||||
|
}
|
||||||
|
|
||||||
__END__
|
__END__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue