[Bps-public-commit] Config-GitLike branch, master, updated. 1.00-16-g07df981

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Aug 14 08:16:58 EDT 2009


The branch, master has been updated
       via  07df9815215dab2abdd157021425653c906eda8b (commit)
      from  4419310f6b6cadff42a7a1fc407827127b253e6d (commit)

Summary of changes:
 t/t1300-repo-config.t |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 07df9815215dab2abdd157021425653c906eda8b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Aug 14 20:16:51 2009 +0800

    added tests for value with \ or "

diff --git a/t/t1300-repo-config.t b/t/t1300-repo-config.t
index 526efde..e323b86 100644
--- a/t/t1300-repo-config.t
+++ b/t/t1300-repo-config.t
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 
 use File::Copy;
-use Test::More tests => 134;
+use Test::More tests => 140;
 use Test::Exception;
 use File::Spec;
 use File::Temp qw/tempdir/;
@@ -1538,3 +1538,28 @@ lives_and {
 }
 "subsection with escaped backslashes";
 
+# special values in subsection
+
+my %special_in_value =
+  ( backslash => "\\", doublequote => q{"} );
+
+while ( my ( $k, $v ) = each %special_in_value ) {
+    for my $times ( 1 .. 3 ) {
+        my $value = 'chan' . $v x $times . "mon" . $v x $times;
+        lives_and {
+            $config->set(
+                key      => "section.foo",
+                value    => $value,
+                filename => $config_filename,
+            );
+            $config->load;
+            is( $config->get( key => "section.foo" ), $value );
+        }
+        "value with $k occurs $times time"
+          . (
+            $times == 1
+            ? ''
+            : 's'
+          );
+    }
+}

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list