From c68287297b1b78387aa6e5e078c1e5f4766bdb6f Mon Sep 17 00:00:00 2001 From: "Paul J. Davis" Date: Tue, 31 Oct 2017 12:10:49 -0500 Subject: [PATCH] Add tests for deduplication in child objects --- test/jiffy_16_dedupe_keys_tests.erl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/jiffy_16_dedupe_keys_tests.erl b/test/jiffy_16_dedupe_keys_tests.erl index a17c474..18b5394 100644 --- a/test/jiffy_16_dedupe_keys_tests.erl +++ b/test/jiffy_16_dedupe_keys_tests.erl @@ -33,6 +33,16 @@ dedupe_keys_test_() -> {[{<<"foo">>, 1}, {<<"foo">>, 2}, {<<"foo">>, 3}]}, {[{<<"foo">>, 3}]} }, + % Sub-objects are covered + { + {[{<<"foo">>, {[{<<"bar">>, 1}, {<<"bar">>, 2}]}}]}, + {[{<<"foo">>, {[{<<"bar">>, 2}]}}]} + }, + % Objets in arrays are handled + { + [{[{<<"foo">>, 1}, {<<"foo">>, 2}]}], + [{[{<<"foo">>, 2}]}] + }, % Embedded NULL bytes are handled { {[{<<"foo\\u0000bar">>, 1}, {<<"foo\\u0000baz">>, 2}]},