summaryrefslogtreecommitdiffstats
path: root/tests/test_pretty_printer.rs
blob: 2ddfc7d5b5f5b48c02e91743e94a1e2d98354773 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use bat::PrettyPrinter;

#[test]
fn syntaxes() {
    let printer = PrettyPrinter::new();
    let syntaxes: Vec<String> = printer.syntaxes().map(|s| s.name).collect();

    // Just do some sanity checking
    assert!(syntaxes.contains(&"Rust".to_string()));
    assert!(syntaxes.contains(&"Java".to_string()));
    assert!(!syntaxes.contains(&"this-language-does-not-exist".to_string()));

    // This language exists but is hidden, so we should not see it; it shall
    // have been filtered out before getting to us
    assert!(!syntaxes.contains(&"Git Common".to_string()));
}