erudite 1.0.0

A fully-asynchronous, sandboxed, language-agnostic, test running library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::io::Write;

fn main() {
    let line = std::io::stdin().lines().next().unwrap().unwrap();
    let (cmd, rest) = if let Some(space) = line.find(char::is_whitespace) {
        (&line[..space], &line[space + 1..])
    } else {
        (&*line, "")
    };
    match (cmd, rest) {
        ("non-utf8", _) => std::io::stdout()
            .write_all(&[0xf0, 0x28, 0x8c, 0x28])
            .unwrap(),
        ("echo", rest) => std::io::stdout().write_all(rest.as_bytes()).unwrap(),
        _ => panic!("unexpected command '{line}'"),
    }
}