Fixing Base.parsePath test case

Fixing Base.parsePath test case
This commit is contained in:
Rajesh Nagpal 2016-06-11 20:42:35 -07:00
Родитель 244362c936
Коммит 06b22f6398
4 изменённых файлов: 96 добавлений и 23 удалений

Просмотреть файл

@ -21,6 +21,7 @@
<Content Include="package.json" />
<Content Include="changelog.md" />
<Content Include="readme.html" />
<Content Include="test\BaselineTest.PathParser.json" />
<Content Include="test\mocha.json" />
<Content Include="test\readme.md" />
</ItemGroup>

Просмотреть файл

@ -1,22 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "DocumentDB.Node.master", "DocumentDB.Node.master.njsproj", "{411C2C02-66EF-40C8-A964-AF8FDACF3961}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{411C2C02-66EF-40C8-A964-AF8FDACF3961}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{411C2C02-66EF-40C8-A964-AF8FDACF3961}.Debug|Any CPU.Build.0 = Debug|Any CPU
{411C2C02-66EF-40C8-A964-AF8FDACF3961}.Release|Any CPU.ActiveCfg = Release|Any CPU
{411C2C02-66EF-40C8-A964-AF8FDACF3961}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,94 @@
[
{
"path": "/",
"parts": [ ]
},
{
"path": "/*",
"parts": [ "*" ]
},
{
"path": "/\"Key1\"/*",
"parts": [ "Key1", "*" ]
},
{
"path": "/\"Key1\"/\"StringValue\"/*",
"parts": [ "Key1", "StringValue", "*" ]
},
{
"path": "/'Key1'/'StringValue'/*",
"parts": [ "Key1", "StringValue", "*" ]
},
{
"path": "/'Ke\\\"\\\"y1'/'Strin\\\"gValue'/*",
"parts": [ "Ke\\\"\\\"y1", "Strin\\\"gValue", "*" ]
},
{
"path": "/'Ke\\\"\\\"y1'/\"Strin'gValue\"/*",
"parts": [ "Ke\\\"\\\"y1", "Strin'gValue", "*" ]
},
{
"path": "/'Key1'/'StringValue'/*",
"parts": [ "Key1", "StringValue", "*" ]
},
{
"path": "/\"Key1\"/\"Key2\"/*",
"parts": [ "Key1", "Key2", "*" ]
},
{
"path": "/\"Key1\"/\"Key2\"/\"Key3\"/*",
"parts": [ "Key1", "Key2", "Key3", "*" ]
},
{
"path": "/\"A\"/\"B\"/\"R\"/[]/\"Address\"/[]/*",
"parts": [ "A", "B", "R", "[]", "Address", "[]", "*" ]
},
{
"path": "/\"A\"/\"B\"/\"R\"/[]/\"Address\"/[]/*",
"parts": [ "A", "B", "R", "[]", "Address", "[]", "*" ]
},
{
"path": "/\"A\"/\"B\"/\"R\"/[]/\"Address\"/*",
"parts": [ "A", "B", "R", "[]", "Address", "*" ]
},
{
"path": "/\"Key1\"/\"Key2\"/?",
"parts": [ "Key1", "Key2", "?" ]
},
{
"path": "/\"Key1\"/\"Key2\"/*",
"parts": [ "Key1", "Key2", "*" ]
},
{
"path": "/\"123\"/\"StringValue\"/*",
"parts": [ "123", "StringValue", "*" ]
},
{
"path": "/'!@#$%^&*()_+='/'StringValue'/*",
"parts": [ "!@#$%^&*()_+=", "StringValue", "*" ]
},
{
"path": "/\"_ts\"/?",
"parts": [ "_ts", "?" ]
},
{
"path": "/[]/\"City\"/*",
"parts": [ "[]", "City", "*" ]
},
{
"path": "/[]/*",
"parts": [ "[]", "*" ]
},
{
"path": "/[]/\"fine!\"/*",
"parts": [ "[]", "fine!", "*" ]
},
{
"path": "/\"this is a long key with speicial characters (*)(*)__)((*&*(&*&'*(&)()(*_)()(_(_)*!@#$%^ and numbers 132654890\"/*",
"parts": [ "this is a long key with speicial characters (*)(*)__)((*&*(&*&'*(&)()(*_)()(_(_)*!@#$%^ and numbers 132654890", "*" ]
},
{
"path": "/ Key 1 / Key 2 ",
"parts": [ "Key 1", "Key 2" ]
}
]

Просмотреть файл

@ -176,7 +176,7 @@ describe("Base.parsePath", function () {
it("test paths", function () {
var fs = require('fs');
var content = fs.readFileSync('../../.net/Microsoft.Azure.Documents.Client.Test/Routing/resources/BaselineTest.PathParser.json');
var content = fs.readFileSync('BaselineTest.PathParser.json');
var obj = JSON.parse(content);
obj.forEach(function (entry) {
test(entry.path, entry.parts);