From 1aac072224e1ab8e3fee3a17840af7922ee6400b Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 31 Oct 2015 03:12:49 +0100 Subject: [PATCH] additional test coverage to document "shallow match" --- tests/library/diff/gen-node-basic-test.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/library/diff/gen-node-basic-test.cpp b/tests/library/diff/gen-node-basic-test.cpp index cbc7d9875..ce4444b30 100644 --- a/tests/library/diff/gen-node-basic-test.cpp +++ b/tests/library/diff/gen-node-basic-test.cpp @@ -904,6 +904,17 @@ namespace test{ // string match is literal CHECK (!nz1.matches(" ")); CHECK (!nz2.matches("↯ ")); + + GenNode copy(ni1); + CHECK (copy == ni1); + + copy.data = 2*i1; + CHECK (copy != ni1); + CHECK (copy.idi == ni1.idi); + CHECK (not copy.data.matchData(ni1.data)); + + // NOTE: "match" operation is shallow on records + CHECK (copy.matches(ni1)); CHECK (ni1.matches(copy)); } };