def run_tests(): try: w = windows.focused w.blank() def check_at(s, a, forwards=True): check_items(vx.get_linecoloffset_of_str(w, s, int(forwards)), a) w.add_string( ''' Tests are being run ''') move.beg() w.add_string('öäå') move.beg() check_at('ä', (1, 2, 1)) check_at('ä', (1, 2, 1)) check_at('öäå', (1, 1, 0)) check_at('öäå\n', (1, 1, 0)) move.down() check_at('ö', (1, 1, 4), False) move.eol() check_at('ö', (1, 1, 23), False) check_at('ä', (1, 2, 22), False) vx.set_linecol_window(w, 1, 2) check_at('ä', (1, 2, 0)) check_at('å', (1, 3, 1)) check_at('öäå', (1, 1, 1), False) check_at('öäå\n', (1, 1, 1), False) check_at('å\n', (1, 3, 1)) for t in _tests: t() move.end() w.add_string(''' All tests have passed ''') except AssertionError as e: move.end() w.add_string('\n\n') w.add_string(traceback.format_exc())
def run_tests(): try: w = windows.focused w.blank() def check_at(s, a, forwards=True): check_items(vx.get_linecoloffset_of_str(w, s, int(forwards)), a) w.add_string(''' Tests are being run ''') move.beg() w.add_string('öäå') move.beg() check_at('ä', (1, 2, 1)) check_at('ä', (1, 2, 1)) check_at('öäå', (1, 1, 0)) check_at('öäå\n', (1, 1, 0)) move.down() check_at('ö', (1, 1, 4), False) move.eol() check_at('ö', (1, 1, 23), False) check_at('ä', (1, 2, 22), False) vx.set_linecol_window(w, 1, 2) check_at('ä', (1, 2, 0)) check_at('å', (1, 3, 1)) check_at('öäå', (1, 1, 1), False) check_at('öäå\n', (1, 1, 1), False) check_at('å\n', (1, 3, 1)) for t in _tests: t() move.end() w.add_string(''' All tests have passed ''') except AssertionError as e: move.end() w.add_string('\n\n') w.add_string(traceback.format_exc())
def _set_cursor(inst, linecol): if self is inst: line, col = linecol if line < la: return if line > lb: return if line == la and col < ca: return if line == lb and col > cb: return return vx.set_linecol_window(self, line, col)
def __set_cursor(self, linecol): line, col = linecol return vx.set_linecol_window(self, line, col)