[Chapel Merge] Fix OOB error for string comparison in UnitTest as

Branch: refs/heads/main
Revision: 8a3d716
Author: bmcdonald3
Link: Unavailable
Log Message:

Merge pull request #20783 from bmcdonald3/unit-test-str-asrt

Fix OOB error for string comparison in UnitTest assert

[ reviewed by @ronawho - thank you! ]

When checking string equality, the UnitTest code would compare the length of strings and, if they differed, would then index into the value at the length of the shorter string+1, which is 1 more than what we want when using 0-based indexing. This was causing an OOB access for strings that differed in length by 1.

Resolves: bug when testing strings equality · Issue #20781 · chapel-lang/chapel · GitHub

Modified Files:
A test/library/packages/UnitTest/AssertEqual/test_string_equality.chpl

A test/library/packages/UnitTest/AssertEqual/test_string_equality.good
M modules/packages/UnitTest.chpl

Compare: https://github.com/chapel-lang/chapel/compare/7c9d2c6e0aaf...8a3d716382e7