@ContractTest public void testIntersection() { Graph g1 = graphWith( "x R y; p R q"); Graph g2 = graphWith( "r Foo s; x R y"); Intersection i = new Intersection(g1, g2); assertContains("Intersection", "x R y", i); assertOmits("Intersection", i, "p R q"); assertOmits("Intersection", i, "r Foo s"); if (i.size() != 1) fail("oops: size of intersection is not 1"); i.add(triple("cats eat cheese")); assertContains("Intersection.L", "cats eat cheese", g1); assertContains("Intersection.R", "cats eat cheese", g2); }
@ContractTest public void testIntersection() { Graph g1 = graphWith( "x R y; p R q"); Graph g2 = graphWith( "r Foo s; x R y"); Intersection i = new Intersection(g1, g2); assertContains("Intersection", "x R y", i); assertOmits("Intersection", i, "p R q"); assertOmits("Intersection", i, "r Foo s"); if (i.size() != 1) fail("oops: size of intersection is not 1"); i.add(triple("cats eat cheese")); assertContains("Intersection.L", "cats eat cheese", g1); assertContains("Intersection.R", "cats eat cheese", g2); }