public void testAdd() { Graph l = graphWith( "x R y" ); Graph r = graphWith( "p S q" ); Intersection isec = new Intersection( l, r ); assertIsomorphic( graphWith( "" ), isec ); isec.add( triple( "r A s" ) ); assertIsomorphic( graphWith( "r A s" ), isec ); assertIsomorphic( graphWith( "x R y; r A s" ), l ); assertIsomorphic( graphWith( "p S q; r A s" ), r ); isec.add( triple ( "x R y" ) ); assertIsomorphic( graphWith( "r A s; x R y" ), isec ); assertIsomorphic( graphWith( "x R y; r A s" ), l ); assertIsomorphic( graphWith( "p S q; r A s; x R y" ), r ); isec.add( triple ( "p S q" ) ); assertIsomorphic( graphWith( "p S q; r A s; x R y" ), isec ); assertIsomorphic( graphWith( "p S q; r A s; x R y" ), l ); assertIsomorphic( graphWith( "p S q; r A s; x R y" ), r ); }
public void testAdd() { Graph l = graphWith( "x R y" ); Graph r = graphWith( "p S q" ); Intersection isec = new Intersection( l, r ); assertIsomorphic( graphWith( "" ), isec ); isec.add( triple( "r A s" ) ); assertIsomorphic( graphWith( "r A s" ), isec ); assertIsomorphic( graphWith( "x R y; r A s" ), l ); assertIsomorphic( graphWith( "p S q; r A s" ), r ); isec.add( triple ( "x R y" ) ); assertIsomorphic( graphWith( "r A s; x R y" ), isec ); assertIsomorphic( graphWith( "x R y; r A s" ), l ); assertIsomorphic( graphWith( "p S q; r A s; x R y" ), r ); isec.add( triple ( "p S q" ) ); assertIsomorphic( graphWith( "p S q; r A s; x R y" ), isec ); assertIsomorphic( graphWith( "p S q; r A s; x R y" ), l ); assertIsomorphic( graphWith( "p S q; r A s; x R y" ), r ); }
@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); }