git.annexia.org
/
hivex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
77bb0e7
)
Include a test for regimport of values containing backslash chars.
author
Richard Jones
<rjones@redhat.com>
Thu, 13 May 2010 10:23:50 +0000
(11:23 +0100)
committer
Richard Jones
<rjones@redhat.com>
Thu, 13 May 2010 10:23:50 +0000
(11:23 +0100)
perl/t/560-regedit-import.t
patch
|
blob
|
history
diff --git
a/perl/t/560-regedit-import.t
b/perl/t/560-regedit-import.t
index
163a46e
..
0dca8df
100644
(file)
--- a/
perl/t/560-regedit-import.t
+++ b/
perl/t/560-regedit-import.t
@@
-18,7
+18,6
@@
use strict;
use warnings;
use strict;
use warnings;
-use Encode qw(from_to);
use IO::Scalar;
use Test::More tests => 16;
use IO::Scalar;
use Test::More tests => 16;
@@
-102,12
+101,18
@@
$expected = '[\]
run_test ($data, $expected);
run_test ($data, $expected);
+# In the next test, the value of ValueContainingEscapes in the
+# imported data is \\W\\, which will become \W\ in the final hive.
+# However Perl has complex and inconsistent rules on quoting
+# backslashes. See:
+# http://en.wikibooks.org/wiki/Perl_Programming/Strings#Single_Quoted_Strings
$data = '
[\A]
"NotExistant"=-
[\A\B]
"Key\"Containing\"Quotes"=hex(0):
$data = '
[\A]
"NotExistant"=-
[\A\B]
"Key\"Containing\"Quotes"=hex(0):
+"ValueContainingEscapes"="\\\\W\\\\"
';
$expected = '[\]
';
$expected = '[\]
@@
-115,6
+120,7
@@
$expected = '[\]
[\A\B]
"Key\"Containing\"Quotes"=hex(0):
[\A\B]
"Key\"Containing\"Quotes"=hex(0):
+"ValueContainingEscapes"=hex(1):5c,00,57,00,5c,00,00,00
';
';
@@
-123,6
+129,7
@@
run_test ($data, $expected);
$data = '
[\A\B]
"Key\"Containing\"Quotes"=-
$data = '
[\A\B]
"Key\"Containing\"Quotes"=-
+"ValueContainingEscapes"=-
-[\A]
';
-[\A]
';