20_print.t 953 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use Slic3r::XS;
  5. use Test::More tests => 6;
  6. {
  7. {
  8. my $print = Slic3r::Print->new;
  9. isa_ok $print, 'Slic3r::Print';
  10. isa_ok $print->config, 'Slic3r::Config::Static::Ref';
  11. isa_ok $print->default_object_config, 'Slic3r::Config::Static::Ref';
  12. isa_ok $print->default_region_config, 'Slic3r::Config::Static::Ref';
  13. isa_ok $print->placeholder_parser, 'Slic3r::GCode::PlaceholderParser::Ref';
  14. }
  15. {
  16. my $print = Slic3r::Print->new;
  17. my $config = Slic3r::Config->new;
  18. $config->set('skirts', 0);
  19. $print->apply_config($config);
  20. $config->set('skirts', 1);
  21. $print->set_step_started(Slic3r::Print::State::STEP_SKIRT);
  22. $print->set_step_done(Slic3r::Print::State::STEP_SKIRT);
  23. my $invalid = $print->apply_config($config);
  24. ok $invalid, 'applying skirt config invalidates skirt step';
  25. }
  26. }
  27. __END__