def test(): from pyrepl.unix_console import UnixConsole reader = HistoricalReader(UnixConsole()) reader.ps1 = "h**> " reader.ps2 = "h/*> " reader.ps3 = "h|*> " reader.ps4 = "h\*> " while reader.readline(): pass
def test(): class TestReader(CompletingReader): def get_completions(self, stem): return [s for l in map(lambda x:x.split(),self.history) for s in l if s and s.startswith(stem)] reader = TestReader() reader.ps1 = "c**> " reader.ps2 = "c/*> " reader.ps3 = "c|*> " reader.ps4 = "c\*> " while reader.readline(): pass