MCPcopy Index your code
hub / github.com/endbasic/endbasic / add_output_bytes

Method add_output_bytes

std/src/console/readline.rs:569–579  ·  view source on GitHub ↗

Adds a bunch of `bytes` as separate console writes to the expected output.

(mut self, bytes: &'static str)

Source from the content-addressed store, hash-verified

567
568 /// Adds a bunch of `bytes` as separate console writes to the expected output.
569 fn add_output_bytes(mut self, bytes: &'static str) -> Self {
570 if bytes.is_empty() {
571 self.exp_output.push(CapturedOut::Write("".to_string()))
572 } else {
573 for b in bytes.chars() {
574 let mut buf = [0u8; 4];
575 self.exp_output.push(CapturedOut::Write(b.encode_utf8(&mut buf).to_string()));
576 }
577 }
578 self
579 }
580
581 /// Sets the size of the console.
582 fn set_size_chars(mut self, size: CharsXY) -> Self {

Calls 3

pushMethod · 0.80
charsMethod · 0.80
is_emptyMethod · 0.45