# Update tests to be more specific (simple string vs bulk string)

**URL:** <https://forum.codecrafters.io/t/update-tests-to-be-more-specific-simple-string-vs-bulk-string/13707>\
**Category:** Challenges\
**Tags:** challenge:redis\
**Created:** [July 19, 2025, 12:05pm UTC](https://forum.codecrafters.io/t/update-tests-to-be-more-specific-simple-string-vs-bulk-string/13707 "2025-07-19T12:05:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pranjalpokharel7](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/pranjalpokharel7/32/4806_2.png) [@pranjalpokharel7](https://forum.codecrafters.io/u/pranjalpokharel7)\
**Post date:** [July 19, 2025, 12:05pm UTC](https://forum.codecrafters.io/t/update-tests-to-be-more-specific-simple-string-vs-bulk-string/13707/1 "2025-07-19T12:05:33Z")

</div>

From the redis docs, [response for a PING is,](https://redis.io/docs/latest/commands/ping/#return-information)

```auto
Command: PING [message]

Response:
Simple string reply: PONG when no argument is provided.
Bulk string reply: the provided argument.

```

It clearly states that when there is _no message provided as argument_, the cli expects a **simple string** `+PONG\r\n` as a response. This might be a small nitpick, but the test doesn’t assert whether the response is actually in simple string format, and it passes even when bulk string `$4\r\nPONG\r\n` is provided as response.

Looking at the source code for the `redis-tester`, the assertion for ping response is run as `NewStringAssertion` which accepts for both simple and bulk strings.

```go
// test_ping_pong.go 
commandTestCase := test_cases.SendCommandTestCase{
	Command: "ping",
	Args: []string{},
	Assertion: resp_assertions.NewStringAssertion("PONG"),
}

// ...

// string_assertion.go

func NewStringAssertion(expectedValue string) RESPAssertion {
	return StringAssertion{ExpectedValue: expectedValue}
}

func (a StringAssertion) Run(value resp_value.Value) error {
    // PONG should be a simple string response
	if value.Type != resp_value.SIMPLE_STRING && value.Type != resp_value.BULK_STRING {
		return fmt.Errorf("Expected simple string or bulk string, got %s", value.Type)
	}

    // ...
}

```

This is not a breaking issue that needs to be fixed, but would be nice if the tests could be more specific.

---

<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:** [July 21, 2025, 11:39am UTC](https://forum.codecrafters.io/t/update-tests-to-be-more-specific-simple-string-vs-bulk-string/13707/4 "2025-07-21T11:39:20Z")

</div>

Hey @pranjalpokharel7, thanks for highlighting the issue! We’re addressing it in [this PR](https://github.com/codecrafters-io/redis-tester/pull/200).

---

<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:** [July 26, 2025, 11:40am UTC](https://forum.codecrafters.io/t/update-tests-to-be-more-specific-simple-string-vs-bulk-string/13707/6 "2025-07-26T11:40:10Z")

</div>

Closed on July 26, 2025, 11:40am UTC

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