adventuregamestudio / ags-test-games

Games for automatic tests
MIT License
1 stars 3 forks source link

Add more string tests for IndexOf and utf-8 #11

Open ericoporto opened 3 months ago

ericoporto commented 3 months ago

IndexOf could use a few additional utf-8 tests to ensure we are correctly getting the right index when either or both the string and needle have utf-8 characters.

There are probably other utf-8 tests that would be useful to add to strings but I don't remember right now any other cases.

ivan-mogilko commented 3 months ago

Utf-8 specifics are affecting any method that:

for AGS 3.*:

for AGS 4.*:

ericoporto commented 3 months ago

ok, I added a few tests, but I also found a small bug in the new compiler.

https://github.com/adventuregamestudio/ags-test-games/blob/7d909cb13c977af39605069c2f80ea33df8ddc44/ags4/auto-test/test-string.asc#L16-L20

This gives the error "test-string.asc(19): Expected a quote mark but found '¤' instead".

ericoporto commented 3 months ago

I think some string UpperCase/LowerCase tests would be useful to have by just having a few strings with characters from different alphabets - like lower/upper of Greek, and so on.

ivan-mogilko commented 3 months ago

This gives the error "test-string.asc(19): Expected a quote mark but found '¤' instead".

I cannot remember what happened when I tested unicode char literals. But they are supposed to work, at least with the new compiler which is more advanced. Could you open a bug ticket in the main repository?

ericoporto commented 3 months ago

Sure, I will create a proper bug report later. To be specific this is only a bug in the new compiler, it works fine in the old one.