Skip to content

Commit

Permalink
Hack in support for alternate ordering of new dictionary explode tests
Browse files Browse the repository at this point in the history
This can be removed if uri-templates/uritemplate-test#58 is merged
  • Loading branch information
alexdeem committed Jan 20, 2023
1 parent 4844837 commit f39dd35
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Tests/ScreamURITemplateTests/TestModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,18 @@ extension TestCase {
let expansionsData = data[1]
switch expansionsData {
case let .string(string):
acceptableExpansions = [string]
// HACK: ensure the tests support alternate ordering for dictionary explode tests
// A PR has been raised to add support for the alternate ordering https://github.com/uri-templates/uritemplate-test/pull/58
switch string {
case "key1,val1%2F,key2,val2%2F":
acceptableExpansions = [string, "key2,val2%2F,key1,val1%2F"]
case "#key1,val1%2F,key2,val2%2F":
acceptableExpansions = [string, "#key2,val2%2F,key1,val1%2F"]
case "key1,val1%252F,key2,val2%252F":
acceptableExpansions = [string, "key2,val2%252F,key1,val1%252F"]
default:
acceptableExpansions = [string]
}
shouldFail = false
case let .array(array):
acceptableExpansions = array.compactMap { value in
Expand Down

0 comments on commit f39dd35

Please sign in to comment.