r17911 - in /branches/upstream/liburi-query-perl: ./ current/ current/t/ current/t/t03/ current/t/t05/

eloy at users.alioth.debian.org eloy at users.alioth.debian.org
Fri Mar 21 11:20:41 UTC 2008


Author: eloy
Date: Fri Mar 21 11:20:40 2008
New Revision: 17911

URL: http://svn.debian.org/wsvn/?sc=1&rev=17911
Log:
[svn-inject] Installing original source of liburi-query-perl

Added:
    branches/upstream/liburi-query-perl/
    branches/upstream/liburi-query-perl/current/
    branches/upstream/liburi-query-perl/current/MANIFEST
    branches/upstream/liburi-query-perl/current/Makefile.PL
    branches/upstream/liburi-query-perl/current/Query.pm
    branches/upstream/liburi-query-perl/current/README
    branches/upstream/liburi-query-perl/current/TODO
    branches/upstream/liburi-query-perl/current/t/
    branches/upstream/liburi-query-perl/current/t/01_constructor.t
    branches/upstream/liburi-query-perl/current/t/02_methods.t
    branches/upstream/liburi-query-perl/current/t/03_hash.t
    branches/upstream/liburi-query-perl/current/t/04_revert.t
    branches/upstream/liburi-query-perl/current/t/05_sep.t
    branches/upstream/liburi-query-perl/current/t/06_eq.t
    branches/upstream/liburi-query-perl/current/t/t03/
    branches/upstream/liburi-query-perl/current/t/t03/hash
    branches/upstream/liburi-query-perl/current/t/t03/hash_arrayref
    branches/upstream/liburi-query-perl/current/t/t03/hidden
    branches/upstream/liburi-query-perl/current/t/t05/
    branches/upstream/liburi-query-perl/current/t/t05/default   (with props)
    branches/upstream/liburi-query-perl/current/t/t05/explicit
    branches/upstream/liburi-query-perl/current/t/t05/standard

Added: branches/upstream/liburi-query-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/MANIFEST?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/MANIFEST (added)
+++ branches/upstream/liburi-query-perl/current/MANIFEST Fri Mar 21 11:20:40 2008
@@ -1,0 +1,16 @@
+Makefile.PL
+MANIFEST
+Query.pm
+README
+t/01_constructor.t
+t/02_methods.t
+t/03_hash.t
+t/04_revert.t
+t/05_sep.t
+t/06_eq.t
+t/t03/hash
+t/t03/hash_arrayref
+t/t03/hidden
+t/t05/default
+t/t05/explicit
+t/t05/standard

Added: branches/upstream/liburi-query-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/Makefile.PL?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/Makefile.PL (added)
+++ branches/upstream/liburi-query-perl/current/Makefile.PL Fri Mar 21 11:20:40 2008
@@ -1,0 +1,15 @@
+use 5.00503;
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+    'NAME'		=> 'URI::Query',
+    'VERSION_FROM'	=> 'Query.pm', # finds $VERSION
+    'PREREQ_PM'		=> {
+       URI::Escape => 0,
+       Test::More => 0,
+    }, # e.g., Module::Name => 1.1
+    ($] >= 5.005 ?    ## Add these new keywords supported since 5.005
+      (AUTHOR     => 'Gavin Carr <gavin at openfusion.com.au>') : ()),
+);
+# arch-tag: e3628f30-b383-4c8b-ad6c-e71ca0b91e7f

Added: branches/upstream/liburi-query-perl/current/Query.pm
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/Query.pm?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/Query.pm (added)
+++ branches/upstream/liburi-query-perl/current/Query.pm Fri Mar 21 11:20:40 2008
@@ -1,0 +1,284 @@
+#
+# Class providing URI query string manipulation
+#
+
+package URI::Query;
+
+use 5.00503;
+use URI::Escape;
+use strict;
+use overload 
+  '""'    => \&stringify,
+  'eq'  => sub { $_[0]->stringify eq $_[1]->stringify },
+  'ne'  => sub { $_[0]->stringify ne $_[1]->stringify };
+use vars q($VERSION);
+
+$VERSION = '0.06';
+
+# -------------------------------------------------------------------------
+# Remove all occurrences of the given parameters
+sub strip
+{
+    my $self = shift;
+    delete $self->{qq}->{$_} foreach @_;
+    $self
+}
+
+# Remove all parameters except those given
+sub strip_except
+{
+    my $self = shift;
+    my %keep = map { $_ => 1 } @_;
+    foreach (keys %{$self->{qq}}) {
+        delete $self->{qq}->{$_} unless $keep{$_};
+    }
+    $self
+}
+
+# Remove all empty/undefined parameters
+sub strip_null
+{
+    my $self = shift;
+    foreach (keys %{$self->{qq}}) {
+        delete $self->{qq}->{$_} unless @{$self->{qq}->{$_}};
+    }
+    $self
+}
+
+# Replace all occurrences of the given parameters
+sub replace
+{
+    my $self = shift;
+    my %arg = @_;
+    for my $key (keys %arg) {
+        $self->{qq}->{$key} = [];
+        if (ref $arg{$key} eq 'ARRAY') {
+            push @{$self->{qq}->{$key}}, $_ foreach @{$arg{$key}};
+        }
+        else {
+            push @{$self->{qq}->{$key}}, $arg{$key};
+        }
+    }
+    $self
+}
+
+# Return the stringified qq hash
+sub stringify
+{
+    my $self = shift;
+    my $sep = shift || $self->{sep} || '&';
+    my @out = ();
+    for my $key (sort keys %{$self->{qq}}) {
+        for my $value (sort @{$self->{qq}->{$key}}) {
+            push @out, sprintf("%s=%s", uri_escape($key), uri_escape($value));
+        }
+    }
+    join $sep, @out;
+}
+
+sub revert
+{
+    my $self = shift;
+    # Revert qq to the qq_orig hashref
+    $self->{qq} = $self->deepcopy($self->{qq_orig});
+    $self
+}
+
+# -------------------------------------------------------------------------
+# Convenience methods
+
+# Return the current qq hash(ref) with one-elt arrays flattened
+sub hash
+{
+    my $self = shift;
+    my %qq = %{$self->{qq}};
+    # Flatten one element arrays
+    for (sort keys %qq) {
+      $qq{$_} = $qq{$_}->[0] if @{$qq{$_}} == 1;
+    }
+    return wantarray ? %qq : \%qq;
+}
+
+# Return the current qq hash(ref) with all elements as arrayrefs
+sub hash_arrayref
+{
+    my $self = shift;
+    my %qq = %{$self->{qq}};
+    # (Don't flatten one element arrays)
+    return wantarray ? %qq : \%qq;
+}
+
+# Return the current query as a string of html hidden input tags
+sub hidden 
+{
+    my $self = shift;
+    my $str = '';
+    for my $key (sort keys %{$self->{qq}}) {
+        for my $value (@{$self->{qq}->{$key}}) {
+            $str .= qq(<input type="hidden" name="$key" value="$value" />\n);
+        } 
+    }
+    return $str;
+}
+
+# -------------------------------------------------------------------------
+# Parse query string, storing as hash (qq) of key => arrayref pairs
+sub parse_qs
+{
+    my $self = shift;
+    my $qs = shift;
+    for (split /&/, $qs) {
+        my ($key, $value) = split /=/;
+        $self->{qq}->{$key} ||= [];
+        push @{$self->{qq}->{$key}}, $value if defined $value && $value ne '';
+    }
+    $self
+}
+
+# Deep copy routine, originally swiped from a Randal Schwartz column
+sub deepcopy 
+{
+    my ($self, $this) = @_;
+    if (! ref $this) {
+        return $this;
+    } elsif (ref $this eq "ARRAY") {
+        return [map $self->deepcopy($_), @$this];
+    } elsif (ref $this eq "HASH") {
+        return {map { $_ => $self->deepcopy($this->{$_}) } keys %$this};
+    } elsif (ref $this eq "CODE") {
+        return $this;
+    } elsif (sprintf $this) {
+        # Object! As a last resort, try copying the stringification value
+        return sprintf $this;
+    } else {
+        die "what type is $_? (" . ref($this) . ")";
+    }
+}
+
+# Set the output separator to use by default
+sub separator
+{
+    my $self = shift;
+    $self->{sep} = shift;
+}
+
+# Constructor - either new($qs) where $qs is a scalar query string or a 
+#   a hashref of key => value pairs, or new(key => val, key => val);
+#   In the array form, keys can repeat, and/or values can be arrayrefs.
+sub new
+{
+    my $class = shift;
+    my $self = bless { qq => {} }, $class;
+    if (@_ == 1 && ! ref $_[0] && $_[0]) {
+        my $qs = shift || '';
+        # Standardise arg separator
+        $qs =~ s/;/&/g;
+        $self->parse_qs($qs);
+    }
+    elsif (@_ == 1 && ref $_[0] eq 'HASH') {
+        for my $key (keys %{$_[0]}) {
+            $self->{qq}->{$key} ||= [];
+            my $value = $_[0]->{$key};
+            push @{$self->{qq}->{$key}}, (ref $value eq 'ARRAY' ? @$value : $value)
+                if defined $value && $value ne '';
+        }
+    }
+    else {
+        while (@_ >= 2) {
+            my $key = shift;
+            my $value = shift;
+            $self->{qq}->{$key} ||= [];
+            push @{$self->{qq}->{$key}}, (ref $value eq 'ARRAY' ? @$value : $value)
+                if defined $value && $value ne '';
+        }
+    }
+    # Clone the qq hashref to allow reversion 
+    $self->{qq_orig} = $self->deepcopy($self->{qq});
+    return $self;
+}
+# -------------------------------------------------------------------------
+
+1;
+
+=head1 NAME
+
+URI::Query - class providing URI query string manipulation
+
+=head1 SYNOPSIS
+
+    # Constructor - using a GET query string
+    $qq = URI::Query->new($query_string);
+    # OR Constructor - using a set of key => value parameters 
+    $qq = URI::Query->new(%Vars);
+
+    # Remove all occurrences of the given parameters
+    $qq->strip('page', 'next');
+
+    # Remove all parameters except the given ones
+    $qq->strip_except('pagesize', 'order');
+
+    # Remove all empty/undefined parameters
+    $qq->strip_null;
+
+    # Replace all occurrences of the given parameters
+    $qq->replace(page => $page, foo => 'bar');
+
+    # Set the argument separator to use for output (default: unescaped '&')
+    $qq->separator(';');
+
+    # Output the current query string
+    print "$qq";           # OR $qq->stringify;
+    # Stringify with explicit argument separator
+    $qq->stringify(';');
+
+    # Get a flattened hash/hashref of the current parameters
+    #   (single item parameters as scalars, multiples as an arrayref)
+    my %qq = $qq->hash;
+
+    # Get a non-flattened hash/hashref of the current parameters
+    #   (parameter => arrayref of values)
+    my %qq = $qq->hash_arrayref;
+
+    # Get the current query string as a set of hidden input tags
+    print $qq->hidden;
+
+    # Revert back to the initial constructor state (to do it all again)
+    $qq->revert;
+
+
+=head1 DESCRIPTION
+
+URI::Query provides simple URI query string manipulation, allowing you
+to create and manipulate URI query strings from GET and POST requests in
+web applications. This is primarily useful for creating links where you 
+wish to preserve some subset of the parameters to the current request,
+and potentially add or replace others. Given a query string this is 
+doable with regexes, of course, but making sure you get the anchoring 
+and escaping right is tedious and error-prone - this module is simpler.
+
+
+=head1 BUGS AND CAVEATS
+
+None known.
+
+Note that this module doesn't do any input unescaping of query strings - 
+you're (currently) expected to handle that explicitly yourself.
+
+
+=head1 AUTHOR
+
+Gavin Carr <gavin at openfusion.com.au>
+
+
+=head1 COPYRIGHT
+
+Copyright 2004-2005, Gavin Carr. All Rights Reserved.
+
+This program is free software. You may copy or redistribute it under the 
+same terms as perl itself.
+
+
+=cut
+
+# arch-tag: 66eb6ee6-02bb-43e5-bda7-9529ad44f86f
+

Added: branches/upstream/liburi-query-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/README?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/README (added)
+++ branches/upstream/liburi-query-perl/current/README Fri Mar 21 11:20:40 2008
@@ -1,0 +1,34 @@
+URI/Query
+=========
+
+URI::Query provides simple URI query string manipulation, allowing you
+to create and manipulate URI query strings from GET and POST requests in
+web applications. This is primarily useful for creating links where you 
+wish to preserve some subset of the parameters to the current request,
+and potentially add or replace others. Given a query string this is 
+doable with regexes, of course, but making sure you get the anchoring 
+and escaping right is tedious and error-prone - using this module is 
+much simpler.
+
+INSTALLATION
+
+Installation is the standard perl install tango:
+
+   perl Makefile.PL
+   make
+   make test
+   make install
+
+DEPENDENCIES
+
+This module requires these other modules and libraries:
+
+  URI::Escape
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2004-2005 Gavin Carr. All Rights Reserved.
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself. 
+

Added: branches/upstream/liburi-query-perl/current/TODO
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/TODO?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/TODO (added)
+++ branches/upstream/liburi-query-perl/current/TODO Fri Mar 21 11:20:40 2008
@@ -1,0 +1,1 @@
+- add a value() method to query a particular arg value

Added: branches/upstream/liburi-query-perl/current/t/01_constructor.t
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/t/01_constructor.t?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/t/01_constructor.t (added)
+++ branches/upstream/liburi-query-perl/current/t/01_constructor.t Fri Mar 21 11:20:40 2008
@@ -1,0 +1,33 @@
+# Basic URI::Query tests
+
+use Test::More tests => 17;
+use_ok(URI::Query);
+use strict;
+
+my $qq;
+
+# Constructor - scalar version
+ok($qq = URI::Query->new('foo=1&foo=2&bar=3;bog=abc;bar=7;fluffy=3'), "constructor1 ok");
+is($qq->stringify, 'bar=3&bar=7&bog=abc&fluffy=3&foo=1&foo=2', 
+  sprintf("stringifies ok (%s)", $qq->stringify));
+
+# Constructor - array version
+ok($qq = URI::Query->new(foo => 1, foo => 2, bar => 3, bog => 'abc', bar => 7, fluffy => 3), "array constructor ok");
+is($qq->stringify, 'bar=3&bar=7&bog=abc&fluffy=3&foo=1&foo=2', 
+  sprintf("stringifies ok (%s)", $qq->stringify));
+
+# Constructor - hashref version
+ok($qq = URI::Query->new({ foo => [ 1, 2 ], bar => [ 3, 7 ], bog => 'abc', fluffy => 3 }), "hashref constructor ok");
+is($qq->stringify, 'bar=3&bar=7&bog=abc&fluffy=3&foo=1&foo=2', 
+  sprintf("stringifies ok (%s)", $qq->stringify));
+
+# Bad constructor args
+for my $bad ((undef, '', \"foo", [ foo => 1 ], \*bad)) {
+  my $b2 = $bad;
+  $b2 = '[undef]' unless defined $bad;
+  $qq = URI::Query->new($bad);
+  ok(ref $qq eq 'URI::Query', "bad '$b2' constructor ok");
+  is($qq->stringify, '', sprintf("stringifies ok (%s)", $qq->stringify));
+}
+
+# arch-tag: 714ab082-385f-4158-bbf5-7547759ec65e

Added: branches/upstream/liburi-query-perl/current/t/02_methods.t
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/t/02_methods.t?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/t/02_methods.t (added)
+++ branches/upstream/liburi-query-perl/current/t/02_methods.t Fri Mar 21 11:20:40 2008
@@ -1,0 +1,44 @@
+# URI::Query tests
+
+use Test::More tests => 15;
+BEGIN { use_ok( URI::Query ) }
+use strict;
+my $qq;
+
+# Basics - scalar version
+ok($qq = URI::Query->new('foo=1&foo=2&bar=3;bog=abc;bar=7;fluffy=3'), "constructor ok");
+is($qq->stringify, 'bar=3&bar=7&bog=abc&fluffy=3&foo=1&foo=2', 
+  sprintf("stringifies ok (%s)", $qq->stringify));
+
+# strip
+ok($qq->strip(qw(foo bog)), "strip ok");
+is($qq->stringify, 'bar=3&bar=7&fluffy=3', 
+  sprintf("strip correct (%s)", $qq->stringify));
+
+# Simple replace
+$qq = URI::Query->new('foo=1&foo=2&bar=3;bog=abc;bar=7;fluffy=3');
+ok($qq->replace(foo => 'xyz', bog => 'magic', extra => 1), "replace ok");
+is($qq->stringify, 'bar=3&bar=7&bog=magic&extra=1&fluffy=3&foo=xyz', 
+  sprintf("replace correct (%s)", $qq->stringify));
+
+# Composite replace
+ok($qq->replace(foo => [ 123, 456, 789 ], extra => 2), "replace ok");
+is($qq->stringify, 'bar=3&bar=7&bog=magic&extra=2&fluffy=3&foo=123&foo=456&foo=789',
+  sprintf("replace correct (%s)", $qq->stringify));
+
+# Auto-stringification
+is("$qq", 'bar=3&bar=7&bog=magic&extra=2&fluffy=3&foo=123&foo=456&foo=789',
+  sprintf("auto-stringification ok (%s)", $qq . ''));
+
+# strip_except
+ok($qq->strip_except(qw(bar foo extra)), "strip_except ok");
+is($qq->stringify, 'bar=3&bar=7&extra=2&foo=123&foo=456&foo=789',
+  sprintf("strip_except correct (%s)", $qq->stringify));
+
+# strip_null
+ok($qq = URI::Query->new(foo => 1, foo => 2, bar => '', bog => 'abc', zero => 0, fluffy => undef), "array constructor ok");
+ok($qq->strip_null, "strip_null ok");
+is($qq->stringify, 'bog=abc&foo=1&foo=2&zero=0', 
+  sprintf("strip_null correct (%s)", $qq->stringify));
+
+# arch-tag: 41878e14-bac6-41ab-9fa8-329151afb4de

Added: branches/upstream/liburi-query-perl/current/t/03_hash.t
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/t/03_hash.t?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/t/03_hash.t (added)
+++ branches/upstream/liburi-query-perl/current/t/03_hash.t Fri Mar 21 11:20:40 2008
@@ -1,0 +1,67 @@
+# URI::Query hash methods
+
+use strict;
+use vars q($count);
+
+BEGIN { $count = 5 }
+use Test::More tests => $count;
+
+use_ok('URI::Query');
+
+my ($qq, $out);
+
+# Load result strings
+my $test = 't03';
+my %result = ();
+$test = "t/$test" if -d "t/$test";
+die "missing data dir $test" unless -d $test;
+{
+  opendir my $dir, "$test" or die "can't open $test";
+  for (readdir $dir) {
+    next if m/^\./;
+    open my $file, "<$test/$_" or die "can't read $test/$_";
+    local $/ = undef;
+    $result{$_} = <$file>;
+  }
+}
+
+my $print = shift @ARGV || 0;
+my $t = 3;
+sub report {
+  my ($data, $file, $inc) = @_;
+  $inc ||= 1;
+  if ($print == $t) {
+    print STDERR "--> $file\n";
+    print $data;
+    exit 0;
+  }
+  $t += $inc;
+}
+
+ok($qq = URI::Query->new('foo=1&foo=2&bar=3;bog=abc;bar=7;fluffy=3'), "constructor ok");
+
+SKIP: {
+   my $yaml = eval { require YAML };
+   skip "YAML not found", 2 unless $yaml;
+
+   # Require YAML 0.39 on Windows (reported by Andy Grundman)
+   if ($^O =~ m/^MSWin/i && ! defined eval { YAML->VERSION(0.39) }) {
+     skip "YAML >= 0.39 required on windows", 2;
+   }
+
+   $out = YAML::Dump(scalar($qq->hash));
+   report $out, "hash";
+   is($out, $result{hash}, 'hash ok');
+   
+   $out = YAML::Dump(scalar($qq->hash_arrayref));
+   report $out, "hash_arrayref";
+   is($out, $result{hash_arrayref}, 'hash_arrayref ok');
+
+}
+
+$out = $qq->hidden;
+report $out, "hidden";
+is($out, $result{hidden}, 'hidden ok');
+
+
+# arch-tag: 5f2184d9-67f0-4f89-a1e8-1f67beabdaa2

Added: branches/upstream/liburi-query-perl/current/t/04_revert.t
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/t/04_revert.t?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/t/04_revert.t (added)
+++ branches/upstream/liburi-query-perl/current/t/04_revert.t Fri Mar 21 11:20:40 2008
@@ -1,0 +1,27 @@
+# Test URI::Query revert()
+
+use strict;
+use vars q($count);
+
+BEGIN { $count = 4 }
+use Test::More tests => $count;
+
+use_ok('URI::Query');
+
+my $qq;
+
+ok($qq = URI::Query->new('foo=1&foo=2&bar=3;bog=abc;bar=7;fluffy=3'), "constructor ok");
+my $str1 = $qq->stringify;
+
+# Strip
+$qq->strip(qw(foo fluffy));
+my $str2 = $qq->stringify;
+isnt($str1, $str2, "strings different after strip");
+
+# Revert
+$qq->revert;
+my $str3 = $qq->stringify;
+is($str1, $str3, "strings identical after revert");
+
+
+# arch-tag: 8db23dc8-a686-467f-a2f0-ca9127bb1f18

Added: branches/upstream/liburi-query-perl/current/t/05_sep.t
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/t/05_sep.t?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/t/05_sep.t (added)
+++ branches/upstream/liburi-query-perl/current/t/05_sep.t Fri Mar 21 11:20:40 2008
@@ -1,0 +1,66 @@
+# Test separator handling
+
+use strict;
+use vars q($count);
+
+BEGIN { $count = 6 }
+use Test::More tests => $count;
+
+use_ok('URI::Query');
+
+my ($qq, $out);
+
+# Load result strings
+my $test = 't05';
+my %result = ();
+$test = "t/$test" if -d "t/$test";
+die "missing data dir $test" unless -d $test;
+{
+  opendir my $dir, "$test" or die "can't open $test";
+  for (readdir $dir) {
+    next if m/^\./;
+    open my $file, "<$test/$_" or die "can't read $test/$_";
+    {
+      local $/ = undef;
+      $result{$_} = <$file>;
+    }
+    chomp $result{$_};
+  }
+}
+
+my $print = shift @ARGV || 0;
+my $t = 3;
+sub report {
+  my ($data, $file, $inc) = @_;
+  $inc ||= 1;
+  if ($print == $t) {
+    print STDERR "--> $file\n";
+    print $data;
+    exit 0;
+  }
+  $t += $inc;
+}
+
+ok($qq = URI::Query->new('foo=1&foo=2&bar=3;bog=abc;bar=7;fluffy=3'), "constructor ok");
+$out = $qq->stringify;
+report $out, "standard";
+is($out, $result{standard}, "standard stringify ok");
+
+# Stringify with an explicit separator
+$out = $qq->stringify(';');
+report $out, "explicit";
+is($out, $result{explicit}, "explicit separator ok");
+
+# Recheck standard in place
+$out = $qq->stringify;
+report $out, "standard";
+is($out, $result{standard}, "standard stringify ok");
+
+# Set default separator
+$qq->separator(';');
+$out = $qq->stringify;
+report $out, "default";
+is($out, $result{default}, "setting default separator ok");
+
+
+# arch-tag: c8d36b26-e951-4445-a280-bfdcb652b4e0

Added: branches/upstream/liburi-query-perl/current/t/06_eq.t
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/t/06_eq.t?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/t/06_eq.t (added)
+++ branches/upstream/liburi-query-perl/current/t/06_eq.t Fri Mar 21 11:20:40 2008
@@ -1,0 +1,17 @@
+# Test 'eq' overloading
+
+use Test::More tests => 8;
+BEGIN { use_ok( URI::Query ) }
+use strict;
+my ($qq1, $qq2);
+
+ok($qq1 = URI::Query->new('foo=1&foo=2&bar=3'), 'qq1 constructor ok');
+ok($qq2 = URI::Query->new('foo=1&foo=2&bar=3'), 'qq2 constructor ok');
+is($qq1, $qq2, 'eq ok');
+ok($qq2 = URI::Query->new('bar=3&foo=2&foo=1'), 'qq2 constructor ok');
+is($qq1, $qq2, 'eq ok');
+ok($qq2 = URI::Query->new('bar=3'), 'qq2 constructor ok');
+isnt($qq1, $qq2, 'ne ok');
+
+
+# arch-tag: 0fa9697e-843a-4cd3-a4d5-c4aac67430a0

Added: branches/upstream/liburi-query-perl/current/t/t03/hash
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/t/t03/hash?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/t/t03/hash (added)
+++ branches/upstream/liburi-query-perl/current/t/t03/hash Fri Mar 21 11:20:40 2008
@@ -1,0 +1,9 @@
+---
+bar:
+  - 3
+  - 7
+bog: abc
+fluffy: 3
+foo:
+  - 1
+  - 2

Added: branches/upstream/liburi-query-perl/current/t/t03/hash_arrayref
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/t/t03/hash_arrayref?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/t/t03/hash_arrayref (added)
+++ branches/upstream/liburi-query-perl/current/t/t03/hash_arrayref Fri Mar 21 11:20:40 2008
@@ -1,0 +1,11 @@
+---
+bar:
+  - 3
+  - 7
+bog:
+  - abc
+fluffy:
+  - 3
+foo:
+  - 1
+  - 2

Added: branches/upstream/liburi-query-perl/current/t/t03/hidden
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/t/t03/hidden?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/t/t03/hidden (added)
+++ branches/upstream/liburi-query-perl/current/t/t03/hidden Fri Mar 21 11:20:40 2008
@@ -1,0 +1,6 @@
+<input type="hidden" name="bar" value="3" />
+<input type="hidden" name="bar" value="7" />
+<input type="hidden" name="bog" value="abc" />
+<input type="hidden" name="fluffy" value="3" />
+<input type="hidden" name="foo" value="1" />
+<input type="hidden" name="foo" value="2" />

Added: branches/upstream/liburi-query-perl/current/t/t05/default
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/t/t05/default?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/t/t05/default (added)
+++ branches/upstream/liburi-query-perl/current/t/t05/default Fri Mar 21 11:20:40 2008
@@ -1,0 +1,1 @@
+link explicit

Propchange: branches/upstream/liburi-query-perl/current/t/t05/default
------------------------------------------------------------------------------
    svn:special = *

Added: branches/upstream/liburi-query-perl/current/t/t05/explicit
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/t/t05/explicit?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/t/t05/explicit (added)
+++ branches/upstream/liburi-query-perl/current/t/t05/explicit Fri Mar 21 11:20:40 2008
@@ -1,0 +1,1 @@
+bar=3;bar=7;bog=abc;fluffy=3;foo=1;foo=2

Added: branches/upstream/liburi-query-perl/current/t/t05/standard
URL: http://svn.debian.org/wsvn/branches/upstream/liburi-query-perl/current/t/t05/standard?rev=17911&op=file
==============================================================================
--- branches/upstream/liburi-query-perl/current/t/t05/standard (added)
+++ branches/upstream/liburi-query-perl/current/t/t05/standard Fri Mar 21 11:20:40 2008
@@ -1,0 +1,1 @@
+bar=3&bar=7&bog=abc&fluffy=3&foo=1&foo=2




More information about the Pkg-perl-cvs-commits mailing list