Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Test for String.find falsely passes #748

Closed
1 task done
liz3 opened this issue Sep 18, 2024 · 3 comments
Closed
1 task done

[BUG] Test for String.find falsely passes #748

liz3 opened this issue Sep 18, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@liz3
Copy link
Contributor

liz3 commented Sep 18, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

This testcase:

this.assertEquals("Dictu is great! Dictu is great! Dictu is great!".find("Dictu", 3), 37);

Passes in the current builds.

Expected Behavior

I was a bit confused because this test failed over and over in my current endavours of hacking on utf8 support, until i looked somewhat closer at the test:

this.assertEquals("Dictu is great! Dictu is great! Dictu is great!".find("Dictu", 3), 37);

The third occurance of Dictu is at index 32, not at 37= index + search length!
So this seams to be a bug? in the current implementation of find?

Steps To Reproduce

Run the string tests for find:
dictu tests/strings/find.du

Anything else?

Current test reference: https://github.com/dictu-lang/Dictu/blob/develop/tests/strings/find.du#L24

@liz3 liz3 added the bug Something isn't working label Sep 18, 2024
@liz3
Copy link
Contributor Author

liz3 commented Oct 28, 2024

@Jason2605 I wanted to bump this

@Jason2605
Copy link
Member

Sorry somehow missed this (emails get buried sometimes, need to be more vigilant checking this repo, apologies). Oh wow, that's really bad from me, yeah this is an issue

@Jason2605
Copy link
Member

Fixed as part of #749

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants