Skip to content

Commit 10d8734

Browse files
authored
Merge pull request #224 from codecrafters-io/andy/fix-3
Update 'px' to 'PX'
2 parents 817e00c + 04ce3aa commit 10d8734

File tree

11 files changed

+807
-807
lines changed

11 files changed

+807
-807
lines changed

internal/test_expiry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func testExpiry(stageHarness *test_case_harness.TestCaseHarness) error {
3232

3333
setCommandTestCase := test_cases.SendCommandTestCase{
3434
Command: "set",
35-
Args: []string{key, value, "px", "100"},
35+
Args: []string{key, value, "PX", "100"},
3636
Assertion: resp_assertions.NewStringAssertion("OK"),
3737
}
3838

internal/test_helpers/course_definition.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ extensions:
9393
name: "Transactions"
9494
description_markdown: |-
9595
In this challenge extension you'll add support for [Transactions][redis-transactions] to your Redis implementation.
96-
96+
9797
Along the way, you'll learn about the [MULTI][multi-command], [EXEC][exec-command], and [DISCARD][discard-command] commands, as well as how Redis handles transactions atomically.
9898
9999
[redis-transactions]: https://redis.io/docs/latest/develop/interact/transactions/
@@ -103,7 +103,7 @@ extensions:
103103
104104
- slug: "lists"
105105
name: "Lists"
106-
description_markdown : |-
106+
description_markdown: |-
107107
In this challenge extension you'll add support for [Lists][redis-lists] to your Redis implementation.
108108
109109
Along the way, you'll learn commands like RPUSH, LRANGE, and more.
@@ -114,7 +114,7 @@ extensions:
114114
115115
- slug: "pub-sub"
116116
name: "Pub/Sub"
117-
description_markdown : |-
117+
description_markdown: |-
118118
In this challenge extension you'll add support for [Publish/Subscribe (Pub/Sub)][redis-pub-sub] to your Redis implementation.
119119
120120
Along the way, you'll learn commands like [SUBSCRIBE][subscribe-command], [PUBLISH][publish-command], and more.
@@ -125,7 +125,7 @@ extensions:
125125
126126
- slug: "sorted-sets"
127127
name: "Sorted Sets"
128-
description_markdown : |-
128+
description_markdown: |-
129129
In this challenge extension you'll add support for [Sorted Sets (zsets)][redis-zset] to your Redis implementation.
130130
131131
Along the way, you'll learn commands like [ZADD][zadd-command], [ZRANGE][zrange-command], and more.
@@ -463,7 +463,7 @@ stages:
463463
The expiry for a key can be provided using the "PX" argument to the [SET](https://redis.io/commands/set) command. The expiry is provided in milliseconds.
464464
465465
```bash
466-
$ redis-cli SET foo bar px 100 # Sets the key "foo" to "bar" with an expiry of 100 milliseconds
466+
$ redis-cli SET foo bar PX 100 # Sets the key "foo" to "bar" with an expiry of 100 milliseconds
467467
OK
468468
```
469469
@@ -485,7 +485,7 @@ stages:
485485
It'll then send a `SET` command to your server to set a key with an expiry:
486486
487487
```bash
488-
$ redis-cli SET foo bar px 100
488+
$ redis-cli SET foo bar PX 100
489489
```
490490
491491
It'll then immediately send a `GET` command to retrieve the value:
@@ -3576,7 +3576,7 @@ stages:
35763576
name: "Blocking retrieval with timeout"
35773577
difficulty: medium
35783578
marketing_md: In this stage, you will add support for a non-zero timeout duration for the `BLPOP` command.
3579-
3579+
35803580
# Pub-Sub
35813581
- slug: "mx3"
35823582
primary_extension_slug: "pub-sub"
@@ -3595,7 +3595,7 @@ stages:
35953595
name: "Enter subscribed mode"
35963596
difficulty: medium
35973597
marketing_md: In this stage, you'll add support for marking a client as having entered subscribed mode.
3598-
3598+
35993599
- slug: "lf1"
36003600
primary_extension_slug: "pub-sub"
36013601
name: "PING in subscribed mode"
@@ -3724,4 +3724,4 @@ stages:
37243724
primary_extension_slug: "geospatial"
37253725
name: "Search within radius"
37263726
difficulty: easy
3727-
marketing_md: In this stage, you'll add support for searching locations near a coordinate within a given radius using the `GEOSEARCH` command.
3727+
marketing_md: In this stage, you'll add support for searching locations near a coordinate within a given radius using the `GEOSEARCH` command.

internal/test_helpers/fixtures/expiry/pass

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ Debug = true
22

33
[tester::#YZ1] Running tests for Stage #YZ1 (yz1)
44
[tester::#YZ1] $ ./spawn_redis_server.sh
5-
[tester::#YZ1] [client] $ redis-cli SET apple blueberry px 100
6-
[tester::#YZ1] [client] Sent bytes: "*5\r\n$3\r\nSET\r\n$5\r\napple\r\n$9\r\nblueberry\r\n$2\r\npx\r\n$3\r\n100\r\n"
5+
[tester::#YZ1] [client] $ redis-cli SET apple blueberry PX 100
6+
[tester::#YZ1] [client] Sent bytes: "*5\r\n$3\r\nSET\r\n$5\r\napple\r\n$9\r\nblueberry\r\n$2\r\nPX\r\n$3\r\n100\r\n"
77
[tester::#YZ1] [client] Received bytes: "+OK\r\n"
88
[tester::#YZ1] [client] Received RESP simple string: "OK"
99
[tester::#YZ1] [client] ✔︎ Received "OK"
10-
[tester::#YZ1] Received OK at 07:22:35.924
11-
[tester::#YZ1] Fetching key "apple" at 07:22:35.924 (should not be expired)
10+
[tester::#YZ1] Received OK at 21:22:04.157
11+
[tester::#YZ1] Fetching key "apple" at 21:22:04.157 (should not be expired)
1212
[tester::#YZ1] [client] > GET apple
1313
[tester::#YZ1] [client] Sent bytes: "*2\r\n$3\r\nGET\r\n$5\r\napple\r\n"
1414
[tester::#YZ1] [client] Received bytes: "$9\r\nblueberry\r\n"
1515
[tester::#YZ1] [client] Received RESP bulk string: "blueberry"
1616
[tester::#YZ1] [client] ✔︎ Received "blueberry"
1717
[tester::#YZ1] Sleeping for 101ms
18-
[tester::#YZ1] Fetching key "apple" at 07:22:36.031 (should be expired)
18+
[tester::#YZ1] Fetching key "apple" at 21:22:04.261 (should be expired)
1919
[tester::#YZ1] [client] > GET apple
2020
[tester::#YZ1] [client] Sent bytes: "*2\r\n$3\r\nGET\r\n$5\r\napple\r\n"
2121
[tester::#YZ1] [client] Received bytes: "$-1\r\n"

0 commit comments

Comments
 (0)