Finished porting Config and option definition to XS

This commit is contained in:
Alessandro Ranellucci 2013-12-22 00:39:03 +01:00
parent 9836e963a5
commit 4515d90052
8 changed files with 1301 additions and 1204 deletions

View file

@ -4,7 +4,7 @@ use strict;
use warnings;
use Slic3r::XS;
use Test::More tests => 70;
use Test::More tests => 76;
foreach my $config (Slic3r::Config->new, Slic3r::Config::Print->new) {
$config->set('layer_height', 0.3);
@ -74,6 +74,12 @@ foreach my $config (Slic3r::Config->new, Slic3r::Config::Print->new) {
$config->set_deserialize('wipe', '0,1,1');
is_deeply $config->get('wipe'), [0,1,1], 'deserialize bools';
$config->set('post_process', ['foo','bar']);
is_deeply $config->get('post_process'), ['foo','bar'], 'set/get strings';
is $config->serialize('post_process'), 'foo;bar', 'serialize strings';
$config->set_deserialize('post_process', 'bar;baz');
is_deeply $config->get('post_process'), ['bar','baz'], 'deserialize strings';
is_deeply [ sort @{$config->get_keys} ], [ sort keys %{$config->as_hash} ], 'get_keys and as_hash';
}