Add a couple build tests.
This commit is contained in:
parent
7399a8748c
commit
cce927d964
@ -56,7 +56,6 @@ pub mod build {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod build_tests {
|
mod build_tests {
|
||||||
use std::process::id;
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::parser::DeimosParser;
|
use crate::parser::DeimosParser;
|
||||||
use pest::Parser;
|
use pest::Parser;
|
||||||
@ -109,5 +108,26 @@ pub mod build {
|
|||||||
let pair = parse(Rule::DStringExpression, "${thing}");
|
let pair = parse(Rule::DStringExpression, "${thing}");
|
||||||
let d_string_expression = build_d_string_expression(pair);
|
let d_string_expression = build_d_string_expression(pair);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn d_string_inner() {
|
||||||
|
let pair = parse(Rule::DStringInner, "Hello!");
|
||||||
|
let d_string_inner = build_d_string_inner(pair);
|
||||||
|
assert_eq!("Hello!", d_string_inner);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn d_string_mixed() {
|
||||||
|
let pair = parse(Rule::DString, "\"Hello, ${world}!\"");
|
||||||
|
let d_string = build_d_string(pair);
|
||||||
|
assert_eq!(d_string.inners().count(), 2);
|
||||||
|
assert_eq!(d_string.expressions().count(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn expression_simple_call() {
|
||||||
|
let pair = parse(Rule::Expression, "hello(42)");
|
||||||
|
let expression = build_expression(pair);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user