add expr length tests
Problem
The Skript project currently has very low test coverage for its existing syntax, making it difficult to ensure changes don't introduce regressions. Specifically, the core length of expression was untested.
Solution
This PR adds a new syntax test file, ExprLength.sk, to provide unit test coverage for the length of expressions.
The tests cover behavior for:
String literals and variables.
Edge cases like empty strings, whitespace, and Unicode characters.
Automatic type conversion from numbers.
The list-looping behavior when applied to a list of strings.
String interpolation.
Testing Completed
Added the ExprLength.sk test. The full test suite was run via .\gradlew skriptTest and passed successfully.
Supporting Information
None
Completes: none Related: #6158
[...] Maybe some tests using substring and joining.
I think substring and joining should be tested elsewhere. ie: ExprSubstring.sk should get created to test the substring. This file tests the length, and at the end of the day, we are checking the final length of a var/str/etc which is already covered in this test.
In ExprSubstring.sk we'd want to check that, when using substring, the length is as expected, but an issue here would probably be with ExprSubstring not ExprLength