示例#1
0
 public void testEscape() {
   Hash h = new Hash("key", "<&>");
   assertEquals(" key=\"&lt;&amp;&gt;\"", h.asCharSequence());
 }
示例#2
0
 public void testJavascriptInt() {
   Hash h = new Hash("int", 42);
   assertEquals("{int:42}", h.toJavascript());
 }
示例#3
0
 public void testMultiKey() {
   Hash h = new Hash("key", "value", "key2", "value2");
   assertTrue(h.toJavascript().indexOf("value2") != -1);
 }
示例#4
0
 public void testJavascriptBoolean() {
   Hash h = new Hash("bool", true);
   assertEquals("{bool:true}", h.toJavascript());
 }
示例#5
0
 public void testJavascript() {
   Hash h = new Hash("key", "value");
   assertEquals("{key:'value'}", h.toJavascript());
 }