| 139 | } |
| 140 | |
| 141 | static void cjson_compare_should_compare_arrays(void) |
| 142 | { |
| 143 | TEST_ASSERT_TRUE(compare_from_string("[]", "[]", true)); |
| 144 | TEST_ASSERT_TRUE(compare_from_string("[]", "[]", false)); |
| 145 | |
| 146 | TEST_ASSERT_TRUE(compare_from_string("[false,true,null,42,\"string\",[],{}]", "[false, true, null, 42, \"string\", [], {}]", true)); |
| 147 | TEST_ASSERT_TRUE(compare_from_string("[false,true,null,42,\"string\",[],{}]", "[false, true, null, 42, \"string\", [], {}]", false)); |
| 148 | |
| 149 | TEST_ASSERT_TRUE(compare_from_string("[[[1], 2]]", "[[[1], 2]]", true)); |
| 150 | TEST_ASSERT_TRUE(compare_from_string("[[[1], 2]]", "[[[1], 2]]", false)); |
| 151 | |
| 152 | TEST_ASSERT_FALSE(compare_from_string("[true,null,42,\"string\",[],{}]", "[false, true, null, 42, \"string\", [], {}]", true)); |
| 153 | TEST_ASSERT_FALSE(compare_from_string("[true,null,42,\"string\",[],{}]", "[false, true, null, 42, \"string\", [], {}]", false)); |
| 154 | |
| 155 | /* Arrays that are a prefix of another array */ |
| 156 | TEST_ASSERT_FALSE(compare_from_string("[1,2,3]", "[1,2]", true)); |
| 157 | TEST_ASSERT_FALSE(compare_from_string("[1,2,3]", "[1,2]", false)); |
| 158 | } |
| 159 | |
| 160 | static void cjson_compare_should_compare_objects(void) |
| 161 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…