kingslayer 0.5.5

A text adventure dungeon crawler game written in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[cfg(test)]
mod tests {
    use kingslayer::Cli;

    #[test]
    fn player_inspect() {
        let cli = Cli::from_file("worlds/test_world.ron");

        assert_eq!(cli.ask("inspect leaf"), "It's small, brown, and dry.");
        cli.ask("take leaf");
        assert!(cli.ask("i").contains("leaf") && !cli.ask("l").contains("leaf"));
        assert_eq!(cli.ask("inspect leaf"), "It's small, brown, and dry.");
        cli.ask("drop leaf");
        assert!(cli.ask("l").contains("leaf") && !cli.ask("i").contains("leaf"));
        assert_eq!(cli.ask("x leaf"), "It's small, brown, and dry.");
    }
}