Added big data test and updating to reader

This commit is contained in:
obscuren
2014-07-29 23:31:33 +02:00
parent d1d2b660dc
commit 6e94c024e4
2 changed files with 87 additions and 67 deletions

View File

@ -44,6 +44,17 @@ func TestValueSlice(t *testing.T) {
}
}
func TestLargeData(t *testing.T) {
data := make([]byte, 100000)
enc := Encode(data)
value := NewValue(enc)
value.Decode()
if value.Len() != len(data) {
t.Error("Expected data to be", len(data), "got", value.Len())
}
}
func TestValue(t *testing.T) {
value := NewValueFromBytes([]byte("\xcd\x83dog\x83god\x83cat\x01"))
if value.Get(0).Str() != "dog" {