diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2014-06-25 15:37:31 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2014-06-25 15:37:31 +0000 |
commit | c8d851569c1b88d5431700809fe520cbca5023a8 (patch) | |
tree | 77099101cbc57151600ebad72697735043a3177a /t/basics.t | |
download | ExtUtils-Config-tarball-master.tar.gz |
ExtUtils-Config-0.008HEADExtUtils-Config-0.008master
Diffstat (limited to 't/basics.t')
-rw-r--r-- | t/basics.t | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/t/basics.t b/t/basics.t new file mode 100644 index 0000000..67dbaf3 --- /dev/null +++ b/t/basics.t @@ -0,0 +1,32 @@ +#!/usr/bin/perl -w + +use strict; +use warnings FATAL => 'all'; +use Test::More 0.88; + +use Config; + +use ExtUtils::Config; + +my $config = ExtUtils::Config->new; + +ok($config->exists('path_sep'), "'path_sep' is set"); +is($config->get('path_sep'), $Config{path_sep}, "'path_sep' is the same for \$Config"); + +ok(!$config->exists('nonexistent'), "'nonexistent' is still nonexistent"); + +ok(!defined $config->get('nonexistent'), "'nonexistent' is not defined"); + +is_deeply($config->all_config, \%Config, 'all_config is \%Config'); + +my $config2 = ExtUtils::Config->new({ more => 'nomore' }); +my %myconfig = (%Config, more => 'nomore'); + +is_deeply($config2->values_set, { more => 'nomore' }, 'values_set is { more => \'nomore\'}'); +is_deeply($config2->all_config, \%myconfig, 'allconfig is myconfig'); + +my $set = $config->values_set; +$set->{more} = 'more3'; +is($config->get('more'), $Config{more}, "more is still '$Config{more}'"); + +done_testing; |