package org.jcodings.transcode;

import org.jcodings.Ptr;
import org.junit.Test;

public class TestCP51932ToCP50220 {
    @Test
    public void test2() {
        byte[] src = {0, 127, -114, -95, -114, -2, -95, -95, -95, -2};
        byte[] dst = new byte[100];
        Ptr srcPtr = new Ptr(0);
        Ptr dstPtr = new Ptr(0);
        EConv econv = TranscoderDB.open("CP51932", "CP50220", 0);
        econv.convert(src, srcPtr, src.length, dst, dstPtr, dst.length, 0);
    }
}

@@ -73,16 +73,66 @@
 it.Test;
+%0Aimport org.junit.Assert;%0Aimport java.util.Arrays;
 %0A%0Apublic
@@ -195,83 +195,152 @@
 test
-2() %7B%0A        byte%5B%5D src = %7B0, 127, -114, -95, -114, -2, -95, -95, -95, -2%7D
+CP51932ToCP50220() throws Exception %7B%0A        byte%5B%5D src = %22%5Cu0000%5Cu007F%5Cu008E%5Cu00A1%5Cu008E%5Cu00FE%5Cu00A1%5Cu00A1%5Cu00A1%5Cu00FE%22.getBytes(%22iso-8859-1%22)
 ;%0A  
@@ -576,21 +576,348 @@
 .length, 0);
+%0A%0A        byte%5B%5D str = Arrays.copyOf(dst, dstPtr.p);%0A%0A        byte%5B%5D expected = %22%5Cu0000%5Cu007F%5Cu001B%5Cu0024%5Cu0042%5Cu0021%5Cu0023%5Cu0050%5Cu0000%5Cu0021%5Cu0021%5Cu0021%5Cu007E%5Cu001B%5Cu0028%5Cu0042%22.getBytes(%22iso-8859-1%22);%0A        byte%5B%5D actual = Arrays.copyOf(dst, dstPtr.p);%0A        Assert.assertEquals(new String(expected), new String(actual));
 %0A    %7D%0A%7D%0A

improve test for jp