Grep test expects wrong result

it’s expecting the line “act” with the pattern “ca?t” to give 0 which means it satisfies the conditions but it doesn’t. “ca?t” can be ct or cat not act.
here’s the logs:
$ echo -n “act” | ./your_program.sh -E “ca?t”
remote: [your_program] Logs from your program will appear here!
remote: [your_program] pattern[i]: c = a
remote: [your_program] returned j: 0 false
remote: [tester::#NY8] expected exit code 0, got 1
remote: [tester::#NY8] Test failed

( later on I found out it’s also happening with certain other cases and I have made specific if conditions in my code for them so I could work on the last step without wasting time )
here’s the link to the git repo : GitHub - Wassimxietty/grep-go: I made grep as a coding challenge while learning go; here's how it's going

Patterns can match substrings (so it can match ct, act, and react)

1 Like

I recommend running these using grep locally if you can, the highlighting is helpful:

Screenshot 2024-08-29 at 00.42.02

thank you for the reply, I get it now it seems I just did not understand it properly therefore the implementation was wrong. Thank you once again for the reply and your time.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.