-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from Madskill/fix_unescape
fix unescape
- Loading branch information
Showing
3 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#! /usr/bin/env perl | ||
|
||
use strict; | ||
use warnings FATAL => 'all'; | ||
use utf8; | ||
|
||
use Test::More tests => 6; | ||
|
||
use_ok('Data::DPath::Path'); | ||
|
||
my $FIXTURES = [ | ||
{ | ||
name => 'double quote', | ||
string => '\\"', | ||
result => '"', | ||
}, | ||
{ | ||
name => 'backslash', | ||
string => '\\\\', | ||
result => '\\', | ||
}, | ||
{ | ||
name => 'backslash with double quote', | ||
string => '\\\\\\"', | ||
result => '\\"', | ||
}, | ||
{ | ||
name => 'two backslash with double quote', | ||
string => '\\\\\\\\\\"', | ||
result => '\\\\"', | ||
}, | ||
{ | ||
name => 'example from documentations', | ||
string => '\"EE\E5\\\\\\"', | ||
result => '"EE\E5\"', | ||
}, | ||
]; | ||
|
||
foreach my $test (@$FIXTURES) { | ||
is(Data::DPath::Path::unescape($test->{'string'}), $test->{'result'}, $test->{'name'}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters