Fix test
This commit is contained in:
parent
c00effcbdd
commit
1673fd1cf9
@ -289,13 +289,18 @@ impl<'a> State<'a> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod eval_tests {
|
mod eval_tests {
|
||||||
|
use std::cell::RefCell;
|
||||||
|
use std::rc::Rc;
|
||||||
|
use typechecking::TypeContext;
|
||||||
use tokenizing::tokenize;
|
use tokenizing::tokenize;
|
||||||
use parsing::parse;
|
use parsing::parse;
|
||||||
use eval::State;
|
use eval::State;
|
||||||
|
|
||||||
macro_rules! fresh_env {
|
macro_rules! fresh_env {
|
||||||
($string:expr, $correct:expr) => {
|
($string:expr, $correct:expr) => {
|
||||||
let mut state = State::new(None);
|
|
||||||
|
let type_context = Rc::new(RefCell::new(TypeContext::new()));
|
||||||
|
let mut state = State::new(type_context);
|
||||||
let all_output = state.evaluate(parse(tokenize($string)).0.unwrap().reduce(), true);
|
let all_output = state.evaluate(parse(tokenize($string)).0.unwrap().reduce(), true);
|
||||||
let ref output = all_output.last().unwrap();
|
let ref output = all_output.last().unwrap();
|
||||||
assert_eq!(**output, Ok($correct.to_string()));
|
assert_eq!(**output, Ok($correct.to_string()));
|
||||||
|
Loading…
Reference in New Issue
Block a user