commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julius Davies <juliusdav...@gmail.com>
Subject Re: svn commit: r928129 - /commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java
Date Sat, 27 Mar 2010 05:21:41 GMT
Hi,

I think there's a mistake here (even though it's commented out):

//assertEquals("foo",
StringUtils.newStringUsAscii(Base64.decodeBase64("Zm9v" +
Base64.CHUNK_SEPARATOR)));


Consider output of following:

        String s = "Zm9v" + Base64.CHUNK_SEPARATOR;
        System.out.println(s);

The output is:

        Zm9v[B@6bbc4459


I've attached a fix to CODEC-99 as 'codec-99-test-fixes.patch'.


yours,

Julius


> +    public void testRfc4648Section10DecodeWithCrLf() {
> +        assertEquals("", StringUtils.newStringUsAscii(Base64.decodeBase64("")));
> +        assertEquals("f", StringUtils.newStringUsAscii(Base64.decodeBase64("Zg=="
+ Base64.CHUNK_SEPARATOR)));
> +        assertEquals("fo", StringUtils.newStringUsAscii(Base64.decodeBase64("Zm8="
+ Base64.CHUNK_SEPARATOR)));
> +        //assertEquals("foo", StringUtils.newStringUsAscii(Base64.decodeBase64("Zm9v"
+ Base64.CHUNK_SEPARATOR)));
> +        assertEquals("foob", StringUtils.newStringUsAscii(Base64.decodeBase64("Zm9vYg=="
+ Base64.CHUNK_SEPARATOR)));
> +        assertEquals("fooba", StringUtils.newStringUsAscii(Base64.decodeBase64("Zm9vYmE="
+ Base64.CHUNK_SEPARATOR)));
> +        //assertEquals("foobar", StringUtils.newStringUsAscii(Base64.decodeBase64("Zm9vYmFy"
+ Base64.CHUNK_SEPARATOR)));
> +    }
> +



-- 
yours,

Julius Davies
250-592-2284 (Home)
250-893-4579 (Mobile)

$ sudo apt-get install cowsay
$ echo "Moo." | cowsay | cowsay -n | cowsay -n
http://juliusdavies.ca/cowsay/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message