Permalink
Browse files

add test to validate codec buffer resizing

  • Loading branch information...
wg committed Nov 9, 2011
1 parent 1b679d3 commit 2739eee96b2c12cc8e03d926a708bff271b77db4
Showing with 22 additions and 0 deletions.
  1. +22 −0 src/test/java/com/lambdaworks/redis/Utf8StringCodecTest.java
@@ -0,0 +1,22 @@
+// Copyright (C) 2011 - Will Glozer. All rights reserved.
+
+package com.lambdaworks.redis;
+
+import org.junit.Test;
+
+import java.util.Arrays;
+
+import static org.junit.Assert.assertEquals;
+
+public class Utf8StringCodecTest extends AbstractCommandTest {
+ @Test
+ public void decodeHugeBuffer() throws Exception {
+ char[] huge = new char[8192];
+ Arrays.fill(huge, 'A');
+ String value = new String(huge);
+ redis.set(key, value);
+ assertEquals(value, redis.get(key));
+ }
+}
+
+

0 comments on commit 2739eee

Please sign in to comment.