Skip to content

Commit

Permalink
tree dictionary keys hashable cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vanvoorden committed Feb 7, 2024
1 parent a047213 commit c61e5e2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Tests/HashTreeCollectionsTests/TreeDictionary.Keys Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,21 @@ class TreeDictionaryKeysTests: CollectionTestCase {
[
["e"]
],
[
["f"], ["f"],
],
[
["g"], ["g"],
],
[
["h"], ["h"],
],
[
["i"], ["i"],
],
[
["j"], ["j"],
],
[
["a", "b"], ["b", "a"],
],
Expand All @@ -163,7 +178,7 @@ class TreeDictionaryKeysTests: CollectionTestCase {
["e", "a", "d"], ["e", "d", "a"],
],
]
let keys = strings.map { $0.map { TreeDictionary(uniqueKeysWithValues: $0.map { ($0, UUID().uuidString) }).keys }}
let keys = strings.map { $0.map { TreeDictionary(uniqueKeysWithValues: $0.map { ($0, Int.random(in: 1...100)) }).keys }}
checkHashable(equivalenceClasses: keys)
}

Expand Down
15 changes: 15 additions & 0 deletions Tests/HashTreeCollectionsTests/TreeSet Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,21 @@ class TreeSetTests: CollectionTestCase {
[
["e"]
],
[
["f"], ["f"],
],
[
["g"], ["g"],
],
[
["h"], ["h"],
],
[
["i"], ["i"],
],
[
["j"], ["j"],
],
[
["a", "b"], ["b", "a"],
],
Expand Down

0 comments on commit c61e5e2

Please sign in to comment.