mirror of
				https://forge.katzen.cafe/katzen-cafe/iowo.git
				synced 2025-10-29 08:37:57 +01:00 
			
		
		
		
	finish syntax checks
This commit is contained in:
		
					parent
					
						
							
								2db2ef2ea1
							
						
					
				
			
			
				commit
				
					
						a07a031e0c
					
				
			
		
					 4 changed files with 182 additions and 19 deletions
				
			
		|  | @ -1,5 +1,8 @@ | |||
| use crate::syntax::{ | ||||
|     check::{check_missing_filters, check_missing_sink, check_missing_streamer}, | ||||
|     check::{ | ||||
|         check_literal_as_filter, check_literal_as_sink, check_literal_with_args, | ||||
|         check_missing_filters, check_missing_sink, check_missing_streamer, | ||||
|     }, | ||||
|     parse_syntax, | ||||
| }; | ||||
| 
 | ||||
|  | @ -26,3 +29,30 @@ fn test_check_missing_sink() { | |||
| 
 | ||||
|     assert_eq!(check_missing_sink(&syntax), Err(14..15)) | ||||
| } | ||||
| 
 | ||||
| #[test] | ||||
| fn test_check_literal_as_sink() { | ||||
|     let test_data = "meow | test | 3"; | ||||
|     let syntax = parse_syntax(test_data).unwrap(); | ||||
| 
 | ||||
|     assert_eq!(check_literal_as_sink(&syntax), Err(14..15)) | ||||
| } | ||||
| 
 | ||||
| #[test] | ||||
| fn test_check_literal_as_filter() { | ||||
|     let test_data = "meow | \"gay\" | 42 | 3.14 | uwu"; | ||||
|     let syntax = parse_syntax(test_data).unwrap(); | ||||
| 
 | ||||
|     assert_eq!( | ||||
|         check_literal_as_filter(&syntax), | ||||
|         Err(vec![7..12, 15..17, 20..24]) | ||||
|     ) | ||||
| } | ||||
| 
 | ||||
| #[test] | ||||
| fn test_check_literal_with_args() { | ||||
|     let test_data = "14 12 | sink"; | ||||
|     let syntax = parse_syntax(test_data).unwrap(); | ||||
| 
 | ||||
|     assert_eq!(check_literal_with_args(&syntax), Err(0..5)) | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Schrottkatze
				Schrottkatze