frostwalker/tests/integration.rs

31 lines
798 B
Rust
Raw Normal View History

use frostwalker::lexer;
2024-01-17 21:03:41 +00:00
use frostwalker::validator;
#[test]
fn lv_single_key() {
let tree = lexer::tokenize("key = \"value\"");
let result = validator::validate(&tree);
assert_eq!(result.is_none(), true);
}
#[test]
fn lv_triple_key() {
let tree = lexer::tokenize("key = \"value\"\r\nkey1 = 128\nkey2 = [ 6, 7 ]");
let result = validator::validate(&tree);
assert_eq!(result.is_none(), true);
}
#[test]
fn lv_triple_key_missing_newline() {
let tree = lexer::tokenize("key = \"value\"key1 = 128\nkey2 = [ 6, 7 ]");
let result = validator::validate(&tree);
assert_eq!(result.is_some(), true);
}
#[test]
fn lv_double_equals() {
let tree = lexer::tokenize("key = = \"value\"\r\nkey1 = 128\nkey2 = [ 6, 7 ]");
let result = validator::validate(&tree);
assert_eq!(result.is_some(), true);
}