mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-22 18:19:54 -04:00
MAINT: Tests for fail and trace expressions.
This commit is contained in:
parent
aa9e664c0d
commit
f3a08718dc
@ -265,6 +265,28 @@ fn test_not_expr_printing() {
|
|||||||
assert_eq!(String::from_utf8(buffer).unwrap(), format!("{}\n", input));
|
assert_eq!(String::from_utf8(buffer).unwrap(), format!("{}\n", input));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_fail_expr_printing() {
|
||||||
|
let input = "fail \"AHHh\";";
|
||||||
|
let stmts = assert_parse(input);
|
||||||
|
let mut buffer: Vec<u8> = Vec::new();
|
||||||
|
let mut printer = AstPrinter::new(2, &mut buffer);
|
||||||
|
printer.render(&stmts);
|
||||||
|
assert!(printer.err.is_none());
|
||||||
|
assert_eq!(String::from_utf8(buffer).unwrap(), format!("{}\n", input));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_trace_expr_printing() {
|
||||||
|
let input = "TRACE \"AHHh\";";
|
||||||
|
let stmts = assert_parse(input);
|
||||||
|
let mut buffer: Vec<u8> = Vec::new();
|
||||||
|
let mut printer = AstPrinter::new(2, &mut buffer);
|
||||||
|
printer.render(&stmts);
|
||||||
|
assert!(printer.err.is_none());
|
||||||
|
assert_eq!(String::from_utf8(buffer).unwrap(), format!("{}\n", input));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_module_no_out_expr_printing() {
|
fn test_module_no_out_expr_printing() {
|
||||||
let input = "let m = module {
|
let input = "let m = module {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user