1 ! Copyright (C) 2009 Bruno Deferrari
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: tools.test redis.response-parser io.streams.string ;
4 IN: redis.response-parser.tests
6 { 1 } [ ":1\r\n" [ read-response ] with-string-reader ] unit-test
8 { "hello" } [ "$5\r\nhello\r\n" [ read-response ] with-string-reader ] unit-test
10 { f } [ "$-1\r\n" [ read-response ] with-string-reader ] unit-test
12 { { "hello" "world!" } } [
13 "*2\r\n$5\r\nhello\r\n$6\r\nworld!\r\n" [ read-response ] with-string-reader
16 { { "hello" f "world!" } } [
17 "*3\r\n$5\r\nhello\r\n$-1\r\n$6\r\nworld!\r\n" [