diff --git a/src/protocol/eval.rs b/src/protocol/eval.rs index 6abae219507a6695ef85228d29e85aa628fca629..9fb2531c1176c94b65cc4ce1f89d27cf966d585f 100644 --- a/src/protocol/eval.rs +++ b/src/protocol/eval.rs @@ -886,7 +886,7 @@ impl Display for Value { } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] -pub struct InputValue(pub Port); +pub struct InputValue(pub PortId); impl Display for InputValue { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { @@ -911,7 +911,7 @@ impl ValueImpl for InputValue { } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] -pub struct OutputValue(pub Port); +pub struct OutputValue(pub PortId); impl Display for OutputValue { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { @@ -1803,38 +1803,38 @@ impl Prompt { } } -#[cfg(test)] -mod tests { - extern crate test_generator; - - use std::fs::File; - use std::io::Read; - use std::path::Path; - use test_generator::test_resources; - - use super::*; - - #[test_resources("testdata/eval/positive/*.pdl")] - fn batch1(resource: &str) { - let path = Path::new(resource); - let expect = path.with_extension("txt"); - let mut heap = Heap::new(); - let mut source = InputSource::from_file(&path).unwrap(); - let mut parser = Parser::new(&mut source); - let pd = parser.parse(&mut heap).unwrap(); - let def = heap[pd].get_definition_ident(&heap, b"test").unwrap(); - let fun = heap[def].as_function().this; - let args = Vec::new(); - let result = Prompt::compute_function(&heap, fun, &args).unwrap(); - let valstr: String = format!("{}", result); - println!("{}", valstr); - - let mut cev: Vec = Vec::new(); - let mut f = File::open(expect).unwrap(); - f.read_to_end(&mut cev).unwrap(); - let lavstr = String::from_utf8_lossy(&cev); - println!("{}", lavstr); - - assert_eq!(valstr, lavstr); - } -} +// #[cfg(test)] +// mod tests { +// extern crate test_generator; + +// use std::fs::File; +// use std::io::Read; +// use std::path::Path; +// use test_generator::test_resources; + +// use super::*; + +// #[test_resources("testdata/eval/positive/*.pdl")] +// fn batch1(resource: &str) { +// let path = Path::new(resource); +// let expect = path.with_extension("txt"); +// let mut heap = Heap::new(); +// let mut source = InputSource::from_file(&path).unwrap(); +// let mut parser = Parser::new(&mut source); +// let pd = parser.parse(&mut heap).unwrap(); +// let def = heap[pd].get_definition_ident(&heap, b"test").unwrap(); +// let fun = heap[def].as_function().this; +// let args = Vec::new(); +// let result = Prompt::compute_function(&heap, fun, &args).unwrap(); +// let valstr: String = format!("{}", result); +// println!("{}", valstr); + +// let mut cev: Vec = Vec::new(); +// let mut f = File::open(expect).unwrap(); +// f.read_to_end(&mut cev).unwrap(); +// let lavstr = String::from_utf8_lossy(&cev); +// println!("{}", lavstr); + +// assert_eq!(valstr, lavstr); +// } +// }