diff --git a/UriTemplates.sln b/UriTemplates.sln index 205a911..0a0ec01 100644 --- a/UriTemplates.sln +++ b/UriTemplates.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 +# Visual Studio 15 +VisualStudioVersion = 15.0.28010.2036 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0C994FD2-43CE-4412-BCCD-628DBD8130DF}" ProjectSection(SolutionItems) = preProject @@ -9,109 +9,34 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Readme.md = Readme.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UriTemplates", "src\UriTemplates\UriTemplates.csproj", "{F571E020-AB02-4284-BE11-033D6E92EB66}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UriTemplateTests", "src\UriTemplateTests\UriTemplateTests.csproj", "{5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UriTemplatesPCL", "src\UriTemplatesPCL\UriTemplatesPCL.csproj", "{F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UriTemplatesPCLTests", "src\UriTemplatesPCLTests\UriTemplatesPCLTests.csproj", "{ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UriTemplates.net45", "src\UriTemplates.net45\UriTemplates.net45.csproj", "{9AE8407F-07FB-4536-9EE1-0A64831A42C3}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{718037C6-0F82-456A-B7EB-531694D035B4}" ProjectSection(SolutionItems) = preProject build\Build.proj = build\Build.proj ReleaseNotes.md = ReleaseNotes.md - build\Tavis.UriTemplates.nuspec = build\Tavis.UriTemplates.nuspec EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UriTemplates.net40", "src\UriTemplates.net40\UriTemplates.net40.csproj", "{F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UriTemplates", "src\UriTemplates\UriTemplates.csproj", "{EAF9C53B-5FC1-4E12-ADA2-16638E06AB61}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UriTemplates.profile92", "src\UriTemplates.profile92\UriTemplates.profile92.csproj", "{147131F4-08E6-401E-BB27-FFB9754A9682}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UriTemplateTests", "test\UriTemplateTests\UriTemplateTests.csproj", "{E9F4C953-526C-46EC-A037-7A9E9B61C92A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F571E020-AB02-4284-BE11-033D6E92EB66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F571E020-AB02-4284-BE11-033D6E92EB66}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F571E020-AB02-4284-BE11-033D6E92EB66}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F571E020-AB02-4284-BE11-033D6E92EB66}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F571E020-AB02-4284-BE11-033D6E92EB66}.Debug|x86.ActiveCfg = Debug|Any CPU - {F571E020-AB02-4284-BE11-033D6E92EB66}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F571E020-AB02-4284-BE11-033D6E92EB66}.Release|Any CPU.Build.0 = Release|Any CPU - {F571E020-AB02-4284-BE11-033D6E92EB66}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F571E020-AB02-4284-BE11-033D6E92EB66}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F571E020-AB02-4284-BE11-033D6E92EB66}.Release|x86.ActiveCfg = Release|Any CPU - {5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Debug|x86.ActiveCfg = Debug|Any CPU - {5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Release|Any CPU.Build.0 = Release|Any CPU - {5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Release|x86.ActiveCfg = Release|Any CPU - {F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Debug|x86.ActiveCfg = Debug|Any CPU - {F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Release|Any CPU.Build.0 = Release|Any CPU - {F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Release|x86.ActiveCfg = Release|Any CPU - {ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Debug|x86.ActiveCfg = Debug|Any CPU - {ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Release|Any CPU.Build.0 = Release|Any CPU - {ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Release|x86.ActiveCfg = Release|Any CPU - {9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Debug|x86.ActiveCfg = Debug|Any CPU - {9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Release|Any CPU.Build.0 = Release|Any CPU - {9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Release|x86.ActiveCfg = Release|Any CPU - {F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Debug|x86.ActiveCfg = Debug|Any CPU - {F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Release|Any CPU.Build.0 = Release|Any CPU - {F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Release|x86.ActiveCfg = Release|Any CPU - {147131F4-08E6-401E-BB27-FFB9754A9682}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {147131F4-08E6-401E-BB27-FFB9754A9682}.Debug|Any CPU.Build.0 = Debug|Any CPU - {147131F4-08E6-401E-BB27-FFB9754A9682}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {147131F4-08E6-401E-BB27-FFB9754A9682}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {147131F4-08E6-401E-BB27-FFB9754A9682}.Debug|x86.ActiveCfg = Debug|Any CPU - {147131F4-08E6-401E-BB27-FFB9754A9682}.Release|Any CPU.ActiveCfg = Release|Any CPU - {147131F4-08E6-401E-BB27-FFB9754A9682}.Release|Any CPU.Build.0 = Release|Any CPU - {147131F4-08E6-401E-BB27-FFB9754A9682}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {147131F4-08E6-401E-BB27-FFB9754A9682}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {147131F4-08E6-401E-BB27-FFB9754A9682}.Release|x86.ActiveCfg = Release|Any CPU + {EAF9C53B-5FC1-4E12-ADA2-16638E06AB61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EAF9C53B-5FC1-4E12-ADA2-16638E06AB61}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EAF9C53B-5FC1-4E12-ADA2-16638E06AB61}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EAF9C53B-5FC1-4E12-ADA2-16638E06AB61}.Release|Any CPU.Build.0 = Release|Any CPU + {E9F4C953-526C-46EC-A037-7A9E9B61C92A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E9F4C953-526C-46EC-A037-7A9E9B61C92A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E9F4C953-526C-46EC-A037-7A9E9B61C92A}.Release|Any CPU.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {575A6C64-9E46-4CFC-B284-432D50F65143} + EndGlobalSection EndGlobal diff --git a/build/Build.proj b/build/Build.proj index c81169b..f477515 100644 --- a/build/Build.proj +++ b/build/Build.proj @@ -9,34 +9,16 @@ $(BaseDir) - - - - - - - - - - - + - \ No newline at end of file + diff --git a/build/Tavis.UriTemplates.nuspec b/build/Tavis.UriTemplates.nuspec deleted file mode 100644 index 4151ecf..0000000 --- a/build/Tavis.UriTemplates.nuspec +++ /dev/null @@ -1,26 +0,0 @@ - - - - Tavis.UriTemplates - 1.1.2 - Darrel Miller - false - Tavis.UriTemplates - URI Template resolution library - Implementation of RFC 6570 - http - - https://github.com/tavis-software/Tavis.UriTemplates - - - - - - - - - - - - \ No newline at end of file diff --git a/src/UriTemplateTests/App.config b/src/UriTemplateTests/App.config deleted file mode 100644 index 229907b..0000000 --- a/src/UriTemplateTests/App.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/UriTemplateTests/Properties/AssemblyInfo.cs b/src/UriTemplateTests/Properties/AssemblyInfo.cs deleted file mode 100644 index 7868f6b..0000000 --- a/src/UriTemplateTests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("UriTemplateTests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("UriTemplateTests")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("ee316fdc-302c-4bfc-9054-a9ae9dc9d918")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/UriTemplateTests/UriTemplateTests.csproj b/src/UriTemplateTests/UriTemplateTests.csproj deleted file mode 100644 index cdba336..0000000 --- a/src/UriTemplateTests/UriTemplateTests.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B} - Library - Properties - UriTemplateTests - UriTemplateTests - v4.6 - 512 - ..\ - true - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll - True - - - - - - - - - - - ..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll - True - - - ..\..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll - True - - - ..\..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll - True - - - ..\..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll - True - - - - - - - - - - - - - - - {F571E020-AB02-4284-BE11-033D6E92EB66} - UriTemplates - - - - - spec-examples.json - - - extended-tests.json - - - negative-tests.json - - - spec-examples-by-section.json - - - Designer - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - \ No newline at end of file diff --git a/src/UriTemplateTests/packages.config b/src/UriTemplateTests/packages.config deleted file mode 100644 index 6888a8b..0000000 --- a/src/UriTemplateTests/packages.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/UriTemplates.net40/Properties/AssemblyInfo.cs b/src/UriTemplates.net40/Properties/AssemblyInfo.cs deleted file mode 100644 index b122ff1..0000000 --- a/src/UriTemplates.net40/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("UriTemplates.net40")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("UriTemplates.net40")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("99ec5b31-385d-4850-b4d4-684a19d54b0d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/UriTemplates.net40/UriTemplates.net40.csproj b/src/UriTemplates.net40/UriTemplates.net40.csproj deleted file mode 100644 index 1c64836..0000000 --- a/src/UriTemplates.net40/UriTemplates.net40.csproj +++ /dev/null @@ -1,73 +0,0 @@ - - - - - Debug - AnyCPU - {F8ED5782-BD7C-46C4-B2DA-42D9BC49C748} - Library - Properties - Tavis - Tavis.UriTemplates - v4.0 - 512 - - - true - full - false - bin\Debug\ - TRACE;DEBUG;TYPE_CONVERTER - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - OperatorInfo.cs - - - Result.cs - - - UriTemplate.cs - - - UriTemplateCOnverter.cs - - - UriTemplateExtensions.cs - - - UriTemplateTable.cs - - - VarSpec.cs - - - - - - \ No newline at end of file diff --git a/src/UriTemplates.net45/Properties/AssemblyInfo.cs b/src/UriTemplates.net45/Properties/AssemblyInfo.cs deleted file mode 100644 index eb0a71d..0000000 --- a/src/UriTemplates.net45/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("UriTemplates.net45")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("UriTemplates.net45")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("49053acd-8821-4df6-a4f9-ed876a91a8da")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/UriTemplates.net45/UriTemplates.net45.csproj b/src/UriTemplates.net45/UriTemplates.net45.csproj deleted file mode 100644 index 9e6c806..0000000 --- a/src/UriTemplates.net45/UriTemplates.net45.csproj +++ /dev/null @@ -1,73 +0,0 @@ - - - - - Debug - AnyCPU - {9AE8407F-07FB-4536-9EE1-0A64831A42C3} - Library - Properties - Tavis - Tavis.UriTemplates - v4.5 - 512 - - - true - full - false - bin\Debug\ - TRACE;DEBUG;TYPE_CONVERTER - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - OperatorInfo.cs - - - Result.cs - - - UriTemplate.cs - - - UriTemplateConverter.cs - - - UriTemplateExtensions.cs - - - UriTemplateTable.cs - - - VarSpec.cs - - - - - - \ No newline at end of file diff --git a/src/UriTemplates.profile92/Properties/AssemblyInfo.cs b/src/UriTemplates.profile92/Properties/AssemblyInfo.cs deleted file mode 100644 index f974a66..0000000 --- a/src/UriTemplates.profile92/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Resources; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("UriTemplates.profile92")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("UriTemplates.profile92")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: NeutralResourcesLanguage("en")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/UriTemplates.profile92/UriTemplates.profile92.csproj b/src/UriTemplates.profile92/UriTemplates.profile92.csproj deleted file mode 100644 index 0e11019..0000000 --- a/src/UriTemplates.profile92/UriTemplates.profile92.csproj +++ /dev/null @@ -1,65 +0,0 @@ - - - - - 10.0 - Debug - AnyCPU - {147131F4-08E6-401E-BB27-FFB9754A9682} - Library - Properties - Tavis - Tavis.UriTemplates - en-US - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Profile92 - v4.0 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - OperatorInfo.cs - - - Result.cs - - - UriTemplate.cs - - - UriTemplateExtensions.cs - - - UriTemplateTable.cs - - - VarSpec.cs - - - - - - \ No newline at end of file diff --git a/src/UriTemplates/OperatorInfo.cs b/src/UriTemplates/OperatorInfo.cs index d09222b..6c5c973 100644 --- a/src/UriTemplates/OperatorInfo.cs +++ b/src/UriTemplates/OperatorInfo.cs @@ -8,6 +8,5 @@ public class OperatorInfo public bool Named { get; set; } public string IfEmpty { get; set; } public bool AllowReserved { get; set; } - } } \ No newline at end of file diff --git a/src/UriTemplates/Properties/AssemblyInfo.cs b/src/UriTemplates/Properties/AssemblyInfo.cs deleted file mode 100644 index 8646174..0000000 --- a/src/UriTemplates/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("UriTemplates")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("UriTemplates")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/UriTemplates/Result.cs b/src/UriTemplates/Result.cs index 844fc90..6155a41 100644 --- a/src/UriTemplates/Result.cs +++ b/src/UriTemplates/Result.cs @@ -142,8 +142,5 @@ public static string HexEscape(char c) { return new string(esc); } private static readonly char[] HexDigits = new char[] {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; - - - } } \ No newline at end of file diff --git a/src/UriTemplates/UriTemplate.cs b/src/UriTemplates/UriTemplate.cs index 70ffc79..d035719 100644 --- a/src/UriTemplates/UriTemplate.cs +++ b/src/UriTemplates/UriTemplate.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Globalization; using System.Text.RegularExpressions; namespace Tavis.UriTemplates @@ -20,8 +17,6 @@ namespace Tavis.UriTemplates #endif public class UriTemplate { - - private static Dictionary _Operators = new Dictionary() { {'\0', new OperatorInfo {Default = true, First = "", Seperator = ',', Named = false, IfEmpty = "",AllowReserved = false}}, {'+', new OperatorInfo {Default = false, First = "", Seperator = ',', Named = false, IfEmpty = "",AllowReserved = true}}, @@ -283,7 +278,6 @@ private bool ProcessVariable(VarSpec varSpec, Result result, bool multiVariableE } else { - // Handle associative arrays var dictionary = value as IDictionary; if (dictionary != null) @@ -297,14 +291,16 @@ private bool ProcessVariable(VarSpec varSpec, Result result, bool multiVariableE else { // If above all fails, convert the object to string using the default object.ToString() implementation - var stringValue = value.ToString(); - if (varSpec.OperatorInfo.Named) + using (new WithCultureInfo(CultureInfo.InvariantCulture)) { - result.AppendName(varname, varSpec.OperatorInfo, string.IsNullOrEmpty(stringValue)); + var stringValue = value.ToString(); + if (varSpec.OperatorInfo.Named) + { + result.AppendName(varname, varSpec.OperatorInfo, string.IsNullOrEmpty(stringValue)); + } + result.AppendValue(stringValue, varSpec.PrefixLength, varSpec.OperatorInfo.AllowReserved); } - result.AppendValue(stringValue, varSpec.PrefixLength, varSpec.OperatorInfo.AllowReserved); } - } } @@ -468,7 +464,6 @@ private static string GetQueryExpression(List paramNames, string prefix) return sb.ToString(); } - private static string GetExpression(List paramNames, string prefix = null) { StringBuilder sb = new StringBuilder(); @@ -497,7 +492,6 @@ private static string GetExpression(List paramNames, string prefix = nul default: paramDelim = "[^/?&]+"; break; - } foreach (var paramname in paramNames) @@ -518,9 +512,5 @@ private static string GetExpression(List paramNames, string prefix = nul return sb.ToString(); } - - } - - } diff --git a/src/UriTemplates/UriTemplateExtensions.cs b/src/UriTemplates/UriTemplateExtensions.cs index ef96d6c..35c4967 100644 --- a/src/UriTemplates/UriTemplateExtensions.cs +++ b/src/UriTemplates/UriTemplateExtensions.cs @@ -21,7 +21,7 @@ public static UriTemplate AddParameters(this UriTemplate template, object parame if (parametersObject != null) { IEnumerable properties; -#if DOTNET5_1 +#if NETSTANDARD1_0 var type = parametersObject.GetType().GetTypeInfo(); properties = type.DeclaredProperties.Where(p=> p.CanRead); #else @@ -36,6 +36,7 @@ public static UriTemplate AddParameters(this UriTemplate template, object parame return template; } + public static UriTemplate AddParameters(this UriTemplate uriTemplate, IDictionary linkParameters) { if (linkParameters != null) @@ -83,7 +84,5 @@ public static Dictionary GetQueryStringParameters(this Uri targe } return parameters; } - - } } diff --git a/src/UriTemplates/UriTemplateTable.cs b/src/UriTemplates/UriTemplateTable.cs index 3489902..202230c 100644 --- a/src/UriTemplates/UriTemplateTable.cs +++ b/src/UriTemplates/UriTemplateTable.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; namespace Tavis.UriTemplates { diff --git a/src/UriTemplates/UriTemplates.csproj b/src/UriTemplates/UriTemplates.csproj index fee15aa..dc03755 100644 --- a/src/UriTemplates/UriTemplates.csproj +++ b/src/UriTemplates/UriTemplates.csproj @@ -1,61 +1,27 @@ - - + + - Debug - AnyCPU - 8.0.30703 - 2.0 - {F571E020-AB02-4284-BE11-033D6E92EB66} - Library - Properties - Tavis.UriTemplates - Tavis.UriTemplates - v3.5 - 512 - ..\ - + netstandard1.0;net35;net40;net45 + Tavis.UriTemplates + 1.1.2 + Darrel Miller + http + URI Template resolution library - Implementation of RFC 6570 + Tavis.UriTemplates + For full release notes see https://github.com/tavis-software/Tavis.UriTemplates/blob/master/ReleaseNotes.md + https://github.com/tavis-software/Tavis.UriTemplates + https://github.com/tavis-software/Tavis.UriTemplates + git + https://github.com/tavis-software/Tavis.UriTemplates/blob/master/License.txt - - true - full - false - bin\Debug\ - TRACE;DEBUG;TYPE_CONVERTER - prompt - 4 + + + TRACE;DEBUG;TYPE_CONVERTER;NETSTANDARD;NETSTANDARD1_0 - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - + + + + 4.3.0 + - - - \ No newline at end of file + diff --git a/src/UriTemplates/VarSpec.cs b/src/UriTemplates/VarSpec.cs index ff95f0d..0b1a2ff 100644 --- a/src/UriTemplates/VarSpec.cs +++ b/src/UriTemplates/VarSpec.cs @@ -26,7 +26,6 @@ public override string ToString() VarName.ToString() + (Explode ? "*" : "") + (PrefixLength > 0 ? ":" + PrefixLength : ""); - } } -} \ No newline at end of file +} diff --git a/src/UriTemplates/WithCultureInfo.cs b/src/UriTemplates/WithCultureInfo.cs new file mode 100644 index 0000000..483e036 --- /dev/null +++ b/src/UriTemplates/WithCultureInfo.cs @@ -0,0 +1,34 @@ +using System; +using System.Globalization; +#if NETSTANDARD1_0 +#else +using System.Threading; +#endif + +namespace Tavis.UriTemplates +{ + public sealed class WithCultureInfo : IDisposable + { + private readonly CultureInfo _oldCultureInfo; + + public WithCultureInfo(CultureInfo cultureInfo) + { + _oldCultureInfo = CultureInfo.CurrentCulture; + +#if NETSTANDARD1_0 + CultureInfo.DefaultThreadCurrentCulture = cultureInfo; +#else + Thread.CurrentThread.CurrentUICulture = cultureInfo; +#endif + } + + public void Dispose() + { +#if NETSTANDARD1_0 + CultureInfo.DefaultThreadCurrentCulture = _oldCultureInfo; +#else + Thread.CurrentThread.CurrentUICulture = _oldCultureInfo; +#endif + } + } +} diff --git a/src/UriTemplatesPCL/Properties/AssemblyInfo.cs b/src/UriTemplatesPCL/Properties/AssemblyInfo.cs deleted file mode 100644 index 8cdd119..0000000 --- a/src/UriTemplatesPCL/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Resources; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("UriTemplatesPCL")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("UriTemplatesPCL")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: NeutralResourcesLanguage("en")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/UriTemplatesPCL/UriTemplatesPCL.csproj b/src/UriTemplatesPCL/UriTemplatesPCL.csproj deleted file mode 100644 index 5b22800..0000000 --- a/src/UriTemplatesPCL/UriTemplatesPCL.csproj +++ /dev/null @@ -1,81 +0,0 @@ - - - - - 14.0 - Debug - AnyCPU - {F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF} - Library - Properties - Tavis - Tavis.UriTemplates - v5.0 - - - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - - - 4.0 - - - true - full - false - bin\Debug\ - TRACE;DEBUG;DOTNET5_1;TYPE_CONVERTER - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE;DOTNET5_1 - prompt - 4 - - - - OperatorInfo.cs - - - Result.cs - - - UriTemplate.cs - - - UriTemplateConverter.cs - - - UriTemplateExtensions.cs - - - UriTemplateTable.cs - - - VarSpec.cs - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file diff --git a/src/UriTemplatesPCL/project.json b/src/UriTemplatesPCL/project.json deleted file mode 100644 index 80d7588..0000000 --- a/src/UriTemplatesPCL/project.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "supports": {}, - "dependencies": { - "NETStandard.Library": "1.6.0", - "Microsoft.NETCore.Portable.Compatibility": "1.0.1", - "System.ComponentModel.TypeConverter": "4.3.0" - }, - "frameworks": { - "netstandard1.0": {} - } -} \ No newline at end of file diff --git a/src/UriTemplatesPCLTests/Properties/AssemblyInfo.cs b/src/UriTemplatesPCLTests/Properties/AssemblyInfo.cs deleted file mode 100644 index 39caac5..0000000 --- a/src/UriTemplatesPCLTests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("UriTemplatesPCLTests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("UriTemplatesPCLTests")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("168d142f-7cdd-4a67-9934-c6c4f9b309b7")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/UriTemplatesPCLTests/UriTemplatesPCLTests.csproj b/src/UriTemplatesPCLTests/UriTemplatesPCLTests.csproj deleted file mode 100644 index 1f199ae..0000000 --- a/src/UriTemplatesPCLTests/UriTemplatesPCLTests.csproj +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - Debug - AnyCPU - {ADBEFEDC-53B9-4835-A546-EBD3B3F9E939} - Library - Properties - UriTemplateTests - UriTemplatesPCLTests - v4.5 - 512 - ..\..\ - true - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll - True - - - - - - - - - - - ..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll - True - - - ..\..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll - True - - - ..\..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll - True - - - ..\..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll - True - - - - - SpecTests.cs - - - UsageTests.cs - - - - - - extended-tests.json - - - negative-tests.json - - - spec-examples-by-section.json - - - spec-examples.json - - - - - - {f12eb113-49be-4a8e-befb-d04d7c0c2def} - UriTemplatesPCL - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - \ No newline at end of file diff --git a/src/UriTemplatesPCLTests/packages.config b/src/UriTemplatesPCLTests/packages.config deleted file mode 100644 index 9fb1834..0000000 --- a/src/UriTemplatesPCLTests/packages.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/UriTemplateTests/ParameterMatchingTests.cs b/test/UriTemplateTests/ParameterMatchingTests.cs similarity index 98% rename from src/UriTemplateTests/ParameterMatchingTests.cs rename to test/UriTemplateTests/ParameterMatchingTests.cs index 4902db7..9718697 100644 --- a/src/UriTemplateTests/ParameterMatchingTests.cs +++ b/test/UriTemplateTests/ParameterMatchingTests.cs @@ -1,18 +1,12 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Text.RegularExpressions; using Tavis.UriTemplates; using Xunit; -using Xunit.Extensions; namespace UriTemplateTests { public class ParameterMatchingTests { - - [Fact] public void MatchUriToTemplate() { @@ -85,8 +79,8 @@ public void GetParametersFromMultipleQueryString() Assert.Equal("foo", parameters["p1"]); Assert.Equal("bar", parameters["p2"]); Assert.Equal("45", parameters["blur"]); - } + [Fact] public void GetParametersFromMultipleQueryStringWithTwoParamValues() { @@ -101,7 +95,6 @@ public void GetParametersFromMultipleQueryStringWithTwoParamValues() Assert.Equal("bar", parameters["p2"]); Assert.Equal("45", parameters["blur"]); Assert.Equal("23", parameters["blob"]); - } [Fact] @@ -115,7 +108,6 @@ public void GetParameterFromArrayParameter() Assert.Equal(1, parameters.Count); Assert.Equal("45,23", parameters["blur"]); - } [Fact] @@ -132,7 +124,6 @@ public void GetParametersFromMultipleQueryStringWithOptionalAndMandatoryParamete Assert.Equal("bar", parameters["p2"]); Assert.Equal("45", parameters["blur"]); Assert.Equal("23", parameters["blob"]); - } [Fact] @@ -146,10 +137,8 @@ public void GetParametersFromMultipleQueryStringWithOptionalParameters() Assert.Equal("foo", parameters["p1"]); Assert.Equal("bar", parameters["p2"]); - } - [Fact] public void TestGlimpseUrl() { @@ -163,22 +152,17 @@ public void TestGlimpseUrl() Assert.Equal("123232323", parameters["parentRequestId"]); Assert.Equal("23ADE34FAE", parameters["hash"]); Assert.Equal("http://example.com/callback", parameters["callback"]); - } [Fact] public void TestUrlWithQuestionMarkAsFirstCharacter() { - var parameters = new UriTemplate("?hash={hash}").GetParameters(new Uri("http://localhost:5000/glimpse/metadata?hash=123"));; Assert.Equal(1, parameters.Count); Assert.Equal("123", parameters["hash"]); - } - - [Fact] public void TestExactParameterCount() { @@ -189,7 +173,6 @@ public void TestExactParameterCount() var parameters = template.GetParameters(uri); Assert.Equal(1, parameters.Count); - } [Fact] @@ -202,13 +185,9 @@ public void SimplePerfTest() for (int i = 0; i < 100000; i++) { var parameters = template.GetParameters(uri); - } - - } - [Fact] public void Level1Decode() { @@ -219,10 +198,8 @@ public void Level1Decode() var parameters = template.GetParameters(uri); Assert.Equal("Hello World", parameters["p1"]); - } - //[Fact] //public void Level2Decode() //{ @@ -233,7 +210,6 @@ public void Level1Decode() // var parameters = template.GetParameters(uri); // Assert.Equal("Hello/World", parameters["p1"]); - //} [Fact] @@ -246,10 +222,8 @@ public void FragmentParam() var parameters = template.GetParameters(uri); Assert.Equal("Hello World!", parameters["p1"]); - } - [Fact] public void FragmentParams() { @@ -261,7 +235,6 @@ public void FragmentParams() Assert.Equal("Hello World!", parameters["p1"]); Assert.Equal("blurg", parameters["p2"]); - } [Fact] @@ -274,7 +247,6 @@ public void OptionalPathParam() var parameters = template.GetParameters(uri); Assert.Equal("yuck", parameters["bar"]); - } [Fact] @@ -289,7 +261,5 @@ public void OptionalPathParamWithMultipleValues() Assert.Equal("yuck", parameters["bar"]); Assert.Equal("yob", parameters["baz"]); } - - } } diff --git a/src/UriTemplateTests/SpecTests.cs b/test/UriTemplateTests/SpecTests.cs similarity index 83% rename from src/UriTemplateTests/SpecTests.cs rename to test/UriTemplateTests/SpecTests.cs index 3e49667..0ce9639 100644 --- a/src/UriTemplateTests/SpecTests.cs +++ b/test/UriTemplateTests/SpecTests.cs @@ -1,18 +1,17 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using Newtonsoft.Json.Linq; using Tavis.UriTemplates; using Xunit; -using Xunit.Extensions; namespace UriTemplateTests { public class UriTemplateTests2 { - - [Theory, MemberData("SpecSamples")] + [Theory, MemberData(nameof(SpecSamples))] public void SpecSamplesTest(string template, string[] results, TestSet.TestCase testCase) { var uriTemplate = new UriTemplate(template); @@ -25,11 +24,10 @@ public void SpecSamplesTest(string template, string[] results, TestSet.TestCase string result = null; result = uriTemplate.Resolve(); - Assert.True(results.Contains(result)); + Assert.Contains(result, results); } - - [Theory, MemberData("ExtendedSamples")] + [Theory, MemberData(nameof(ExtendedSamples))] public void ExtendedSamplesTest(string template, string[] results, TestSet.TestCase testCase) { var uriTemplate = new UriTemplate(template); @@ -45,7 +43,6 @@ public void ExtendedSamplesTest(string template, string[] results, TestSet.TestC try { result = uriTemplate.Resolve(); - } catch (ArgumentException ex) { @@ -58,13 +55,11 @@ public void ExtendedSamplesTest(string template, string[] results, TestSet.TestC } else { - Assert.True(results.Contains(result)); + Assert.Contains(result, results); } - } - - // Disabled for the moment. [Theory, PropertyData("FailureSamples")] + [Theory(Skip = "Disabled for the moment"), MemberData(nameof(FailureSamples))] public void FailureSamplesTest(string template, string[] results, TestSet.TestCase testCase) { var uriTemplate = new UriTemplate(template); @@ -80,7 +75,6 @@ public void FailureSamplesTest(string template, string[] results, TestSet.TestCa try { result = uriTemplate.Resolve(); - } catch (ArgumentException ex) { @@ -88,11 +82,8 @@ public void FailureSamplesTest(string template, string[] results, TestSet.TestCa } Assert.NotNull(aex); - - } - public static IEnumerable SpecSamples { get @@ -108,25 +99,19 @@ public static IEnumerable SpecSamples stream = typeof(UriTemplateTests2).Assembly.GetManifestResourceStream("UriTemplateTests.spec-examples-by-section.json"); suites.Add(CreateTestSuite(new StreamReader(stream).ReadToEnd())); - foreach (var suite in suites) { - foreach (var testset in suite.Values) { foreach (var testCase in testset.TestCases) { yield return new object[] { testCase.Template, testCase.Result, testCase }; - } } - } - } } - public static IEnumerable ExtendedSamples { get @@ -141,18 +126,14 @@ public static IEnumerable ExtendedSamples foreach (var suite in suites) { - foreach (var testset in suite.Values) { foreach (var testCase in testset.TestCases) { yield return new object[] { testCase.Template, testCase.Result, testCase }; - } } - } - } } @@ -169,25 +150,19 @@ public static IEnumerable FailureSamples typeof(UriTemplateTests2).Assembly.GetManifestResourceStream("UriTemplateTests.negative-tests.json"); suites.Add(CreateTestSuite(new StreamReader(stream).ReadToEnd())); - foreach (var suite in suites) { - foreach (var testset in suite.Values) { foreach (var testCase in testset.TestCases) { yield return new object[] { testCase.Template, testCase.Result, testCase }; - } } - } - } } - private static Dictionary CreateTestSuite(string json) { JObject token = JObject.Parse(json); @@ -196,7 +171,6 @@ private static Dictionary CreateTestSuite(string json) foreach (JProperty levelSet in token.Children()) { testSuite.Add(levelSet.Name, CreateTestSet(levelSet.Name, levelSet.Value)); - } return testSuite; } @@ -225,39 +199,42 @@ private static TestSet CreateTestSet(string name, JToken token) private static void ParseVariable(JProperty variable, Dictionary dictionary) { - if (variable.Value.Type == JTokenType.Array) + using (new WithCultureInfo(CultureInfo.InvariantCulture)) { - var array = (JArray)variable.Value; - if (array.Count == 0) + if (variable.Value.Type == JTokenType.Array) { - dictionary.Add(variable.Name, new List()); - } - else - { - dictionary.Add(variable.Name, array.Values()); - } - } - else if (variable.Value.Type == JTokenType.Object) - { - var jvalue = (JObject)variable.Value; - var dict = new Dictionary(); - foreach (var prop in jvalue.Properties()) - { - dict[prop.Name] = prop.Value.ToString(); + var array = (JArray) variable.Value; + if (array.Count == 0) + { + dictionary.Add(variable.Name, new List()); + } + else + { + dictionary.Add(variable.Name, array.Values()); + } } - dictionary.Add(variable.Name, dict); - } - else - { - if (((JValue)variable.Value).Value == null) + else if (variable.Value.Type == JTokenType.Object) { - dictionary.Add(variable.Name, null); + var jvalue = (JObject) variable.Value; + var dict = new Dictionary(); + foreach (var prop in jvalue.Properties()) + { + dict[prop.Name] = prop.Value.ToString(); + } + + dictionary.Add(variable.Name, dict); } else { - dictionary.Add(variable.Name, variable.Value.ToString()); + if (((JValue) variable.Value).Value == null) + { + dictionary.Add(variable.Name, null); + } + else + { + dictionary.Add(variable.Name, variable.Value.ToString()); + } } - } } @@ -304,11 +281,6 @@ public TestSet TestSet public string Template { get; set; } public string[] Result { get; set; } } - - } - - - } } diff --git a/src/UriTemplateTests/UriExtensionTests.cs b/test/UriTemplateTests/UriExtensionTests.cs similarity index 99% rename from src/UriTemplateTests/UriExtensionTests.cs rename to test/UriTemplateTests/UriExtensionTests.cs index 27f994d..dddcaa2 100644 --- a/src/UriTemplateTests/UriExtensionTests.cs +++ b/test/UriTemplateTests/UriExtensionTests.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using Tavis.UriTemplates; using Xunit; @@ -47,13 +46,11 @@ public void Remove_an_existing_parameter() [Fact] public void Remove_a_query_parameters2() { - var target = new Uri("http://example.org/customer?format=xml&id=23"); var template = target.MakeTemplate(); template.ClearParameter("format"); - Assert.Equal("http://example.org/customer?id=23", template.Resolve()); } @@ -76,7 +73,6 @@ public void Add_parameters_to_uri_with_query_string_ignoring_path_parameter() { var target = new Uri("http://example/customer/{id}?view=true"); - var template = target.MakeTemplate(target.GetQueryStringParameters() .Union(new Dictionary {{"context", "detail"}}) .ToDictionary(k=> k.Key, v=> v.Value)); diff --git a/src/UriTemplateTests/UriTemplateConverterTests.cs b/test/UriTemplateTests/UriTemplateConverterTests.cs similarity index 100% rename from src/UriTemplateTests/UriTemplateConverterTests.cs rename to test/UriTemplateTests/UriTemplateConverterTests.cs diff --git a/src/UriTemplateTests/UriTemplateExtensionsTests.cs b/test/UriTemplateTests/UriTemplateExtensionsTests.cs similarity index 98% rename from src/UriTemplateTests/UriTemplateExtensionsTests.cs rename to test/UriTemplateTests/UriTemplateExtensionsTests.cs index 2ebdb85..57ba2e0 100644 --- a/src/UriTemplateTests/UriTemplateExtensionsTests.cs +++ b/test/UriTemplateTests/UriTemplateExtensionsTests.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Tavis; +using System.Collections.Generic; using Tavis.UriTemplates; using Xunit; @@ -20,7 +16,6 @@ public void UpdatePathParameter() Assert.Equal("http://example.org/acm%C3%A9/customers", url); } - [Fact] public void QueryParametersTheOldWay() { @@ -44,7 +39,6 @@ public void QueryParametersTheNewWay() [Fact] public void QueryParametersTheNewWayWithoutValue() { - var url = new UriTemplate("http://example.org/customers{?active}") .AddParameters(null) .Resolve(); @@ -62,7 +56,6 @@ public void ShouldResolveUriTemplateWithNonStringParameter() Assert.Equal("http://example.org/location?lat=31.464&lng=74.386", url); } - [Fact] public void ParametersFromAnObject() { @@ -184,7 +177,6 @@ public void ApplyFoldersToPath() [Fact] public void ParametersFromAnObjectFromInvalidUrl() { - var url = new UriTemplate("http://{environment}.example.org/{version}/customers{?active,country}") .AddParameters(new { @@ -198,11 +190,9 @@ public void ParametersFromAnObjectFromInvalidUrl() Assert.Equal("http://dev.example.org/v2/customers?active=true&country=CA", url); } - [Fact] public void ApplyFoldersToPathFromStringNotUrl() { - var url = new UriTemplate("http://example.org{/folders*}{?filename}") .AddParameters(new { @@ -214,11 +204,9 @@ public void ApplyFoldersToPathFromStringNotUrl() Assert.Equal("http://example.org/files/customer/project?filename=proposal.pdf", url); } - [Fact] public void ReplaceBaseAddress() { - var url = new UriTemplate("{+baseUrl}api/customer/{id}") .AddParameters(new { @@ -233,7 +221,6 @@ public void ReplaceBaseAddress() [Fact] public void ReplaceBaseAddressButNotId() { - var url = new UriTemplate("{+baseUrl}api/customer/{id}",resolvePartially:true) .AddParameters(new { @@ -247,7 +234,6 @@ public void ReplaceBaseAddressButNotId() [Fact] public void PartiallyParametersFromAnObjectFromInvalidUrl() { - var url = new UriTemplate("http://{environment}.example.org/{version}/customers{?active,country}",resolvePartially:true) .AddParameters(new { @@ -259,11 +245,9 @@ public void PartiallyParametersFromAnObjectFromInvalidUrl() Assert.Equal("http://dev.example.org/v2/customers{?active,country}", url); } - [Fact] public void PartiallyApplyFoldersToPathFromStringNotUrl() { - var url = new UriTemplate("http://example.org{/folders*}{?filename}",true) .AddParameters(new { @@ -277,8 +261,6 @@ public void PartiallyApplyFoldersToPathFromStringNotUrl() [Fact] public void UseArbitraryClassAsParameter() { - - var url = new UriTemplate("/{test}", true) .AddParameters(new { @@ -289,7 +271,6 @@ public void UseArbitraryClassAsParameter() Assert.Equal("/something", url); } - [Fact] public void AddMultipleParametersToLink() { diff --git a/src/UriTemplateTests/UriTemplateTableTests.cs b/test/UriTemplateTests/UriTemplateTableTests.cs similarity index 97% rename from src/UriTemplateTests/UriTemplateTableTests.cs rename to test/UriTemplateTests/UriTemplateTableTests.cs index e661205..9d92bd2 100644 --- a/src/UriTemplateTests/UriTemplateTableTests.cs +++ b/test/UriTemplateTests/UriTemplateTableTests.cs @@ -1,20 +1,11 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using Tavis.UriTemplates; using Xunit; - namespace UriTemplateTests { public class UriTemplateTableTests { - - - - - [Theory, InlineData("/","root"), InlineData("/baz/fod/burg",""), @@ -32,7 +23,6 @@ public void FindPathTemplates(string url, string key) table.Add("blob", new UriTemplate("/baz/{bar}/blob")); table.Add("goo", new UriTemplate("/{goo}/{bar}/blob")); - var result = table.Match(new Uri(url, UriKind.RelativeOrAbsolute)); if (string.IsNullOrEmpty(key)) @@ -64,7 +54,6 @@ public void FindTemplatesInGamesApi(string url, string key) table.Add("chat", new UriTemplate("/games/{gametitle}/{gameid}/Chat/{chatid}")); table.Add("state", new UriTemplate("/games/{gametitle}/{gameid}/State/{stateid}")); - var result = table.Match(new Uri(url, UriKind.RelativeOrAbsolute)); if (string.IsNullOrEmpty(key)) @@ -77,7 +66,6 @@ public void FindTemplatesInGamesApi(string url, string key) } } - [Theory, InlineData("/foo?x=1&y=2", "fooxy3"), InlineData("/foo?x=1", "fooxy2"), @@ -95,7 +83,6 @@ public void FindTemplatesWithQueryStrings(string url, string key) table.Add("fooxy", new UriTemplate("/foo{?x,y}")); table.Add("foo", new UriTemplate("/foo")); - var result = table.Match(new Uri(url, UriKind.RelativeOrAbsolute)); if (string.IsNullOrEmpty(key)) @@ -118,14 +105,11 @@ public void FindTemplatesWithArrayQueryParameters() table.Add("fooxy", new UriTemplate("/foo{?x,y}")); table.Add("foo", new UriTemplate("/foo")); - var result = table.Match(new Uri("/foo?x=a,b,c,d", UriKind.RelativeOrAbsolute)); Assert.Equal("fooxy2", result.Key); - } - [Fact] public void MatchTemplateWithDifferentOrderOfParameters() { @@ -135,12 +119,6 @@ public void MatchTemplateWithDifferentOrderOfParameters() var result = table.Match(new Uri("/foo?y=a&x=b", UriKind.RelativeOrAbsolute)); Assert.Equal("fooxy3", result.Key); - } - } - } - - - diff --git a/test/UriTemplateTests/UriTemplateTests.csproj b/test/UriTemplateTests/UriTemplateTests.csproj new file mode 100644 index 0000000..18b9d2e --- /dev/null +++ b/test/UriTemplateTests/UriTemplateTests.csproj @@ -0,0 +1,33 @@ + + + + netcoreapp2.1 + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/UriTemplateTests/UsageTests.cs b/test/UriTemplateTests/UsageTests.cs similarity index 98% rename from src/UriTemplateTests/UsageTests.cs rename to test/UriTemplateTests/UsageTests.cs index 42e1f92..759a833 100644 --- a/src/UriTemplateTests/UsageTests.cs +++ b/test/UriTemplateTests/UsageTests.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Net.Http; -using System.Text; using Tavis.UriTemplates; using Xunit; @@ -16,9 +14,7 @@ public void TestHexEscape() for (int i = 20; i < 128; i++) { Assert.Equal(Uri.HexEscape((char)i), Result.HexEscape((char)i)); } - } - [Fact] public void ShouldAllowUriTemplateWithPathSegmentParameter() @@ -29,7 +25,6 @@ public void ShouldAllowUriTemplateWithPathSegmentParameter() Assert.Equal("http://example.org/foo/yo/baz", uriString); } - [Fact] public void ShouldAllowUriTemplateWithMultiplePathSegmentParameter() { @@ -55,7 +50,6 @@ public void ShouldResolveUriTemplateWithNonStringParameter() Assert.Equal("http://example.org/foo/yo/baz?lat=31.464&lng=74.386", uriString); } - [Fact] public void ShouldResolveMatrixParameter() { @@ -70,7 +64,6 @@ public void ShouldResolveMatrixParameter() Assert.Equal("http://example.org/foo;lat=31.464;lng=74.386", uriString); } - [Fact] public void ShouldAllowUriTemplateWithQueryParamsButNoValues() { @@ -103,7 +96,6 @@ public void ShouldAllowUriTemplateToRemoveParameter() Assert.Equal("http://example.org/foo?baz=yuck", uriString); } - [Fact] public void ShouldAllowUriTemplateWithQueryParamsWithOneValue() { @@ -114,7 +106,6 @@ public void ShouldAllowUriTemplateWithQueryParamsWithOneValue() Assert.Equal("http://example.org/foo?baz=yo", uriString); } - [Fact] public void LabelExpansionWithDotPrefixAndEmptyKeys() { @@ -148,7 +139,6 @@ public void ShouldAllowListAndSingleValueInQueryParam() Assert.Equal("http://example.org/person/albums?fields=id,name,picture&token=12345", uriString); } - [Fact] public void ShouldHandleUriEncoding() { @@ -167,7 +157,6 @@ public void ShouldHandleEncodingAParametersThatIsAUriWithAUriAsAParameter() Assert.Equal("http://example.org/go?uri=http%3A%2F%2Fexample.org%2F%3Furi%3Dhttp%253A%252F%252Fexample.org%252F", uriString); } - [Fact] public void ShouldThrowWhenExpressionIsNotClosed() { @@ -179,12 +168,10 @@ public void ShouldThrowWhenExpressionIsNotClosed() } catch (ArgumentException ex) { - result = ex.Message; } Assert.Equal("Malformed template, missing } : http://example.org/foo/{bar/baz/", result); - } [Fact] @@ -198,12 +185,10 @@ public void ShouldThrowWhenTemplateExpressionIsEmpty() } catch (ArgumentException ex) { - result = ex.Message; } Assert.Equal("Malformed template : http://example.org/foo/{}/baz/", result); - } [Fact] @@ -253,7 +238,6 @@ public void ResolveOptionalAndRequiredQueryParameters() Assert.Equal("https://api.github.com/search/code?q=1234&per_page=19", result); } - [Fact] public void ReservedCharacterExpansion() { @@ -263,10 +247,9 @@ public void ReservedCharacterExpansion() var result = template.Resolve(); Assert.Equal("https://foo.com/?format=application%2Fvnd.foo%2Bxml",result); - } - //[Fact] Unit tests should not require internet access!! + [Fact(Skip = "Unit tests should not require internet access!!")] public void PreserveReservedCharacterExpansion() { UriTemplate template = new UriTemplate("https://foo.com/?format={+format}"); @@ -279,7 +262,6 @@ public void PreserveReservedCharacterExpansion() var httpClient = new HttpClient(); var response = httpClient.GetAsync("http://yahoo.com/foo%2Fbar").Result; - } [Fact] @@ -290,10 +272,9 @@ public void ShouldSupportUnicodeCharacters() var result = template.Resolve(); - Assert.Equal("/lookup?Stra%C3%9Fe=Gr%C3%BCner%20Weg", result); - } + // "assoc_special_chars" : { "šö䟜ñꀣ¥‡ÑÒÓÔÕ" : "Ö×ØÙÚàáâãäåæçÿ" } [Fact] public void ShouldSupportUnicodeCharacters2() @@ -307,29 +288,23 @@ public void ShouldSupportUnicodeCharacters2() var result = template.Resolve(); - Assert.Equal("?%C5%A1%C3%B6%C3%A4%C5%B8%C5%93%C3%B1%C3%AA%E2%82%AC%C2%A3%C2%A5%E2%80%A1%C3%91%C3%92%C3%93%C3%94%C3%95=%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%BF", result); - } [Fact] public void Remove_a_query_parameters2() { - var target = new Uri("http://example.org/customer?format=xml&id=23"); var template = target.MakeTemplate(); template.ClearParameter("format"); - Assert.Equal("http://example.org/customer?id=23", template.Resolve()); } - [Fact] public void EncodingTest1() { - var url = new UriTemplate("/1/search/auto/{folder}{?query}") .AddParameter("folder","My Documents") .AddParameter("query", "draft 2013") @@ -341,7 +316,6 @@ public void EncodingTest1() [Fact] public void EncodingTest2() { - // Parameter values get encoded but hyphen doesn't need to be encoded because it // is an "unreserved" character according to RFC 3986 var url = new UriTemplate("{/greeting}") @@ -363,19 +337,15 @@ public void EncodingTest2() .Resolve(); Assert.Equal("/hello/world", url3); - } // /docs/salary.csv?columns=1,2 // /docs/salary.csv?column=1&column=2 - // /emails?from[name]=Don&from[date]=1998-03-24&to[name]=Norm - // : /log?a=b&c=4 [Fact] public void EncodingTest3() { - // There are different ways that lists can be included in query params // Just as a comma delimited list var url = new UriTemplate("/docs/salary.csv{?columns}") @@ -419,7 +389,6 @@ public void EncodingTest5() Assert.Equal("/log?a=b&c=4", url); } - [Fact] public void InvalidSpace() { @@ -433,7 +402,5 @@ public void InvalidSpace() } Assert.NotNull(ex); } - - } -} \ No newline at end of file +} diff --git a/test/UriTemplateTests/appsettings.json b/test/UriTemplateTests/appsettings.json new file mode 100644 index 0000000..c00981d --- /dev/null +++ b/test/UriTemplateTests/appsettings.json @@ -0,0 +1,10 @@ +{ + "uri": { + "idn": { + "enabled": "All" + }, + "iriParsing": { + "enabled": true + } + } +} diff --git a/test/UriTemplateTests/extended-tests.json b/test/UriTemplateTests/extended-tests.json new file mode 100644 index 0000000..fd69744 --- /dev/null +++ b/test/UriTemplateTests/extended-tests.json @@ -0,0 +1,118 @@ +{ + "Additional Examples 1":{ + "level":4, + "variables":{ + "id" : "person", + "token" : "12345", + "fields" : ["id", "name", "picture"], + "format" : "json", + "q" : "URI Templates", + "page" : "5", + "lang" : "en", + "geocode" : ["37.76","-122.427"], + "first_name" : "John", + "last.name" : "Doe", + "Some%20Thing" : "foo", + "number" : 6, + "long" : 37.76, + "lat" : -122.427, + "group_id" : "12345", + "query" : "PREFIX dc: SELECT ?book ?who WHERE { ?book dc:creator ?who }", + "uri" : "http://example.org/?uri=http%3A%2F%2Fexample.org%2F", + "word" : "drücken", + "Stra%C3%9Fe" : "Grüner Weg", + "random" : "šö䟜ñꀣ¥‡ÑÒÓÔÕÖ×ØÙÚàáâãäåæçÿ", + "assoc_special_chars" : + { "šö䟜ñꀣ¥‡ÑÒÓÔÕ" : "Ö×ØÙÚàáâãäåæçÿ" } + }, + "testcases":[ + + [ "{/id*}" , "/person" ], + [ "{/id*}{?fields,first_name,last.name,token}" , [ + "/person?fields=id,name,picture&first_name=John&last.name=Doe&token=12345", + "/person?fields=id,picture,name&first_name=John&last.name=Doe&token=12345", + "/person?fields=picture,name,id&first_name=John&last.name=Doe&token=12345", + "/person?fields=picture,id,name&first_name=John&last.name=Doe&token=12345", + "/person?fields=name,picture,id&first_name=John&last.name=Doe&token=12345", + "/person?fields=name,id,picture&first_name=John&last.name=Doe&token=12345"] + ], + ["/search.{format}{?q,geocode,lang,locale,page,result_type}", + [ "/search.json?q=URI%20Templates&geocode=37.76,-122.427&lang=en&page=5", + "/search.json?q=URI%20Templates&geocode=-122.427,37.76&lang=en&page=5"] + ], + ["/test{/Some%20Thing}", "/test/foo" ], + ["/set{?number}", "/set?number=6"], + ["/loc{?long,lat}" , "/loc?long=37.76&lat=-122.427"], + ["/base{/group_id,first_name}/pages{/page,lang}{?format,q}","/base/12345/John/pages/5/en?format=json&q=URI%20Templates"], + ["/sparql{?query}", "/sparql?query=PREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E%20SELECT%20%3Fbook%20%3Fwho%20WHERE%20%7B%20%3Fbook%20dc%3Acreator%20%3Fwho%20%7D"], + ["/go{?uri}", "/go?uri=http%3A%2F%2Fexample.org%2F%3Furi%3Dhttp%253A%252F%252Fexample.org%252F"], + ["/service{?word}", "/service?word=dr%C3%BCcken"], + ["/lookup{?Stra%C3%9Fe}", "/lookup?Stra%C3%9Fe=Gr%C3%BCner%20Weg"], + ["{random}" , "%C5%A1%C3%B6%C3%A4%C5%B8%C5%93%C3%B1%C3%AA%E2%82%AC%C2%A3%C2%A5%E2%80%A1%C3%91%C3%92%C3%93%C3%94%C3%95%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%BF"], + ["{?assoc_special_chars*}", "?%C5%A1%C3%B6%C3%A4%C5%B8%C5%93%C3%B1%C3%AA%E2%82%AC%C2%A3%C2%A5%E2%80%A1%C3%91%C3%92%C3%93%C3%94%C3%95=%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%BF"] + ] + }, + "Additional Examples 2":{ + "level":4, + "variables":{ + "id" : ["person","albums"], + "token" : "12345", + "fields" : ["id", "name", "picture"], + "format" : "atom", + "q" : "URI Templates", + "page" : "10", + "start" : "5", + "lang" : "en", + "geocode" : ["37.76","-122.427"] + }, + "testcases":[ + + [ "{/id*}" , ["/person/albums","/albums/person"] ], + [ "{/id*}{?fields,token}" , [ + "/person/albums?fields=id,name,picture&token=12345", + "/person/albums?fields=id,picture,name&token=12345", + "/person/albums?fields=picture,name,id&token=12345", + "/person/albums?fields=picture,id,name&token=12345", + "/person/albums?fields=name,picture,id&token=12345", + "/person/albums?fields=name,id,picture&token=12345", + "/albums/person?fields=id,name,picture&token=12345", + "/albums/person?fields=id,picture,name&token=12345", + "/albums/person?fields=picture,name,id&token=12345", + "/albums/person?fields=picture,id,name&token=12345", + "/albums/person?fields=name,picture,id&token=12345", + "/albums/person?fields=name,id,picture&token=12345"] + ] + ] + }, + "Additional Examples 3: Empty Variables":{ + "variables" : { + "empty_list" : [], + "empty_assoc" : {} + }, + "testcases":[ + [ "{/empty_list}", [ "" ] ], + [ "{/empty_list*}", [ "" ] ], + [ "{?empty_list}", [ ""] ], + [ "{?empty_list*}", [ "" ] ], + [ "{?empty_assoc}", [ "" ] ], + [ "{?empty_assoc*}", [ "" ] ] + ] + }, + "Additional Examples 4: Numeric Keys":{ + "variables" : { + "42" : "The Answer to the Ultimate Question of Life, the Universe, and Everything", + "1337" : ["leet", "as","it", "can","be"], + "german" : { + "11": "elf", + "12": "zwölf" + } + }, + "testcases":[ + [ "{42}", "The%20Answer%20to%20the%20Ultimate%20Question%20of%20Life%2C%20the%20Universe%2C%20and%20Everything"], + [ "{?42}", "?42=The%20Answer%20to%20the%20Ultimate%20Question%20of%20Life%2C%20the%20Universe%2C%20and%20Everything"], + [ "{1337}", "leet,as,it,can,be"], + [ "{?1337*}", "?1337=leet&1337=as&1337=it&1337=can&1337=be"], + [ "{?german*}", [ "?11=elf&12=zw%C3%B6lf", "?12=zw%C3%B6lf&11=elf"] ] + ] + } +} diff --git a/test/UriTemplateTests/negative-tests.json b/test/UriTemplateTests/negative-tests.json new file mode 100644 index 0000000..552a6bf --- /dev/null +++ b/test/UriTemplateTests/negative-tests.json @@ -0,0 +1,57 @@ +{ + "Failure Tests":{ + "level":4, + "variables":{ + "id" : "thing", + "var" : "value", + "hello" : "Hello World!", + "with space" : "fail", + " leading_space" : "Hi!", + "trailing_space " : "Bye!", + "empty" : "", + "path" : "/foo/bar", + "x" : "1024", + "y" : "768", + "list" : ["red", "green", "blue"], + "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, + "example" : "red", + "searchTerms" : "uri templates", + "~thing" : "some-user", + "default-graph-uri" : ["http://www.example/book/","http://www.example/papers/"], + "query" : "PREFIX dc: SELECT ?book ?who WHERE { ?book dc:creator ?who }" + + }, + "testcases":[ + [ "{/id*", false ], + [ "/id*}", false ], + [ "{/?id}", false ], + [ "{var:prefix}", false ], + [ "{hello:2*}", false ] , + [ "{??hello}", false ] , + [ "{!hello}", false ] , + [ "{with space}", false], + [ "{ leading_space}", false], + [ "{trailing_space }", false], + [ "{=path}", false ] , + [ "{$var}", false ], + [ "{|var*}", false ], + [ "{*keys?}", false ], + [ "{?empty=default,var}", false ], + [ "{var}{-prefix|/-/|var}" , false ], + [ "?q={searchTerms}&c={example:color?}" , false ], + [ "x{?empty|foo=none}" , false ], + [ "/h{#hello+}" , false ], + [ "/h#{hello+}" , false ], + [ "{keys:1}", false ], + [ "{+keys:1}", false ], + [ "{;keys:1*}", false ], + [ "?{-join|&|var,list}" , false ], + [ "/people/{~thing}", false], + [ "/{default-graph-uri}", false ], + [ "/sparql{?query,default-graph-uri}", false ], + [ "/sparql{?query){&default-graph-uri*}", false ], + [ "/resolution{?x, y}" , false ] + + ] + } +} \ No newline at end of file diff --git a/test/UriTemplateTests/spec-examples-by-section.json b/test/UriTemplateTests/spec-examples-by-section.json new file mode 100644 index 0000000..5aef182 --- /dev/null +++ b/test/UriTemplateTests/spec-examples-by-section.json @@ -0,0 +1,439 @@ +{ + "3.2.1 Variable Expansion" : + { + "variables": { + "count" : ["one", "two", "three"], + "dom" : ["example", "com"], + "dub" : "me/too", + "hello" : "Hello World!", + "half" : "50%", + "var" : "value", + "who" : "fred", + "base" : "http://example.com/home/", + "path" : "/foo/bar", + "list" : ["red", "green", "blue"], + "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, + "v" : "6", + "x" : "1024", + "y" : "768", + "empty" : "", + "empty_keys" : [], + "undef" : null + }, + "testcases" : [ + ["{count}", "one,two,three"], + ["{count*}", "one,two,three"], + ["{/count}", "/one,two,three"], + ["{/count*}", "/one/two/three"], + ["{;count}", ";count=one,two,three"], + ["{;count*}", ";count=one;count=two;count=three"], + ["{?count}", "?count=one,two,three"], + ["{?count*}", "?count=one&count=two&count=three"], + ["{&count*}", "&count=one&count=two&count=three"] + ] + }, + "3.2.2 Simple String Expansion" : + { + "variables": { + "count" : ["one", "two", "three"], + "dom" : ["example", "com"], + "dub" : "me/too", + "hello" : "Hello World!", + "half" : "50%", + "var" : "value", + "who" : "fred", + "base" : "http://example.com/home/", + "path" : "/foo/bar", + "list" : ["red", "green", "blue"], + "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, + "v" : "6", + "x" : "1024", + "y" : "768", + "empty" : "", + "empty_keys" : [], + "undef" : null + }, + "testcases" : [ + ["{var}", "value"], + ["{hello}", "Hello%20World%21"], + ["{half}", "50%25"], + ["O{empty}X", "OX"], + ["O{undef}X", "OX"], + ["{x,y}", "1024,768"], + ["{x,hello,y}", "1024,Hello%20World%21,768"], + ["?{x,empty}", "?1024,"], + ["?{x,undef}", "?1024"], + ["?{undef,y}", "?768"], + ["{var:3}", "val"], + ["{var:30}", "value"], + ["{list}", "red,green,blue"], + ["{list*}", "red,green,blue"], + ["{keys}", [ + "comma,%2C,dot,.,semi,%3B", + "comma,%2C,semi,%3B,dot,.", + "dot,.,comma,%2C,semi,%3B", + "dot,.,semi,%3B,comma,%2C", + "semi,%3B,comma,%2C,dot,.", + "semi,%3B,dot,.,comma,%2C" + ]], + ["{keys*}", [ + "comma=%2C,dot=.,semi=%3B", + "comma=%2C,semi=%3B,dot=.", + "dot=.,comma=%2C,semi=%3B", + "dot=.,semi=%3B,comma=%2C", + "semi=%3B,comma=%2C,dot=.", + "semi=%3B,dot=.,comma=%2C" + ]] + ] + }, + "3.2.3 Reserved Expansion" : + { + "variables": { + "count" : ["one", "two", "three"], + "dom" : ["example", "com"], + "dub" : "me/too", + "hello" : "Hello World!", + "half" : "50%", + "var" : "value", + "who" : "fred", + "base" : "http://example.com/home/", + "path" : "/foo/bar", + "list" : ["red", "green", "blue"], + "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, + "v" : "6", + "x" : "1024", + "y" : "768", + "empty" : "", + "empty_keys" : [], + "undef" : null + }, + "testcases" : [ + ["{+var}", "value"], + ["{/var,empty}", "/value/"], + ["{/var,undef}", "/value"], + ["{+hello}", "Hello%20World!"], + ["{+half}", "50%25"], + ["{base}index", "http%3A%2F%2Fexample.com%2Fhome%2Findex"], + ["{+base}index", "http://example.com/home/index"], + ["O{+empty}X", "OX"], + ["O{+undef}X", "OX"], + ["{+path}/here", "/foo/bar/here"], + ["{+path:6}/here", "/foo/b/here"], + ["here?ref={+path}", "here?ref=/foo/bar"], + ["up{+path}{var}/here", "up/foo/barvalue/here"], + ["{+x,hello,y}", "1024,Hello%20World!,768"], + ["{+path,x}/here", "/foo/bar,1024/here"], + ["{+list}", "red,green,blue"], + ["{+list*}", "red,green,blue"], + ["{+keys}", [ + "comma,,,dot,.,semi,;", + "comma,,,semi,;,dot,.", + "dot,.,comma,,,semi,;", + "dot,.,semi,;,comma,,", + "semi,;,comma,,,dot,.", + "semi,;,dot,.,comma,," + ]], + ["{+keys*}", [ + "comma=,,dot=.,semi=;", + "comma=,,semi=;,dot=.", + "dot=.,comma=,,semi=;", + "dot=.,semi=;,comma=,", + "semi=;,comma=,,dot=.", + "semi=;,dot=.,comma=," + ]] + ] + }, + "3.2.4 Fragment Expansion" : + { + "variables": { + "count" : ["one", "two", "three"], + "dom" : ["example", "com"], + "dub" : "me/too", + "hello" : "Hello World!", + "half" : "50%", + "var" : "value", + "who" : "fred", + "base" : "http://example.com/home/", + "path" : "/foo/bar", + "list" : ["red", "green", "blue"], + "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, + "v" : "6", + "x" : "1024", + "y" : "768", + "empty" : "", + "empty_keys" : [], + "undef" : null + }, + "testcases" : [ + ["{#var}", "#value"], + ["{#hello}", "#Hello%20World!"], + ["{#half}", "#50%25"], + ["foo{#empty}", "foo#"], + ["foo{#undef}", "foo"], + ["{#x,hello,y}", "#1024,Hello%20World!,768"], + ["{#path,x}/here", "#/foo/bar,1024/here"], + ["{#path:6}/here", "#/foo/b/here"], + ["{#list}", "#red,green,blue"], + ["{#list*}", "#red,green,blue"], + ["{#keys}", [ + "#comma,,,dot,.,semi,;", + "#comma,,,semi,;,dot,.", + "#dot,.,comma,,,semi,;", + "#dot,.,semi,;,comma,,", + "#semi,;,comma,,,dot,.", + "#semi,;,dot,.,comma,," + ]] + ] + }, + "3.2.5 Label Expansion with Dot-Prefix" : + { + "variables": { + "count" : ["one", "two", "three"], + "dom" : ["example", "com"], + "dub" : "me/too", + "hello" : "Hello World!", + "half" : "50%", + "var" : "value", + "who" : "fred", + "base" : "http://example.com/home/", + "path" : "/foo/bar", + "list" : ["red", "green", "blue"], + "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, + "v" : "6", + "x" : "1024", + "y" : "768", + "empty" : "", + "empty_keys" : [], + "undef" : null + }, + "testcases" : [ + ["{.who}", ".fred"], + ["{.who,who}", ".fred.fred"], + ["{.half,who}", ".50%25.fred"], + ["www{.dom*}", "www.example.com"], + ["X{.var}", "X.value"], + ["X{.var:3}", "X.val"], + ["X{.empty}", "X."], + ["X{.undef}", "X"], + ["X{.list}", "X.red,green,blue"], + ["X{.list*}", "X.red.green.blue"], + ["{#keys}", [ + "#comma,,,dot,.,semi,;", + "#comma,,,semi,;,dot,.", + "#dot,.,comma,,,semi,;", + "#dot,.,semi,;,comma,,", + "#semi,;,comma,,,dot,.", + "#semi,;,dot,.,comma,," + ]], + ["{#keys*}", [ + "#comma=,,dot=.,semi=;", + "#comma=,,semi=;,dot=.", + "#dot=.,comma=,,semi=;", + "#dot=.,semi=;,comma=,", + "#semi=;,comma=,,dot=.", + "#semi=;,dot=.,comma=," + ]], + ["X{.empty_keys}", "X"], + ["X{.empty_keys*}", "X"] + ] + }, + "3.2.6 Path Segment Expansion" : + { + "variables": { + "count" : ["one", "two", "three"], + "dom" : ["example", "com"], + "dub" : "me/too", + "hello" : "Hello World!", + "half" : "50%", + "var" : "value", + "who" : "fred", + "base" : "http://example.com/home/", + "path" : "/foo/bar", + "list" : ["red", "green", "blue"], + "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, + "v" : "6", + "x" : "1024", + "y" : "768", + "empty" : "", + "empty_keys" : [], + "undef" : null + }, + "testcases" : [ + ["{/who}", "/fred"], + ["{/who,who}", "/fred/fred"], + ["{/half,who}", "/50%25/fred"], + ["{/who,dub}", "/fred/me%2Ftoo"], + ["{/var}", "/value"], + ["{/var,empty}", "/value/"], + ["{/var,undef}", "/value"], + ["{/var,x}/here", "/value/1024/here"], + ["{/var:1,var}", "/v/value"], + ["{/list}", "/red,green,blue"], + ["{/list*}", "/red/green/blue"], + ["{/list*,path:4}", "/red/green/blue/%2Ffoo"], + ["{/keys}", [ + "/comma,%2C,dot,.,semi,%3B", + "/comma,%2C,semi,%3B,dot,.", + "/dot,.,comma,%2C,semi,%3B", + "/dot,.,semi,%3B,comma,%2C", + "/semi,%3B,comma,%2C,dot,.", + "/semi,%3B,dot,.,comma,%2C" + ]], + ["{/keys*}", [ + "/comma=%2C/dot=./semi=%3B", + "/comma=%2C/semi=%3B/dot=.", + "/dot=./comma=%2C/semi=%3B", + "/dot=./semi=%3B/comma=%2C", + "/semi=%3B/comma=%2C/dot=.", + "/semi=%3B/dot=./comma=%2C" + ]] + ] + }, + "3.2.7 Path-Style Parameter Expansion" : + { + "variables": { + "count" : ["one", "two", "three"], + "dom" : ["example", "com"], + "dub" : "me/too", + "hello" : "Hello World!", + "half" : "50%", + "var" : "value", + "who" : "fred", + "base" : "http://example.com/home/", + "path" : "/foo/bar", + "list" : ["red", "green", "blue"], + "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, + "v" : "6", + "x" : "1024", + "y" : "768", + "empty" : "", + "empty_keys" : [], + "undef" : null + }, + "testcases" : [ + ["{;who}", ";who=fred"], + ["{;half}", ";half=50%25"], + ["{;empty}", ";empty"], + ["{;hello:5}", ";hello=Hello"], + ["{;v,empty,who}", ";v=6;empty;who=fred"], + ["{;v,bar,who}", ";v=6;who=fred"], + ["{;x,y}", ";x=1024;y=768"], + ["{;x,y,empty}", ";x=1024;y=768;empty"], + ["{;x,y,undef}", ";x=1024;y=768"], + ["{;list}", ";list=red,green,blue"], + ["{;list*}", ";list=red;list=green;list=blue"], + ["{;keys}", [ + ";keys=comma,%2C,dot,.,semi,%3B", + ";keys=comma,%2C,semi,%3B,dot,.", + ";keys=dot,.,comma,%2C,semi,%3B", + ";keys=dot,.,semi,%3B,comma,%2C", + ";keys=semi,%3B,comma,%2C,dot,.", + ";keys=semi,%3B,dot,.,comma,%2C" + ]], + ["{;keys*}", [ + ";comma=%2C;dot=.;semi=%3B", + ";comma=%2C;semi=%3B;dot=.", + ";dot=.;comma=%2C;semi=%3B", + ";dot=.;semi=%3B;comma=%2C", + ";semi=%3B;comma=%2C;dot=.", + ";semi=%3B;dot=.;comma=%2C" + ]] + ] + }, + "3.2.8 Form-Style Query Expansion" : + { + "variables": { + "count" : ["one", "two", "three"], + "dom" : ["example", "com"], + "dub" : "me/too", + "hello" : "Hello World!", + "half" : "50%", + "var" : "value", + "who" : "fred", + "base" : "http://example.com/home/", + "path" : "/foo/bar", + "list" : ["red", "green", "blue"], + "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, + "v" : "6", + "x" : "1024", + "y" : "768", + "empty" : "", + "empty_keys" : [], + "undef" : null + }, + "testcases" : [ + ["{?who}", "?who=fred"], + ["{?half}", "?half=50%25"], + ["{?x,y}", "?x=1024&y=768"], + ["{?x,y,empty}", "?x=1024&y=768&empty="], + ["{?x,y,undef}", "?x=1024&y=768"], + ["{?var:3}", "?var=val"], + ["{?list}", "?list=red,green,blue"], + ["{?list*}", "?list=red&list=green&list=blue"], + ["{?keys}", [ + "?keys=comma,%2C,dot,.,semi,%3B", + "?keys=comma,%2C,semi,%3B,dot,.", + "?keys=dot,.,comma,%2C,semi,%3B", + "?keys=dot,.,semi,%3B,comma,%2C", + "?keys=semi,%3B,comma,%2C,dot,.", + "?keys=semi,%3B,dot,.,comma,%2C" + ]], + ["{?keys*}", [ + "?comma=%2C&dot=.&semi=%3B", + "?comma=%2C&semi=%3B&dot=.", + "?dot=.&comma=%2C&semi=%3B", + "?dot=.&semi=%3B&comma=%2C", + "?semi=%3B&comma=%2C&dot=.", + "?semi=%3B&dot=.&comma=%2C" + ]] + ] + }, + "3.2.9 Form-Style Query Continuation" : + { + "variables": { + "count" : ["one", "two", "three"], + "dom" : ["example", "com"], + "dub" : "me/too", + "hello" : "Hello World!", + "half" : "50%", + "var" : "value", + "who" : "fred", + "base" : "http://example.com/home/", + "path" : "/foo/bar", + "list" : ["red", "green", "blue"], + "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, + "v" : "6", + "x" : "1024", + "y" : "768", + "empty" : "", + "empty_keys" : [], + "undef" : null + }, + "testcases" : [ + ["{&who}", "&who=fred"], + ["{&half}", "&half=50%25"], + ["?fixed=yes{&x}", "?fixed=yes&x=1024"], + ["{&var:3}", "&var=val"], + ["{&x,y,empty}", "&x=1024&y=768&empty="], + ["{&x,y,undef}", "&x=1024&y=768"], + ["{&list}", "&list=red,green,blue"], + ["{&list*}", "&list=red&list=green&list=blue"], + ["{&keys}", [ + "&keys=comma,%2C,dot,.,semi,%3B", + "&keys=comma,%2C,semi,%3B,dot,.", + "&keys=dot,.,comma,%2C,semi,%3B", + "&keys=dot,.,semi,%3B,comma,%2C", + "&keys=semi,%3B,comma,%2C,dot,.", + "&keys=semi,%3B,dot,.,comma,%2C" + ]], + ["{&keys*}", [ + "&comma=%2C&dot=.&semi=%3B", + "&comma=%2C&semi=%3B&dot=.", + "&dot=.&comma=%2C&semi=%3B", + "&dot=.&semi=%3B&comma=%2C", + "&semi=%3B&comma=%2C&dot=.", + "&semi=%3B&dot=.&comma=%2C" + ]] + ] + } +} diff --git a/test/UriTemplateTests/spec-examples.json b/test/UriTemplateTests/spec-examples.json new file mode 100644 index 0000000..2e8e942 --- /dev/null +++ b/test/UriTemplateTests/spec-examples.json @@ -0,0 +1,218 @@ +{ + "Level 1 Examples" : + { + "level": 1, + "variables": { + "var" : "value", + "hello" : "Hello World!" + }, + "testcases" : [ + ["{var}", "value"], + ["{hello}", "Hello%20World%21"] + ] + }, + "Level 2 Examples" : + { + "level": 2, + "variables": { + "var" : "value", + "hello" : "Hello World!", + "path" : "/foo/bar" + }, + "testcases" : [ + ["{+var}", "value"], + ["{+hello}", "Hello%20World!"], + ["{+path}/here", "/foo/bar/here"], + ["here?ref={+path}", "here?ref=/foo/bar"] + ] + }, + "Level 3 Examples" : + { + "level": 3, + "variables": { + "var" : "value", + "hello" : "Hello World!", + "empty" : "", + "path" : "/foo/bar", + "x" : "1024", + "y" : "768" + }, + "testcases" : [ + ["map?{x,y}", "map?1024,768"], + ["{x,hello,y}", "1024,Hello%20World%21,768"], + ["{+x,hello,y}", "1024,Hello%20World!,768"], + ["{+path,x}/here", "/foo/bar,1024/here"], + ["{#x,hello,y}", "#1024,Hello%20World!,768"], + ["{#path,x}/here", "#/foo/bar,1024/here"], + ["X{.var}", "X.value"], + ["X{.x,y}", "X.1024.768"], + ["{/var}", "/value"], + ["{/var,x}/here", "/value/1024/here"], + ["{;x,y}", ";x=1024;y=768"], + ["{;x,y,empty}", ";x=1024;y=768;empty"], + ["{?x,y}", "?x=1024&y=768"], + ["{?x,y,empty}", "?x=1024&y=768&empty="], + ["?fixed=yes{&x}", "?fixed=yes&x=1024"], + ["{&x,y,empty}", "&x=1024&y=768&empty="] + ] + }, + "Level 4 Examples" : + { + "level": 4, + "variables": { + "var": "value", + "hello": "Hello World!", + "path": "/foo/bar", + "list": ["red", "green", "blue"], + "keys": {"semi": ";", "dot": ".", "comma":","} + }, + "testcases": [ + ["{var:3}", "val"], + ["{var:30}", "value"], + ["{list}", "red,green,blue"], + ["{list*}", "red,green,blue"], + ["{keys}", [ + "comma,%2C,dot,.,semi,%3B", + "comma,%2C,semi,%3B,dot,.", + "dot,.,comma,%2C,semi,%3B", + "dot,.,semi,%3B,comma,%2C", + "semi,%3B,comma,%2C,dot,.", + "semi,%3B,dot,.,comma,%2C" + ]], + ["{keys*}", [ + "comma=%2C,dot=.,semi=%3B", + "comma=%2C,semi=%3B,dot=.", + "dot=.,comma=%2C,semi=%3B", + "dot=.,semi=%3B,comma=%2C", + "semi=%3B,comma=%2C,dot=.", + "semi=%3B,dot=.,comma=%2C" + ]], + ["{+path:6}/here", "/foo/b/here"], + ["{+list}", "red,green,blue"], + ["{+list*}", "red,green,blue"], + ["{+keys}", [ + "comma,,,dot,.,semi,;", + "comma,,,semi,;,dot,.", + "dot,.,comma,,,semi,;", + "dot,.,semi,;,comma,,", + "semi,;,comma,,,dot,.", + "semi,;,dot,.,comma,," + ]], + ["{+keys*}", [ + "comma=,,dot=.,semi=;", + "comma=,,semi=;,dot=.", + "dot=.,comma=,,semi=;", + "dot=.,semi=;,comma=,", + "semi=;,comma=,,dot=.", + "semi=;,dot=.,comma=," + ]], + ["{#path:6}/here", "#/foo/b/here"], + ["{#list}", "#red,green,blue"], + ["{#list*}", "#red,green,blue"], + ["{#keys}", [ + "#comma,,,dot,.,semi,;", + "#comma,,,semi,;,dot,.", + "#dot,.,comma,,,semi,;", + "#dot,.,semi,;,comma,,", + "#semi,;,comma,,,dot,.", + "#semi,;,dot,.,comma,," + ]], + ["{#keys*}", [ + "#comma=,,dot=.,semi=;", + "#comma=,,semi=;,dot=.", + "#dot=.,comma=,,semi=;", + "#dot=.,semi=;,comma=,", + "#semi=;,comma=,,dot=.", + "#semi=;,dot=.,comma=," + ]], + ["X{.var:3}", "X.val"], + ["X{.list}", "X.red,green,blue"], + ["X{.list*}", "X.red.green.blue"], + ["X{.keys}", [ + "X.comma,%2C,dot,.,semi,%3B", + "X.comma,%2C,semi,%3B,dot,.", + "X.dot,.,comma,%2C,semi,%3B", + "X.dot,.,semi,%3B,comma,%2C", + "X.semi,%3B,comma,%2C,dot,.", + "X.semi,%3B,dot,.,comma,%2C" + ]], + ["{/var:1,var}", "/v/value"], + ["{/list}", "/red,green,blue"], + ["{/list*}", "/red/green/blue"], + ["{/list*,path:4}", "/red/green/blue/%2Ffoo"], + ["{/keys}", [ + "/comma,%2C,dot,.,semi,%3B", + "/comma,%2C,semi,%3B,dot,.", + "/dot,.,comma,%2C,semi,%3B", + "/dot,.,semi,%3B,comma,%2C", + "/semi,%3B,comma,%2C,dot,.", + "/semi,%3B,dot,.,comma,%2C" + ]], + ["{/keys*}", [ + "/comma=%2C/dot=./semi=%3B", + "/comma=%2C/semi=%3B/dot=.", + "/dot=./comma=%2C/semi=%3B", + "/dot=./semi=%3B/comma=%2C", + "/semi=%3B/comma=%2C/dot=.", + "/semi=%3B/dot=./comma=%2C" + ]], + ["{;hello:5}", ";hello=Hello"], + ["{;list}", ";list=red,green,blue"], + ["{;list*}", ";list=red;list=green;list=blue"], + ["{;keys}", [ + ";keys=comma,%2C,dot,.,semi,%3B", + ";keys=comma,%2C,semi,%3B,dot,.", + ";keys=dot,.,comma,%2C,semi,%3B", + ";keys=dot,.,semi,%3B,comma,%2C", + ";keys=semi,%3B,comma,%2C,dot,.", + ";keys=semi,%3B,dot,.,comma,%2C" + ]], + ["{;keys*}", [ + ";comma=%2C;dot=.;semi=%3B", + ";comma=%2C;semi=%3B;dot=.", + ";dot=.;comma=%2C;semi=%3B", + ";dot=.;semi=%3B;comma=%2C", + ";semi=%3B;comma=%2C;dot=.", + ";semi=%3B;dot=.;comma=%2C" + ]], + ["{?var:3}", "?var=val"], + ["{?list}", "?list=red,green,blue"], + ["{?list*}", "?list=red&list=green&list=blue"], + ["{?keys}", [ + "?keys=comma,%2C,dot,.,semi,%3B", + "?keys=comma,%2C,semi,%3B,dot,.", + "?keys=dot,.,comma,%2C,semi,%3B", + "?keys=dot,.,semi,%3B,comma,%2C", + "?keys=semi,%3B,comma,%2C,dot,.", + "?keys=semi,%3B,dot,.,comma,%2C" + ]], + ["{?keys*}", [ + "?comma=%2C&dot=.&semi=%3B", + "?comma=%2C&semi=%3B&dot=.", + "?dot=.&comma=%2C&semi=%3B", + "?dot=.&semi=%3B&comma=%2C", + "?semi=%3B&comma=%2C&dot=.", + "?semi=%3B&dot=.&comma=%2C" + ]], + ["{&var:3}", "&var=val"], + ["{&list}", "&list=red,green,blue"], + ["{&list*}", "&list=red&list=green&list=blue"], + ["{&keys}", [ + "&keys=comma,%2C,dot,.,semi,%3B", + "&keys=comma,%2C,semi,%3B,dot,.", + "&keys=dot,.,comma,%2C,semi,%3B", + "&keys=dot,.,semi,%3B,comma,%2C", + "&keys=semi,%3B,comma,%2C,dot,.", + "&keys=semi,%3B,dot,.,comma,%2C" + ]], + ["{&keys*}", [ + "&comma=%2C&dot=.&semi=%3B", + "&comma=%2C&semi=%3B&dot=.", + "&dot=.&comma=%2C&semi=%3B", + "&dot=.&semi=%3B&comma=%2C", + "&semi=%3B&comma=%2C&dot=.", + "&semi=%3B&dot=.&comma=%2C" + ]] + ] + } +}