From c61e5e23c89b99d26aaaec6ec6c58bda1b502ebc Mon Sep 17 00:00:00 2001 From: Rick van Voorden Date: Tue, 6 Feb 2024 17:26:21 -0800 Subject: [PATCH] tree dictionary keys hashable cleanup --- .../TreeDictionary.Keys Tests.swift | 17 ++++++++++++++++- .../TreeSet Tests.swift | 15 +++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/Tests/HashTreeCollectionsTests/TreeDictionary.Keys Tests.swift b/Tests/HashTreeCollectionsTests/TreeDictionary.Keys Tests.swift index a867769f3..06f33a65b 100644 --- a/Tests/HashTreeCollectionsTests/TreeDictionary.Keys Tests.swift +++ b/Tests/HashTreeCollectionsTests/TreeDictionary.Keys Tests.swift @@ -146,6 +146,21 @@ class TreeDictionaryKeysTests: CollectionTestCase { [ ["e"] ], + [ + ["f"], ["f"], + ], + [ + ["g"], ["g"], + ], + [ + ["h"], ["h"], + ], + [ + ["i"], ["i"], + ], + [ + ["j"], ["j"], + ], [ ["a", "b"], ["b", "a"], ], @@ -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) } diff --git a/Tests/HashTreeCollectionsTests/TreeSet Tests.swift b/Tests/HashTreeCollectionsTests/TreeSet Tests.swift index aa3f675ee..e37857d5a 100644 --- a/Tests/HashTreeCollectionsTests/TreeSet Tests.swift +++ b/Tests/HashTreeCollectionsTests/TreeSet Tests.swift @@ -681,6 +681,21 @@ class TreeSetTests: CollectionTestCase { [ ["e"] ], + [ + ["f"], ["f"], + ], + [ + ["g"], ["g"], + ], + [ + ["h"], ["h"], + ], + [ + ["i"], ["i"], + ], + [ + ["j"], ["j"], + ], [ ["a", "b"], ["b", "a"], ],