forked from katzen-cafe/iowo
29 lines
757 B
Rust
29 lines
757 B
Rust
|
use crate::syntax::{
|
||
|
check::{check_missing_filters, check_missing_sink, check_missing_streamer},
|
||
|
parse_syntax,
|
||
|
};
|
||
|
|
||
|
#[test]
|
||
|
fn test_check_missing_streamer() {
|
||
|
let test_data = "| invert | save \"./image_processed.jpg\"";
|
||
|
let syntax = parse_syntax(test_data).unwrap();
|
||
|
|
||
|
assert_eq!(check_missing_streamer(&syntax), Err(0..1))
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn test_check_missing_filters() {
|
||
|
let test_data = "meow | | test | awa | | nya";
|
||
|
let syntax = parse_syntax(test_data).unwrap();
|
||
|
|
||
|
assert_eq!(check_missing_filters(&syntax), Err(vec![5..8, 20..25]))
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn test_check_missing_sink() {
|
||
|
let test_data = "meow | invert | ";
|
||
|
let syntax = parse_syntax(test_data).unwrap();
|
||
|
|
||
|
assert_eq!(check_missing_sink(&syntax), Err(14..15))
|
||
|
}
|