Skip to content

Commit

Permalink
storage: restore testscripts/engine/keys
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgrinaker committed Jun 13, 2024
1 parent 021be0d commit bb60cee
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions src/storage/testscripts/engine/keys
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Tests various keys.

# Keys are case-sensitive.
set a=1
get a
get A
---
a → 1
A → None

set A=2
get a
get A
---
a → 1
A → 2

delete a
delete A
scan
---
ok

# Empty keys and values are valid.
set ""=""
get ""
scan
delete ""
---

scan
---
ok

# NUL keys and values are valid.
set "\0"="\0"
get "\0"
scan
delete "\0"
---
\x00 → \x00
\x00 → \x00

scan
---
ok

# Unicode keys and values work, but are shown as raw UTF-8 bytes.
set "👋"="👋"
get "👋"
scan
delete "👋"
---
\xf0\x9f\x91\x8b → \xf0\x9f\x91\x8b
\xf0\x9f\x91\x8b → \xf0\x9f\x91\x8b

scan
---
ok

0 comments on commit bb60cee

Please sign in to comment.