Skip to content

Commit

Permalink
feat: update "received RESP value" log to print data types too
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-gang committed May 28, 2024
1 parent 0d508c0 commit 90b2d6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ func defaultCallbacks(stageHarness *test_case_harness.TestCaseHarness, logPrefix
stageHarness.Logger.Debugf("%sReceived bytes: %q", logPrefix, string(bytes))
},
AfterReadValue: func(value resp_value.Value) {
stageHarness.Logger.Debugf("%sReceived RESP value: %s", logPrefix, value.FormattedString())
valueTypeLowerCase := strings.ReplaceAll(strings.ToLower(value.Type), "_", " ")
stageHarness.Logger.Debugf("%sReceived RESP %s: %s", logPrefix, valueTypeLowerCase, value.FormattedString())

},
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/resp/value/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (v *Value) FormattedString() string {
case ERROR:
return fmt.Sprintf("%q", "ERR: "+v.String())
case NIL:
return "NIL"
return "$-1\\r\\n"
}

return ""
Expand Down

0 comments on commit 90b2d6f

Please sign in to comment.