libpalaso icon indicating copy to clipboard operation
libpalaso copied to clipboard

VerseRef.GetBBBCCCVVV does really unexpected things at the upper limit

Open tombogle opened this issue 1 month ago • 1 comments

I can't think of any scenario where using modulus to prevent a verse or chapter number from going out of range would give a a helpful result. Worse yet, at 999 (the purported max), we actually seem to have an unintentional off-by-one error, and 999 gets treated as 0. I would argue that if a verse or chapter number has been set to a value > 999, it should just be clamped to 999, in much the same way we are dealing with negative values. It could possibly be argued that out-of-range values should throw an exception, or at least that a flag could be passed indicating whether the caller wants to clamp or throw.

tombogle avatar Nov 14 '25 05:11 tombogle

When this is fixed and release and ParatextData is updated to use the fixed version, consider removing ToComparableBCV from https://github.com/paranext/paranext-core/blob/0f6e45bbf326c45db0d2c7d22513747a41092cdc/c-sharp/Checks/InputRangesFilter.cs

tombogle avatar Nov 18 '25 02:11 tombogle