r57 - in packages: . libconfig-auto-perl libconfig-auto-perl/branches libconfig-auto-perl/branches/upstream libconfig-auto-perl/branches/upstream/current libconfig-auto-perl/branches/upstream/current/lib libconfig-auto-perl/branches/upstream/current/lib/Config libconfig-auto-perl/branches/upstream/current/t

Allard Hoeve hoeve-guest@haydn.debian.org
Thu, 10 Jun 2004 07:26:32 -0600


Author: hoeve-guest
Date: 2004-06-10 07:26:28 -0600 (Thu, 10 Jun 2004)
New Revision: 57

Added:
   packages/libconfig-auto-perl/
   packages/libconfig-auto-perl/branches/
   packages/libconfig-auto-perl/branches/upstream/
   packages/libconfig-auto-perl/branches/upstream/current/
   packages/libconfig-auto-perl/branches/upstream/current/Changes
   packages/libconfig-auto-perl/branches/upstream/current/MANIFEST
   packages/libconfig-auto-perl/branches/upstream/current/Makefile.PL
   packages/libconfig-auto-perl/branches/upstream/current/README
   packages/libconfig-auto-perl/branches/upstream/current/lib/
   packages/libconfig-auto-perl/branches/upstream/current/lib/Config/
   packages/libconfig-auto-perl/branches/upstream/current/lib/Config/Auto.pm
   packages/libconfig-auto-perl/branches/upstream/current/t/
   packages/libconfig-auto-perl/branches/upstream/current/t/01_Config-Auto.t
   packages/libconfig-auto-perl/tags/
Log:
[svn-inject] Installing original source of libconfig-auto-perl

Added: packages/libconfig-auto-perl/branches/upstream/current/Changes
===================================================================
--- packages/libconfig-auto-perl/branches/upstream/current/Changes	2004-06-10 13:25:39 UTC (rev 56)
+++ packages/libconfig-auto-perl/branches/upstream/current/Changes	2004-06-10 13:26:28 UTC (rev 57)
@@ -0,0 +1,28 @@
+0.06    Sat Feb 21 13:21:43 2004
+===================================
+    - fix a bug in tr/// on a string
+
+
+0.05    Tue Feb 10 13:16:59 2004
+===================================
+    - Fix so that a config file is magically found when the program
+        is started with a full pathname as well
+
+0.04    Sun Sep  7 19:28:40 2003
+====================================
+    - Jos Boumans took maintainership
+    - XML::Simple is now an optional module
+
+0.03    Sun Aug  4 09:51:42 2002
+====================================
+    - INI files patch by Garrett Rooney
+
+0.02    Thu Jul  4 17:20:13 2002
+====================================
+    - I always screw up the README.
+
+====================================
+0.01  Wed Jul  3 15:00:16 2002
+	- original version; created by h2xs 1.21 with options
+		-AX -n Config::Auto
+

Added: packages/libconfig-auto-perl/branches/upstream/current/MANIFEST
===================================================================
--- packages/libconfig-auto-perl/branches/upstream/current/MANIFEST	2004-06-10 13:25:39 UTC (rev 56)
+++ packages/libconfig-auto-perl/branches/upstream/current/MANIFEST	2004-06-10 13:26:28 UTC (rev 57)
@@ -0,0 +1,6 @@
+Changes
+MANIFEST			This list of files
+Makefile.PL
+README
+lib/Config/Auto.pm
+t/01_Config-Auto.t

Added: packages/libconfig-auto-perl/branches/upstream/current/Makefile.PL
===================================================================
--- packages/libconfig-auto-perl/branches/upstream/current/Makefile.PL	2004-06-10 13:25:39 UTC (rev 56)
+++ packages/libconfig-auto-perl/branches/upstream/current/Makefile.PL	2004-06-10 13:26:28 UTC (rev 57)
@@ -0,0 +1,32 @@
+use ExtUtils::MakeMaker;
+
+use strict;
+use Getopt::Std;
+use Data::Dumper;
+my $opts = {};
+getopts( 'x', $opts );
+
+my $have_xml_simple = eval { require XML::Simple; 1; };
+
+if( !$have_xml_simple and !$opts->{'x'} ) {
+    warn qq[Since the 0.04 release, XML::Simple is an optional prerequisite.\n].
+         qq[If you'd like to install Config::Auto with XML support, please\n] .
+         qq[rerun this Makefile.PL with the '-x' option\n];
+}
+
+my $prereqs = {
+    'XML::Simple'       => 0,
+    'Config::IniFiles'  => 0,
+};
+delete $prereqs->{'XML::Simple'} unless $opts->{'x'};             
+
+WriteMakefile(
+    'NAME'		        => 'Config::Auto',
+    'VERSION_FROM'	    => 'lib/Config/Auto.pm', # finds $VERSION
+    'PREREQ_PM'		    => $prereqs, 
+    ( $] >= 5.005 
+        ? ( ABSTRACT_FROM    => 'lib/Config/Auto.pm', # retrieve abstract from module
+            AUTHOR           => 'Jos I. Boumans <kane@cpan.org>') 
+        : ()
+    ),
+);

Added: packages/libconfig-auto-perl/branches/upstream/current/README
===================================================================
--- packages/libconfig-auto-perl/branches/upstream/current/README	2004-06-10 13:25:39 UTC (rev 56)
+++ packages/libconfig-auto-perl/branches/upstream/current/README	2004-06-10 13:26:28 UTC (rev 57)
@@ -0,0 +1,100 @@
+NAME
+    Config::Auto - Magical config file parser
+
+SYNOPSIS
+      use Config::Auto;
+
+      # Not very magical at all.
+      my $config = Config::Auto::parse("myprogram.conf", format => "colon");
+
+      # Considerably more magical.
+      my $config = Config::Auto::parse("myprogram.conf");
+
+      # Highly magical.
+      my $config = Config::Auto::parse();
+
+DESCRIPTION
+    This module was written after having to write Yet Another Config File
+    Parser for some variety of colon-separated config. I decided "never
+    again".
+
+    When you call "Config::Auto::parse" with no arguments, we first look at
+    $0 to determine the program's name. Let's assume that's "snerk". We look
+    for the following files:
+
+        snerkconfig
+        ~/snerkconfig
+        /etc/snerkconfig
+        snerk.config
+        ~/snerk.config
+        /etc/snerk.config
+        snerkrc
+        ~/snerkrc
+        /etc/snerkrc
+        .snerkrc
+        ~/.snerkrc
+        /etc/.snerkrc
+
+    We take the first one we find, and examine it to determine what format
+    it's in. The algorithm used is a heuristic "which is a fancy way of
+    saying that it doesn't work." (Mark Dominus.) We know about colon
+    separated, space separated, equals separated, XML, Perl code, Windows
+    INI, BIND9 and irssi style config files. If it chooses the wrong one,
+    you can force it with the "format" option.
+
+    If you don't want it ever to detect and execute config files which are
+    made up of Perl code, set "$Config::Auto::DisablePerl = 1".
+
+    Then the file is parsed and a data structure is returned. Since we're
+    working magic, we have to do the best we can under the circumstances -
+    "You rush a miracle man, you get rotten miracles." (Miracle Max) So
+    there are no guarantees about the structure that's returned. If you have
+    a fairly regular config file format, you'll get a regular data structure
+    back. If your config file is confusing, so will the return structure be.
+    Isn't life tragic?
+
+    Here's what we make of some common Unix config files:
+
+    /etc/resolv.conf:
+
+        $VAR1 = {
+              'nameserver' => [ '163.1.2.1', '129.67.1.1', '129.67.1.180' ],
+              'search' => [ 'oucs.ox.ac.uk', 'ox.ac.uk' ]
+            };
+
+    /etc/passwd:
+
+        $VAR1 = {
+              'root' => [ 'x', '0', '0', 'root', '/root', '/bin/bash' ],
+              ...
+            };
+
+    /etc/gpm.conf:
+
+        $VAR1 = {
+              'append' => '""',
+              'responsiveness' => '',
+              'device' => '/dev/psaux',
+              'type' => 'ps2',
+              'repeat_type' => 'ms3'
+            };
+
+    /etc/nsswitch.conf:
+
+        $VAR1 = {
+              'netgroup' => 'nis',
+              'passwd' => 'compat',
+              'hosts' => [ 'files', 'dns' ],
+              ...
+        };
+
+TODO
+    BIND9 and irssi file format parsers currently don't exist. It would be
+    good to add support for "mutt" and "vim" style "set"-based RCs.
+
+AUTHOR
+    Simon Cozens, "simon@cpan.org"
+
+LICENSE
+    AL&GPL.
+

Added: packages/libconfig-auto-perl/branches/upstream/current/lib/Config/Auto.pm
===================================================================
--- packages/libconfig-auto-perl/branches/upstream/current/lib/Config/Auto.pm	2004-06-10 13:25:39 UTC (rev 56)
+++ packages/libconfig-auto-perl/branches/upstream/current/lib/Config/Auto.pm	2004-06-10 13:26:28 UTC (rev 57)
@@ -0,0 +1,378 @@
+package Config::Auto;
+
+use strict;
+use warnings;
+use File::Spec::Functions;
+use File::Basename;
+#use XML::Simple;   # this is now optional
+use Config::IniFiles;
+use Carp;
+
+use vars qw[$VERSION $DisablePerl];
+
+$VERSION = '0.06';
+$DisablePerl = 0;
+
+my %methods = (
+    perl   => \&eval_perl,
+    colon  => \&colon_sep,
+    space  => \&space_sep,
+    equal  => \&equal_sep,
+    bind   => \&bind_style,
+    irssi  => \&irssi_style,
+    xml    => \&parse_xml,
+    ini    => \&parse_ini,
+    list   => \&return_list,
+);
+
+delete $methods{'xml'} 
+    unless eval { require XML::Simple; XML::Simple->import; 1 };
+
+sub parse {
+    my $file = shift;
+    my %args = @_;
+    
+    $file = find_file()                     if not defined $file;
+    croak "No config filename given!"       if not defined $file;
+    croak "Config file $file not readable!" if not -e $file; 
+
+    return if -B $file;
+
+    my $method;
+    my @data;
+
+    if (!defined $args{format}) {
+        # OK, let's take a look at you.
+        my @data;
+        open CONFIG, $file or croak "$file: $!";
+        if (-s $file > 1024*100) {
+            # Just read in a bit.
+            while (<CONFIG>) {
+                push @data, $_;
+                last if $. >= 50;
+            }
+        } else {
+            @data = <CONFIG>;
+        }
+        my %scores = score(\@data);
+        delete $scores{perl} if exists $scores{perl} and $DisablePerl;
+        croak "Unparsable file format!" if !keys %scores;
+        # Clear winner?
+        my @methods = sort { $scores{$b} <=> $scores{$a} } keys %scores;
+        if (@methods > 1) {
+            croak "File format unclear! ".join ",", map { "$_ => $scores{$_}"} @methods
+               if $scores{$methods[0]} == $scores{$methods[1]};
+        }
+        $method = $methods[0];
+    } else {
+        croak "Unknown format $args{format}: use one of @{[ keys %methods ]}"
+            if not exists $methods{$args{format}};
+        $method = $args{format};
+    }
+    return $methods{$method}->($file);
+}
+
+sub score {
+    my $data_r = shift;
+    return (xml => 100)     if $data_r->[0] =~ /^\s*<\?xml/;
+    return (perl => 100)    if $data_r->[0] =~ /^#!.*perl/;
+    my %score;
+    
+    for (@$data_r) {
+        # Easy to comment out foo=bar syntax
+        $score{equal}++                 if /^\s*#\s*\w+\s*=/;
+        next if /^\s*#/;
+        
+        $score{xml}++                   for /(<\w+.*?>)/g;
+        $score{xml}+= 2                 for m|(</\w+.*?>)|g;
+        $score{xml}+= 5                 for m|(/>)|g;
+        next unless /\S/;
+        
+        $score{equal}++, $score{ini}++  if m|^.*=.*$|;
+        $score{equal}++, $score{ini}++  if m|^\S+\s+=\s+|;
+        $score{colon}++                 if /^[^:]+:[^:=]+/;
+        $score{colon}+=2                if /^\s*\w+\s*:[^:]+$/;
+        $score{colonequal}+= 3          if /^\s*\w+\s*:=[^:]+$/; # Debian foo.
+        $score{perl}+= 10               if /^\s*\$\w+(\{.*?\})*\s*=.*/;
+        $score{space}++                 if m|^[^\s:]+\s+\S+$|;
+        
+        # mtab, fstab, etc.
+        $score{space}++                 if m|^(\S+)\s+(\S+\s*)+|;
+        $score{bind}+= 5                if /\s*\S+\s*{$/;
+        $score{list}++                  if /^[\w\/\-\+]+$/;
+        $score{bind}+= 5                if /^\s*}\s*$/  and exists $score{bind};
+        $score{irssi}+= 5               if /^\s*};\s*$/ and exists $score{irssi};
+        $score{irssi}+= 10              if /(\s*|^)\w+\s*=\s*{/;
+        $score{perl}++                  if /\b([@%\$]\w+)/g;
+        $score{perl}+= 2                if /;\s*$/;
+        $score{perl}+=10                if /(if|for|while|until|unless)\s*\(/;
+        $score{perl}++                  for /([\{\}])/g;
+        $score{equal}++, $score{ini}++  if m|^\s*\w+\s*=.*$|;
+        $score{ini} += 10               if /^\s*\[[\s\w]+\]\s*$/;
+    }
+
+    # Choose between Win INI format and foo = bar
+    if (exists $score{ini}) {
+        $score{ini} > $score{equal}
+            ? delete $score{equal}
+            : delete $score{ini};
+    }
+
+    # Some general sanity checks
+    if (exists $score{perl}) {
+        $score{perl} /= 2   unless ("@$data_r" =~ /;/) > 3 or $#$data_r < 3;
+        delete $score{perl} unless ("@$data_r" =~ /;/);
+        delete $score{perl} unless ("@$data_r" =~ /([\$\@\%]\w+)/);
+    }
+
+    return %score;
+}
+
+sub find_file {
+    my $x;
+    my $whoami = basename($0);
+    my $bindir = dirname($0);
+    $whoami =~ s/\.pl$//;
+    for ("${whoami}config", "${whoami}.config", "${whoami}rc", ".${whoami}rc") {
+        return $_           if -e $_;
+        return $x           if -e ($x=catfile($bindir,$_));
+        return $x           if -e ($x=catfile($ENV{HOME},$_));
+        return "/etc/$_"    if -e "/etc/$_";
+    }
+    return undef;
+}
+
+sub eval_perl   { do $_[0]; }
+sub parse_xml   { return XMLin(shift); }
+sub parse_ini   { tie my %ini, 'Config::IniFiles', (-file=>$_[0]); return \%ini; }
+sub return_list { open my $fh, shift or die $!; return [<$fh>]; }
+
+sub bind_style  { croak "BIND8-style config not supported in this release" }
+sub irssi_style { croak "irssi-style config not supported in this release" }
+
+# BUG: These functions are too similar. How can they be unified?
+
+sub colon_sep {
+
+    my $file = shift;
+    open IN, $file or die $!;
+    my %config;
+    while (<IN>) {
+        next if /^\s*#/;   
+        /^\s*(.*?)\s*:\s*(.*)/ or next;
+        my ($k, $v) = ($1, $2);
+        my @v;
+        if ($v =~ /:/) {
+            @v =  split /:/, $v;
+        } elsif ($v =~ /, /) { 
+            @v = split /\s*,\s*/, $v;
+        } elsif ($v =~ / /) {
+            @v = split /\s+/, $v;
+        } elsif ($v =~ /,/) { # Order is important
+            @v = split /\s*,\s*/, $v;
+        } else {
+            @v = $v;
+        }
+        check_hash_and_assign(\%config, $k, @v);
+    }
+    return \%config;
+}
+
+sub check_hash_and_assign {
+    my ($c, $k, @v) = @_;
+    if (exists $c->{$k} and !ref $c->{$k}) {
+        $c->{$k} = [$c->{$k}];
+    }
+    
+    if (grep /=/, @v) { # Bugger, it's really a hash
+        for (@v) {
+            my ($subkey, $subvalue);
+            if (/(.*)=(.*)/) { ($subkey, $subvalue) = ($1,$2); }
+            else { $subkey = $1; $subvalue = 1; }
+
+            if (exists $c->{$k} and ref $c->{$k} ne "HASH") { 
+                # Can we find a hash in here?
+                my $h=undef;
+                for (@{$c->{$k}}) {
+                    last if ref ($h = $_) eq "hash";
+                }
+                if ($h) { $h->{$subkey} = $subvalue; }
+                else { push @{$c->{$k}}, { $subkey => $subvalue } }
+            } else {
+                $c->{$k}{$subkey} = $subvalue; 
+            } 
+        }
+    } elsif (@v == 1) {
+        if (exists $c->{$k}) { 
+            if (ref $c->{$k} eq "HASH") { $c->{$k}{$v[0]} = 1; }
+            else {push @{$c->{$k}}, @v}
+        } else { $c->{$k} = $v[0]; }
+    } else {
+        if (exists $c->{$k}) { 
+            if (ref $c->{$k} eq "HASH") { $c->{$k}{$_} = 1 for @v }
+            else {push @{$c->{$k}}, @v }
+        }
+        else { $c->{$k} = [@v]; }
+    }
+}
+
+
+sub equal_sep {
+    my $file = shift;
+    open IN, $file or die $!;
+    my %config;
+    while (<IN>) {
+        next if /^\s*#/;
+        /^\s*(.*?)\s*=\s*(.*)\s*$/ or next; 
+        my ($k, $v) = ($1, $2);
+        my @v;
+        if ($v=~ /,/) {
+            $config{$k} = [ split /\s*,\s*/, $v ];
+        } elsif ($v =~ / /) { # XXX: Foo = "Bar baz"
+            $config{$k} = [ split /\s+/, $v ];
+        } else {
+            $config{$k} = $v;
+        }
+    }
+    
+    return \%config;
+}
+
+sub space_sep {
+    my $file = shift;
+    open IN, $file or die $!;
+    my %config;
+    while (<IN>) {
+        next if /^\s*#/;
+        /\s*(\S+)\s+(.*)/ or next; 
+        my ($k, $v) = ($1, $2);
+        my @v;
+        if ($v=~ /,/) {
+            @v = split /\s*,\s*/, $v;
+        } elsif ($v =~ / /) { # XXX: Foo = "Bar baz"
+            @v = split /\s+/, $v;
+        } else {
+            @v = $v;
+        }
+        check_hash_and_assign(\%config, $k, @v);
+    }
+    return \%config;
+
+}
+
+1;
+__END__
+# Below is stub documentation for your module. You better edit it!
+
+=head1 NAME
+
+Config::Auto - Magical config file parser
+
+=head1 SYNOPSIS
+
+  use Config::Auto;
+
+  # Not very magical at all.
+  my $config = Config::Auto::parse("myprogram.conf", format => "colon");
+
+  # Considerably more magical.
+  my $config = Config::Auto::parse("myprogram.conf");
+
+  # Highly magical.
+  my $config = Config::Auto::parse();
+
+=head1 DESCRIPTION
+
+This module was written after having to write Yet Another Config File Parser
+for some variety of colon-separated config. I decided "never again". 
+
+When you call C<Config::Auto::parse> with no arguments, we first look at
+C<$0> to determine the program's name. Let's assume that's C<snerk>. We
+look for the following files:
+
+    snerkconfig
+    ~/snerkconfig
+    /etc/snerkconfig
+    snerk.config
+    ~/snerk.config
+    /etc/snerk.config
+    snerkrc
+    ~/snerkrc
+    /etc/snerkrc
+    .snerkrc
+    ~/.snerkrc
+    /etc/.snerkrc
+
+We take the first one we find, and examine it to determine what format
+it's in. The algorithm used is a heuristic "which is a fancy way of
+saying that it doesn't work." (Mark Dominus.) We know about colon
+separated, space separated, equals separated, XML, Perl code, Windows
+INI, BIND9 and irssi style config files. If it chooses the wrong one,
+you can force it with the C<format> option.
+
+If you don't want it ever to detect and execute config files which are made
+up of Perl code, set C<$Config::Auto::DisablePerl = 1>.
+
+Then the file is parsed and a data structure is returned. Since we're
+working magic, we have to do the best we can under the circumstances -
+"You rush a miracle man, you get rotten miracles." (Miracle Max) So
+there are no guarantees about the structure that's returned. If you have
+a fairly regular config file format, you'll get a regular data
+structure back. If your config file is confusing, so will the return
+structure be. Isn't life tragic?
+
+Here's what we make of some common Unix config files:
+
+F</etc/resolv.conf>:
+
+    $VAR1 = {
+          'nameserver' => [ '163.1.2.1', '129.67.1.1', '129.67.1.180' ],
+          'search' => [ 'oucs.ox.ac.uk', 'ox.ac.uk' ]
+        };
+
+F</etc/passwd>:
+
+    $VAR1 = {
+          'root' => [ 'x', '0', '0', 'root', '/root', '/bin/bash' ],
+          ...
+        };
+
+F</etc/gpm.conf>:
+
+    $VAR1 = {
+          'append' => '""',
+          'responsiveness' => '',
+          'device' => '/dev/psaux',
+          'type' => 'ps2',
+          'repeat_type' => 'ms3'
+        };
+
+F</etc/nsswitch.conf>:
+
+    $VAR1 = {
+          'netgroup' => 'nis',
+          'passwd' => 'compat',
+          'hosts' => [ 'files', 'dns' ],
+          ...
+    };
+
+=head1 TODO
+
+BIND9 and irssi file format parsers currently don't exist. It would be
+good to add support for C<mutt> and C<vim> style C<set>-based RCs.
+
+=head1 AUTHOR
+
+This module by Jos Boumans, C<kane@cpan.org>.
+
+=head1 LICENSE
+
+This module is
+copyright (c) 2003 Jos Boumans E<lt>kane@cpan.orgE<gt>.
+All rights reserved.
+
+This library is free software;
+you may redistribute and/or modify it under the same
+terms as Perl itself.
+
+=cut

Added: packages/libconfig-auto-perl/branches/upstream/current/t/01_Config-Auto.t
===================================================================
--- packages/libconfig-auto-perl/branches/upstream/current/t/01_Config-Auto.t	2004-06-10 13:25:39 UTC (rev 56)
+++ packages/libconfig-auto-perl/branches/upstream/current/t/01_Config-Auto.t	2004-06-10 13:26:28 UTC (rev 57)
@@ -0,0 +1,100 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+#########################
+
+# change 'tests => 1' to 'tests => last_test_to_print';
+
+use Test;
+BEGIN { plan tests => 18 };
+use Config::Auto;
+ok(1); # If we made it this far, we're ok.
+
+#########################
+
+# Insert your test code below, the Test module is use()ed here so read
+# its man page ( perldoc Test ) for help writing this test script.
+
+sub t {
+    open OUT, ">test.config" or die $!;
+    print OUT @_;
+    close OUT;
+    my $c = Config::Auto::parse("test.config");
+    unlink "test.config";
+    return $c;
+}
+
+my $c;
+$c = t(<<EOF);
+search oucs.ox.ac.uk ox.ac.uk
+nameserver 163.1.2.1
+nameserver 129.67.1.1
+nameserver 129.67.1.180
+EOF
+
+ok(ref ($c->{nameserver}) eq "ARRAY");
+ok($c->{nameserver}[0] eq "163.1.2.1");
+ok(ref ($c->{search}) eq "ARRAY");
+
+$c = t(<<EOF);
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+EOF
+
+ok(ref($c->{root}) eq "ARRAY");
+ok($c->{root}[0] eq "x");
+
+$c = t(<<EOF);
+# This file was generated by debconf automaticaly.
+# Please use dpkg-reconfigure to edit.
+# And you can copy this file to ~/.mozillarc to override.
+MOZILLA_DSP=auto
+USE_GDKXFT=false
+EOF
+
+ok($c->{MOZILLA_DSP} eq "auto");
+
+$c = t(<<EOF);
+# /etc/nsswitch.conf
+#
+# Example configuration of GNU Name Service Switch functionality.
+# If you have the `glibc-doc' and `info' packages installed, try:
+# `info libc "Name Service Switch"' for information about this file.
+
+passwd:         compat
+group:          compat
+shadow:         compat
+
+hosts:          files dns
+EOF
+
+ok($c->{passwd} eq "compat");
+ok(ref $c->{hosts} eq "ARRAY");
+
+$c = t(<<EOF);
+test: foo=bar
+test: baz
+quux: zoop
+
+EOF
+
+ok($c->{quux} eq "zoop");
+ok(ref $c->{test} eq "HASH");
+ok($c->{test}{foo} eq "bar");
+ok($c->{test}{baz} == 1);
+
+$c = t(<<EOF);
+[group1]
+host = proxy.some-domain-name.com
+port = 80
+username = blah
+password = doubleblah
+EOF
+
+ok(ref $c->{"group1"} eq "HASH");
+ok($c->{"group1"}{"host"} eq "proxy.some-domain-name.com");
+ok($c->{"group1"}{"port"} eq "80");
+ok($c->{"group1"}{"username"} eq "blah");
+ok($c->{"group1"}{"password"} eq "doubleblah");
+