[ https://issues.apache.org/jira/browse/LUCENENET-283?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nicholas Paldino updated LUCENENET-283: --------------------------------------- Attachment: TestQueryParser.DateRangeTests.patch The tests themselves are wrong. In TestDateRange, testing a query which is exclusive of the bounds for two dates (1/1/2002 and 1/4/2002, en-US), it generates a date equal to the last millisecond on the end date to compare the queries (1/4/2002 23:59:59.999) and then compares the conversion of that string into the encoded format against what the string representation of the query is. The problem is, the date that it actually uses is *2*/4/2002 23:59:59.999, which is a month off of what is expected. The same problem occurs in TestLegacyDateRange. To resolve, I created DateTime instances representing start/end dates at the beginning of each test method, and had all other dates that were generated and used for the tests use properties/methods from the values instead of relying on magic numbers to create instances (which caused the problem in the first place). If the problem exists in the Java test cases as well, I suggest that the same thing be done there. > TestDateRange and TestLegacyDateRange fail. > ------------------------------------------- > > Key: LUCENENET-283 > URL: https://issues.apache.org/jira/browse/LUCENENET-283 > Project: Lucene.Net > Issue Type: Bug > Reporter: Nicholas Paldino > Priority: Minor > Attachments: TestQueryParser.DateRangeTests.patch > > > The tests for TestDateRange and TestLegacyDateRange fail. Patch to follow. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.