@Test public void testEquals() { assertTrue(JSON.equals("{}", "{}")); assertTrue(JSON.equals("{}", "\n{ }")); assertTrue(JSON.equals("{\"a\":0, \"c\":1}", "{\"c\":1, \"a\":0}")); assertFalse(JSON.equals("{\"a\":0}", "{\"a\":0, \"b\":0}")); assertFalse(JSON.equals("{\"a\":0, \"b\":0}", "{\"a\":0}")); assertFalse(JSON.equals("[\"a\",\"b\"]", "[\"b\",\"a\"]")); assertFalse(JSON.equals("{\"a\":null}", "{}")); assertEquals(9223372036854775807L, Long.MAX_VALUE); assertTrue(JSON.equals("{\"a\": 9223372036854775807}", "{\"a\": 9223372036854775807}")); assertTrue(JSON.equals("{\"a\": 1}", "{\"a\": 1}")); assertTrue(JSON.equals("{\"a\": 1.0}", "{\"a\": 1.0}")); assertFalse(JSON.equals("{\"a\": 1.0}", "{\"a\": 1}")); assertTrue(JSON.equals("{\"e\": 2.71828182845904}", "{\"e\": 2.71828182845904}")); assertTrue(JSON.equals("{\"e\": 1.7976931348623156e+308}", "{\"e\": 1.7976931348623156e+308}")); double e1 = 2.7182818284590452354; double e2 = 2.718281828459045; double e3 = 2.71828182845904; assertEquals(e1, Math.E, -1); assertEquals(e1, e2, -1); assertNotEquals(e1, e3, -1); assertRuntimeException(() -> JSON.equals("", "{}")); assertRuntimeException(() -> JSON.equals("{}", "")); assertRuntimeException(() -> JSON.equals("{", "{}")); assertRuntimeException(() -> JSON.equals("{}", "{")); }
public static boolean equals(String left, String right) { Slime leftSlime = SlimeUtils.jsonToSlimeOrThrow(left); Slime rightSlime = SlimeUtils.jsonToSlimeOrThrow(right); return leftSlime.equalTo(rightSlime); }
JSON { public static boolean equals(String left, String right) { Slime leftSlime = SlimeUtils.jsonToSlimeOrThrow(left); Slime rightSlime = SlimeUtils.jsonToSlimeOrThrow(right); return leftSlime.equalTo(rightSlime); } }
JSON { public static boolean equals(String left, String right) { Slime leftSlime = SlimeUtils.jsonToSlimeOrThrow(left); Slime rightSlime = SlimeUtils.jsonToSlimeOrThrow(right); return leftSlime.equalTo(rightSlime); } private  JSON(); }
JSON { public static boolean equals(String left, String right) { Slime leftSlime = SlimeUtils.jsonToSlimeOrThrow(left); Slime rightSlime = SlimeUtils.jsonToSlimeOrThrow(right); return leftSlime.equalTo(rightSlime); } private  JSON(); static String encode(Map<String, ?> map); static String escape(String s); static boolean equals(String left, String right); }
JSON { public static boolean equals(String left, String right) { Slime leftSlime = SlimeUtils.jsonToSlimeOrThrow(left); Slime rightSlime = SlimeUtils.jsonToSlimeOrThrow(right); return leftSlime.equalTo(rightSlime); } private  JSON(); static String encode(Map<String, ?> map); static String escape(String s); static boolean equals(String left, String right);  }