extra test cases

tests that we're only reading one value on a call to readvalue,
regardless of how much is in the input
master
Jordan Orelli 10 years ago
parent a1dcee13f7
commit e421be5d42

@ -38,6 +38,24 @@ var valueTests = []valueTest{
{":-12345", Integer(-12345)}, {":-12345", Integer(-12345)},
{":9223372036854775807", Integer(9223372036854775807)}, // int64 max {":9223372036854775807", Integer(9223372036854775807)}, // int64 max
{":-9223372036854775808", Integer(-9223372036854775808)}, // int64 min {":-9223372036854775808", Integer(-9223372036854775808)}, // int64 min
{"+hello\r\n+extra\r\n", String("hello")},
{"+one two\r\n+extra\r\n", String("one two")}, // intermediate space
{"+one two \r\n+extra\r\n", String("one two ")}, // trailing space
{"+ one two\r\n+extra\r\n", String(" one two")}, // leading space
{"-hello\r\n+extra\r\n", Error("hello")},
{"-one two\r\n+extra\r\n", Error("one two")}, // intermediate space
{"-one two \r\n+extra\r\n", Error("one two ")}, // trailing space
{"- one two\r\n+extra\r\n", Error(" one two")}, // leading space
{":0\r\n+extra\r\n", Integer(0)},
{":1\r\n+extra\r\n", Integer(1)},
{":-1\r\n+extra\r\n", Integer(-1)},
{":12345\r\n+extra\r\n", Integer(12345)},
{":-12345\r\n+extra\r\n", Integer(-12345)},
{":9223372036854775807\r\n+extra\r\n", Integer(9223372036854775807)}, // int64 max
{":-9223372036854775808\r\n+extra\r\n", Integer(-9223372036854775808)}, // int64 min
} }
func TestValues(t *testing.T) { func TestValues(t *testing.T) {

Loading…
Cancel
Save