public VT100UI() { InitializeComponent(); Sci.LoadDll(".\\lib\\$(platform)\\$(config)"); var settings = new VT100.Settings(); var buffer = new VT100.Buffer(settings); var term = new VT100Display(buffer) { Dock = DockStyle.Fill }; buffer.Output(VT100.Buffer.TestConsoleString0); buffer.Output(VT100.Buffer.TestConsoleString1); buffer.Output("This string should be deleted " + "\x1b[0G\x1b[K" + "Replaced by this string"); Controls.Add(term); }
[Test] public void Robustness() { // Blast the buffer with noise to make sure it can handle any input var settings = new VT100.Settings(); var buf = new VT100.Buffer(settings); buf.ReportUnsupportedEscapeSequences = false; var rnd = new Random(0); for (int i = 0; i != 10000; ++i) { var noise = rnd.Bytes().Take(rnd.Next(1000)).Select(x => (char)x).ToArray(); buf.Output(new string(noise)); } }