232233234235236237238239240241242
r.setWriter( new PrintWriter( s ) ); ATermAppl C = term( "C" ); ATermAppl p = term( "p" ); r.visit( some( p, C ) ); String expected = "(p some C)"; String actual = s.toString(); assertEquals( expected, actual );
250251252253254255256257258259260
ATermAppl C = term( "C" ); ATermAppl D = term( "D" ); ATermAppl p = term( "p" ); r.visit( and( C, some( p, D ) )); String expected = "(C and (p some D))"; String actual = s.toString(); assertEquals( expected, actual );
6162636465666768697071
r.setWriter( new PrintWriter( s ) ); ATermAppl C = term( "C" ); ATermAppl p = term( "p" ); r.visit( all( p, C ) ); String expected = "(p only C)"; String actual = s.toString(); assertEquals( expected, actual );
7980818283848586878889
ATermAppl C = term( "C" ); ATermAppl D = term( "D" ); ATermAppl E = term( "E" ); r.visit( and( C, D, E ) ); String expected = "(C and D and E)"; String actual = s.toString(); assertEquals( expected, actual );
96979899100101102103104105106
r.setWriter( new PrintWriter( s ) ); ATermAppl l = literal( "foobar" ); ATermAppl p = term( "p" ); r.visit( hasValue( p, l ) ); String expected = "(p value \"foobar\")"; String actual = s.toString(); assertEquals( expected, actual );
112113114115116117118119120121122
ATermRenderer r = new ATermManchesterSyntaxRenderer(); r.setWriter( new PrintWriter( s ) ); ATermAppl p = term( "p" ); r.visit( inv( p ) ); String expected = "inverse p"; String actual = s.toString(); assertEquals( expected, actual );
129130131132133134135136137138139
r.setWriter( new PrintWriter( s ) ); ATermAppl C = term( "C" ); ATermAppl p = term( "p" ); r.visit( max( p, 3, C ) ); String expected = "(p max 3 C)"; String actual = s.toString(); assertEquals( expected, actual );
146147148149150151152153154155156
r.setWriter( new PrintWriter( s ) ); ATermAppl C = term( "C" ); ATermAppl p = term( "p" ); r.visit( min( p, 3, C ) ); String expected = "(p min 3 C)"; String actual = s.toString(); assertEquals( expected, actual );
162163164165166167168169170171172
ATermRenderer r = new ATermManchesterSyntaxRenderer(); r.setWriter( new PrintWriter( s ) ); ATermAppl C = term( "C" ); r.visit( not( C ) ); String expected = "not C"; String actual = s.toString(); assertEquals( expected, actual );
180181182183184185186187188189190
ATermAppl C = term( "C" ); ATermAppl D = term( "D" ); ATermAppl E = term( "E" ); r.visit( oneOf( C, D, E ) ); // oneOf inserts new list elements on top of the list String expected = "{E D C}"; String actual = s.toString();