// Path: src/main/java/org/skyscreamer/jsonassert/JSONCompare.java
// public static JSONCompareResult compareJSON(String expectedStr, String actualStr, JSONComparator comparator)
//         throws JSONException {
//     Object expected = JSONParser.parseJSON(expectedStr);
//     Object actual = JSONParser.parseJSON(actualStr);
//     if ((expected instanceof JSONObject) && (actual instanceof JSONObject)) {
//         return compareJSON((JSONObject) expected, (JSONObject) actual, comparator);
//     }
//     else if ((expected instanceof JSONArray) && (actual instanceof JSONArray)) {
//         return compareJSON((JSONArray)expected, (JSONArray)actual, comparator);
//     }
//     else if (expected instanceof JSONString && actual instanceof JSONString) {
//         return compareJson((JSONString) expected, (JSONString) actual);
//     }
//     else if (expected instanceof JSONObject) {
//         return new JSONCompareResult().fail("", expected, actual);
//     }
//     else {
//         return new JSONCompareResult().fail("", expected, actual);
//     }
// }


import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.skyscreamer.jsonassert.JSONCompare.compareJSON;
import static org.skyscreamer.jsonassert.JSONCompareMode.LENIENT;
import static org.skyscreamer.jsonassert.JSONCompareMode.NON_EXTENSIBLE;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.json.JSONException;
import org.junit.Test;
import org.junit.internal.matchers.TypeSafeMatcher;
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

package org.skyscreamer.jsonassert;



/**
 * Unit tests for {@code JSONCompare}.
 */
public class JSONCompareTest {
    @Test
    public void succeedsWithEmptyArrays() throws JSONException {
// Path: src/main/java/org/skyscreamer/jsonassert/JSONCompare.java
// public static JSONCompareResult compareJSON(String expectedStr, String actualStr, JSONComparator comparator)
//         throws JSONException {
//     Object expected = JSONParser.parseJSON(expectedStr);
//     Object actual = JSONParser.parseJSON(actualStr);
//     if ((expected instanceof JSONObject) && (actual instanceof JSONObject)) {
//         return compareJSON((JSONObject) expected, (JSONObject) actual, comparator);
//     }
//     else if ((expected instanceof JSONArray) && (actual instanceof JSONArray)) {
//         return compareJSON((JSONArray)expected, (JSONArray)actual, comparator);
//     }
//     else if (expected instanceof JSONString && actual instanceof JSONString) {
//         return compareJson((JSONString) expected, (JSONString) actual);
//     }
//     else if (expected instanceof JSONObject) {
//         return new JSONCompareResult().fail("", expected, actual);
//     }
//     else {
//         return new JSONCompareResult().fail("", expected, actual);
//     }
// }


// Path: src/test/java/org/skyscreamer/jsonassert/JSONCompareTest.java
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.skyscreamer.jsonassert.JSONCompare.compareJSON;
import static org.skyscreamer.jsonassert.JSONCompareMode.LENIENT;
import static org.skyscreamer.jsonassert.JSONCompareMode.NON_EXTENSIBLE;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.json.JSONException;
import org.junit.Test;
import org.junit.internal.matchers.TypeSafeMatcher;

/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

package org.skyscreamer.jsonassert;



/**
 * Unit tests for {@code JSONCompare}.
 */
public class JSONCompareTest {
    @Test
    public void succeedsWithEmptyArrays() throws JSONException {
        assertTrue(compareJSON("[]", "[]", LENIENT).passed());