lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From laimis <...@git.apache.org>
Subject [GitHub] lucenenet pull request: Use Set equality check
Date Sat, 03 Jan 2015 02:51:55 GMT
GitHub user laimis opened a pull request:

    https://github.com/apache/lucenenet/pull/41

    Use Set equality check

    There are ~20 tests failing with this type of message:
    
    Expected and actual are both <System.Collections.Generic.HashSet`1[System.String]>
      Values differ at index [0]
      Expected string length 16 but was 12. Strings differ at index 0.
      Expected: "fjdcqoqrmvtmfupr"
      But was:  "dsncorcvbzne"
    
    After debugging through, it looked like assertion was comparing two sets that actually
contained the same values but they were in different order. In Java Set implementations appear
to override Equals so that AreEqual assertion passes there. In .NET we have to use SetEquals
method to compare two sets if the intention is to make sure sets are of the same size and
have the same elements.
    
    Took forever to track down and seconds to fix, sigh...
    
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/laimis/lucenenet BaseTermVectorsFormatTestCase_fixes

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/lucenenet/pull/41.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #41
    
----
commit 35e882e07fbd82ed07338c6bc4f1bbfefeb317e8
Author: Laimonas Simutis <laimis@gmail.com>
Date:   2015-01-03T02:46:47Z

    use set equality check

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message