def test_three_rights_dont_make_a_pun(self): run_and_check( self, "3R", [ [ "R",[0, 0],[0, -1],[] ], [ "R",[0, 0],[-1, 0],[] ], [ "R",[0, 0],[0, 1],[] ], ])
def test_three_lefts_make_a_right(self): run_and_check( self, "3L", [ [ "L",[0, 0],[0, 1],[] ], [ "L",[0, 0],[-1, 0],[] ], [ "L",[0, 0],[0, -1],[] ], ])
def test_square(self): run_and_check( self, "FLFLFLF", [ [ 'F',[1, 0],[1, 0],[] ], [ 'L',[1, 0],[0, 1],[] ], [ 'F',[1, 1],[0, 1],[] ], [ 'L',[1, 1],[-1, 0],[] ], [ 'F',[0, 1],[-1, 0],[] ], [ 'L',[0, 1],[0, -1],[] ], [ 'F',[0, 0],[0,-1],[] ] ])
def test_simple_block(self): run_and_check( self, "[FL]F[LF]LF", [ ['F', [1, 0], [1, 0], []], ['L', [1, 0], [0, 1], []], ['F', [1, 1], [0, 1], []], ['L', [1, 1], [-1, 0], []], ['F', [0, 1], [-1, 0], []], ['L', [0, 1], [0, -1], []], ['F', [0, 0], [0, -1], []] ])
def test_block_with_count(self): run_and_check( self, "F3[LF]", [ ['F', [1, 0], [1, 0], []], ['L', [1, 0], [0, 1], []], ['F', [1, 1], [0, 1], []], ['L', [1, 1], [-1, 0], []], ['F', [0, 1], [-1, 0], []], ['L', [0, 1], [0, -1], []], ['F', [0, 0], [0, -1], []] ])
def test_non_count(self): run_and_check( self, "FLFLFLF", [ ['F', [1, 0], [1, 0], []], ['L', [1, 0], [0, 1], []], ['F', [1, 1], [0, 1], []], ['L', [1, 1], [-1, 0], []], ['F', [0, 1], [-1, 0], []], ['L', [0, 1], [0, -1], []], ['F', [0, 0], [0, -1], []] ])
def test_square_with_count(self): run_and_check( self, "2FL2FL2FL2F", [ [ "F",[1, 0],[1, 0],[] ], [ "F",[2, 0],[1, 0],[] ], [ "L",[2, 0],[0, 1],[] ], [ "F",[2, 1],[0, 1],[] ], [ "F",[2, 2],[0, 1],[] ], [ "L",[2, 2],[-1, 0],[] ], [ "F",[1, 2],[-1, 0],[] ], [ "F",[0, 2],[-1, 0],[] ], [ "L",[0, 2],[0, -1],[] ], [ "F",[0, 1],[0, -1],[] ], [ "F",[0, 0],[0, -1],[] ], ])
def test_collect_square(self): run_and_check(self, "P FP LFP LFP LF DDDD ", [ ["P", [0, 0], [1, 0], [[0, 0]]], ["F", [1, 0], [1, 0], [[0, 0]]], ["P", [1, 0], [1, 0], [[0, 0], [1, 0]]], ["L", [1, 0], [0, 1], [[0, 0], [1, 0]]], ["F", [1, 1], [0, 1], [[0, 0], [1, 0]]], ["P", [1, 1], [0, 1], [[0, 0], [1, 0], [1, 1]]], ["L", [1, 1], [-1, 0], [[0, 0], [1, 0], [1, 1]]], ["F", [0, 1], [-1, 0], [[0, 0], [1, 0], [1, 1]]], ["P", [0, 1], [-1, 0], [[0, 0], [1, 0], [1, 1], [0, 1]]], ["L", [0, 1], [0, -1], [[0, 0], [1, 0], [1, 1], [0, 1]]], ["F", [0, 0], [0, -1], [[0, 0], [1, 0], [1, 1], [0, 1]]], ["D", [0, 0], [0, -1], [[0, 0], [1, 0], [1, 1]]], ["D", [0, 0], [0, -1], [[0, 0], [1, 0]]], ["D", [0, 0], [0, -1], [[0, 0]]], ["D", [0, 0], [0, -1], []], ])
def test_nested_block(self): run_and_check( self, "2[3[FL]L]", [ [ "F",[1, 0],[1, 0],[] ], [ "L",[1, 0],[0, 1],[] ], [ "F",[1, 1],[0, 1],[] ], [ "L",[1, 1],[-1, 0],[] ], [ "F",[0, 1],[-1, 0],[] ], [ "L",[0, 1],[0, -1],[] ], [ "L",[0, 1],[1, 0],[] ], [ "F",[1, 1],[1, 0],[] ], [ "L",[1, 1],[0, 1],[] ], [ "F",[1, 2],[0, 1],[] ], [ "L",[1, 2],[-1, 0],[] ], [ "F",[0, 2],[-1, 0],[] ], [ "L",[0, 2],[0, -1],[] ], [ "L",[0, 2],[1, 0],[] ], ])
def test_single_pickdrop(self): run_and_check(self, "PD", [ ["P", [0, 0], [1, 0], [[0, 0]]], ["D", [0, 0], [1, 0], []], ])
def test_single_pick(self): run_and_check(self, "P", [["P", [0, 0], [1, 0], [[0, 0]]]])
def test_rotation_doesnt_move(self): run_and_check(self, "R", [["R",[0, 0],[0, -1],[]]]) run_and_check(self, "L", [["L",[0, 0],[0, 1],[]]])
def test_single_command(self): run_and_check(self, "F", [["F",[1, 0],[1, 0],[]]])