ParseQS and Global made into packages

This commit is contained in:
Naoyuki Kanezawa
2014-05-02 13:49:12 +09:00
parent 7d6ff9e2dc
commit 3751646667
9 changed files with 149 additions and 117 deletions

View File

@@ -0,0 +1,24 @@
package com.github.nkzawa.global;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
@RunWith(JUnit4.class)
public class GlobalTest {
@Test
public void encodeURIComponent() {
assertThat(Global.encodeURIComponent(" ~'()! "), is("%20~'()!%20"));
assertThat(Global.encodeURIComponent("+:;"), is("%2B%3A%3B"));
}
@Test
public void decodeURIComponent() {
assertThat(Global.decodeURIComponent("%20%7E%27%28%29%21%20"), is(" ~'()! "));
assertThat(Global.decodeURIComponent("%2B%3A%3B"), is("+:;"));
}
}