public class TestParsingPsBegin extends TestPSTParser {
@Test
public void testPspictureWithGridAndShapesBasic() throws ParseException {
IGroup group = parser.parsePSTCode("\\pspicture(0,0)(2,2)\n\\psgrid\n\\psframe(0,0)(2,2)\n\\psframe(1,1)(3,3)\n\\endpspicture").get(); //$NON-NLS-1$
IGrid grid = (IGrid)group.getShapeAt(0);
IRectangle rec1 = (IRectangle)group.getShapeAt(1);
IRectangle rec2 = (IRectangle)group.getShapeAt(2);
assertTrue(PSTParser.errorLogs().isEmpty());
assertEquals(0., grid.getPosition().getX(), 0.001);
assertEquals(0., grid.getPosition().getY(), 0.001);
assertEquals(0., rec1.getPosition().getX(), 0.001);
assertEquals(0., rec1.getPosition().getY(), 0.001);
assertEquals(IShape.PPC, rec2.getPosition().getX(), 0.001);
assertEquals(-(double)IShape.PPC, rec2.getPosition().getY(), 0.001);
}