amolmali / googlechartwrapper

Automatically exported from code.google.com/p/googlechartwrapper
0 stars 0 forks source link

-1 should be encoded using double underscore #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

    @Test
    public void testMissingValue() {
        final int[] series = new int[] { 19, -1, 20 };

        final IEncoder encoder = 
EncoderFactory.getEncoder(EncodingType.ExtendedEncoding);

        final String encoded = encoder.encode(series);

        Assert.assertEquals("e:AT__AU", encoded);
    }

What is the expected output? What do you see instead?

org.junit.ComparisonFailure: expected:<e:AT_[_]AU> but was:<e:AT_[]AU>

Expect double underscore encoding for -1 value, but get single char which 
is against the data format spec:

http://code.google.com/apis/chart/formats.html#extended

Missing values are indicated with a double underscore (__).

What version of the product are you using? On what operating system?

svn trunk

Please provide any additional information below.

Patch attached for JUnit test and fix.

Original issue reported on code.google.com by chris.lo...@gmail.com on 30 Jan 2010 at 5:30

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by steffan....@outlook.com on 8 Apr 2010 at 12:28

GoogleCodeExporter commented 9 years ago

Original comment by steffan....@outlook.com on 10 Apr 2010 at 7:19