A demonstration of the failing of the current String[] transformer.
I'll do some more tests and nix this one today.
This commit is contained in:
@@ -20,9 +20,13 @@
|
|||||||
|
|
||||||
package com.samskivert.depot.tests;
|
package com.samskivert.depot.tests;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
import com.samskivert.depot.Transformers;
|
import com.samskivert.depot.Transformers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,4 +40,14 @@ public class TransformersTest
|
|||||||
Transformers.TabSeparatedString xform = new Transformers.TabSeparatedString();
|
Transformers.TabSeparatedString xform = new Transformers.TabSeparatedString();
|
||||||
assertArrayEquals(data, xform.fromPersistent(null, xform.toPersistent(data)));
|
assertArrayEquals(data, xform.fromPersistent(null, xform.toPersistent(data)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test public void testEmpties ()
|
||||||
|
{
|
||||||
|
Transformers.TabSeparatedString xform = new Transformers.TabSeparatedString();
|
||||||
|
Set<String> set = Sets.newHashSet();
|
||||||
|
// set.add(xform.toPersistent(null));
|
||||||
|
set.add(xform.toPersistent(new String[] {}));
|
||||||
|
set.add(xform.toPersistent(new String[] {""}));
|
||||||
|
assertTrue(set.size() == 3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user