diff _test/temp.pl @ 422:b0481c071bea ref20150831

IMPL::Config::Container tests, YAMLConfiguration now works and tested
author cin
date Sun, 20 Aug 2017 00:20:41 +0300
parents bbc4739c4d48
children 60c2892a577c
line wrap: on
line diff
--- a/_test/temp.pl	Sun Jul 16 22:59:39 2017 +0300
+++ b/_test/temp.pl	Sun Aug 20 00:20:41 2017 +0300
@@ -4,30 +4,34 @@
 use Time::HiRes qw(gettimeofday tv_interval);
 use Scalar::Util qw(blessed refaddr);
 use YAML::XS qw(Dump Load);
-
+use Data::Dumper;
+use URI;
 
 
 use IMPL::require {
 	Container => 'IMPL::Config::Container',
 	Service => 'IMPL::Config::ServiceDescriptor',
 	Reference => 'IMPL::Config::ReferenceDescriptor',
-	Value => 'IMPL::Config::ValueDescriptor'
+	Value => 'IMPL::Config::ValueDescriptor',
+	YAMLConfig => 'IMPL::Config::YAMLConfig'
 };
 
-my $data;
-{
-	open my $h, "<", "sample.yaml" or die;
-	print "H: ", *{$h}{IO}, "\n";
-	binmode $h;
-	local $/;
-	$data = <$h>;
-}
 
 my $t = [gettimeofday];
+my $config = YAMLConfig->new(load => 'sample.yaml');
+print "Loaded: ",tv_interval($t,[gettimeofday]),"\n";
 
-print Dump Load($data);
+my $container = Container->new()->AutoPtr;
+$config->ConfigureContainer($container);
 
-print "Activated: ",tv_interval($t,[gettimeofday]),"\n";
 
 
+print "Configured: ",tv_interval($t,[gettimeofday]),"\n";
+#print Data::Dumper->Dump([$container]);
+#$container->Dispose();
+
+my $base = URI->new('some/path');
+my $rel = URI->new('../other/path')->abs($base)->rel('/');
+print $rel,"\n";
+
 1;