package fi.iki.elonen;

import org.junit.Test;

import static junit.framework.Assert.assertEquals;

public class HttpParsingTest extends HttpServerTest {
    @Test
    public void testNormalCharacters() throws Exception {
        for (int i = 0x20; i < 0x80; i++) {
            String hex = Integer.toHexString(i);
            String input = "%" + hex;
            char expected = (char) i;
            assertEquals("" + expected, testServer.decodePercent(input));
        }
    }
}

@@ -473,11 +473,157 @@
  %7D%0A    %7D
+%0A%0A    @Test%0A    public void testPlusInQueryParams() throws Exception %7B%0A        assertEquals(%22foo bar%22, testServer.decodePercent(%22foo+bar%22));%0A    %7D
 %0A%7D%0A

Test for parsing