You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ke...@apache.org on 2023/10/08 22:57:38 UTC

[tinkerpop] 02/03: update gherkin comparison in dotnet for HashSets

This is an automated email from the ASF dual-hosted git repository.

kenhuuu pushed a commit to branch gherkin-set-results
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit dcebea3ff7790fe7d890c90c67d8d990118f3713
Author: Ken Hu <10...@users.noreply.github.com>
AuthorDate: Thu Oct 5 21:56:13 2023 -0700

    update gherkin comparison in dotnet for HashSets
---
 .../test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs  | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs
index 6da7935bd5..29e6a1bea4 100644
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs
@@ -284,6 +284,18 @@ namespace Gremlin.Net.IntegrationTest.Gherkin
                                 }
                                 Assert.True(expectedArrayContainsResultDictionary);
                             }
+                            else if (resultItem is HashSet<object> resultItemSet)
+                            {
+                                var expectedArrayContainsResultAsSet = false;
+                                foreach (var expectedItem in expectedArray)
+                                {
+                                    if (expectedItem is not HashSet<object> expectedItemSet) continue;
+                                    if (!expectedItemSet.SetEquals(resultItemSet)) continue;
+                                    expectedArrayContainsResultAsSet = true;
+                                    break;
+                                }
+                                Assert.True(expectedArrayContainsResultAsSet);
+                            }
                             else if (resultItem is double resultItemDouble &&
                                      expectedArray.Select(e => e.GetType()).Any(t => t == typeof(decimal)))
                             {