# List elements (negative indexes) Tests Failing

**URL:** <https://forum.codecrafters.io/t/list-elements-negative-indexes-tests-failing/14534>\
**Category:** Challenges\
**Tags:** challenge:redis\
**Created:** [August 8, 2025, 6:38am UTC](https://forum.codecrafters.io/t/list-elements-negative-indexes-tests-failing/14534 "2025-08-08T06:38:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NIHARSIMHADRI](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/niharsimhadri/32/11853_2.png) [@NIHARSIMHADRI](https://forum.codecrafters.io/u/NIHARSIMHADRI)\
**Post date:** [August 8, 2025, 6:38am UTC](https://forum.codecrafters.io/t/list-elements-negative-indexes-tests-failing/14534/1 "2025-08-08T06:38:07Z")

</div>

I’m stuck on Stage #ri1: **List elements (negative indexes)**

When I test RPUSH locally, I seem to be getting the correct output, but for some reason when the tests are run, sometimes it says Received: “” (no content received). I’m not sure why my local environment never does this but the test does.

 ![Screenshot 2025-08-08 at 1.28.55 AM](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/e/ec555acf64795b99047155f37100fff6aa2c96ea.png)

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [August 9, 2025, 3:15am UTC](https://forum.codecrafters.io/t/list-elements-negative-indexes-tests-failing/14534/4 "2025-08-09T03:15:01Z")

</div>

Hey @NIHARSIMHADRI, I noticed a couple of issues:

1. `#define MAX_TOKENS 8` may not be big enough for a long command:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/f/f73a5b049ea06cbb8ee6ffbadd0d841e2cce9ed4.png)

1. The order here could cause problems if `curr_list` is not valid:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/8/8d54b81867accadb30c4d195679fe85623270c0d.png)

---

<div class="post-metadata">

**Author:** ![NIHARSIMHADRI](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/niharsimhadri/32/11853_2.png) [@NIHARSIMHADRI](https://forum.codecrafters.io/u/NIHARSIMHADRI)\
**Post date:** [August 9, 2025, 6:39am UTC](https://forum.codecrafters.io/t/list-elements-negative-indexes-tests-failing/14534/6 "2025-08-09T06:39:37Z")

</div>

Thanks Andy, fixing these helped make it work.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [August 15, 2025, 2:56am UTC](https://forum.codecrafters.io/t/list-elements-negative-indexes-tests-failing/14534/7 "2025-08-15T02:56:58Z")

</div>

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