def test_clear_tabstops(): screen = Screen(10, 10) screen.clear_tab_stop(3) # a) clear a tabstop at current cusor location screen.cursor.x = 1 screen.set_tab_stop() screen.cursor.x = 5 screen.set_tab_stop() screen.clear_tab_stop() assert screen.tabstops == set([1]) screen.set_tab_stop() screen.clear_tab_stop(0) assert screen.tabstops == set([1]) # b) all tabstops screen.set_tab_stop() screen.cursor.x = 9 screen.set_tab_stop() screen.clear_tab_stop(3) assert not screen.tabstops
def test_tabstops(): screen = Screen(10, 10) # Making sure initial tabstops are in place ... assert screen.tabstops == set([7]) # ... and clearing them. screen.clear_tab_stop(3) assert not screen.tabstops screen.cursor.x = 1 screen.set_tab_stop() screen.cursor.x = 8 screen.set_tab_stop() screen.cursor.x = 0 screen.tab() assert screen.cursor.x == 1 screen.tab() assert screen.cursor.x == 8 screen.tab() assert screen.cursor.x == 9 screen.tab() assert screen.cursor.x == 9