summaryrefslogtreecommitdiffstats
path: root/tests/character.rs
blob: c9b27b1e92682e23799fc2983c654bb717d41c2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use ansi_term::Color;
use starship::segment::Segment;
use std::path::Path;

mod common;

#[test]
fn char_section_success_status() {
    let dir = Path::new("~");
    let expected = Segment::new("char")
        .set_value("➜")
        .set_style(Color::Green)
        .set_prefix(None)
        .output();
    let actual = common::render_segment_with_status("char", &dir, "0");
    assert_eq!(expected, actual);
}

#[test]
fn char_section_failure_status() {
    let dir = Path::new("~");
    let expected = Segment::new("char")
        .set_value("➜")
        .set_style(Color::Red)
        .set_prefix(None)
        .output();
    let actual = common::render_segment_with_status("char", &dir, "1");
    assert_eq!(expected, actual);
}