refactoring and implementing clippy suggestions
This commit is contained in:
parent
3952091018
commit
2db2ef2ea1
5 changed files with 45 additions and 51 deletions
28
src/syntax/check/test.rs
Normal file
28
src/syntax/check/test.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
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))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue