006 kv protocol

✓ Passing This code compiles and runs correctly.

Code

input.k

Supporting Files

input.txt

Actual

PONG
ERR NOAUTH
ERR invalid password
OK
OK
"ada"
OK
"koru"
(integer) 1
(integer) 2
"2"
OK
"grace"
ERR value is not an integer
(integer) 1
(nil)
(integer) 0
(integer) 1
ERR already authenticated
ERR unknown command
bye

Expected output

PONG
ERR NOAUTH
ERR invalid password
OK
OK
"ada"
OK
"koru"
(integer) 1
(integer) 2
"2"
OK
"grace"
ERR value is not an integer
(integer) 1
(nil)
(integer) 0
(integer) 1
ERR already authenticated
ERR unknown command
bye

Flows

flow ~new click a branch to expand · @labels scroll to their anchor
new (session, source: stage: 0[i64])
flow ~new click a branch to expand · @labels scroll to their anchor
new (kv, capacity: 8, source: key: *std/string:String<std/string:instance!>, val: *std/string:String<std/string:instance!>)
subflow ~put click a branch to expand · @labels scroll to their anchor
from-page (text: k)
flow ~new click a branch to expand · @labels scroll to their anchor
new

Test Configuration

MUST_RUN