Skip to content
Snippets Groups Projects
Commit 898568e6 authored by y.zobus's avatar y.zobus
Browse files

few test fixes

parent 4df01f2e
No related branches found
No related tags found
1 merge request!10Resolve "allow graph vizualization also to be Left-> Right and not only Top->Bottom"
Pipeline #7461 failed
use std::fs::{File, read_to_string};
use std::fs::File;
use std::io::Write;
use opossum::{
......@@ -39,7 +39,7 @@ fn main() -> Result<(), OpossumError> {
let path = "src_detector.dot";
let mut output = File::create(path).unwrap();
write!(output, "{}", scenery.to_dot("LR")?).unwrap();
write!(output, "{}", scenery.to_dot("")?).unwrap();
scenery.report();
println!("");
......
......@@ -118,7 +118,7 @@ mod test {
assert_eq!(meter.meter_type, Metertype::IdealEnergyMeter);
assert_eq!(meter.node_type(), "energy meter");
assert_eq!(meter.is_detector(), true);
assert_eq!(meter.node_color(), "lightblue");
assert_eq!(meter.node_color(), "whitesmoke");
}
#[test]
fn meter_type() {
......
......@@ -5,7 +5,6 @@ use crate::optic_ports::OpticPorts;
use core::fmt::Debug;
use std::any::Any;
use std::collections::HashMap;
use std::fs;
pub type LightResult = HashMap<String, Option<LightData>>;
type Result<T> = std::result::Result<T, OpossumError>;
......@@ -489,7 +488,7 @@ mod test {
use super::OpticNode;
use crate::nodes::{Detector, Dummy, BeamSplitter, EnergyMeter, Source};
use crate::OpticScenery;
use std::{fs::File,io::{Write, Read}};
use std::{fs::File,io::Read};
#[test]
fn new() {
......@@ -530,12 +529,12 @@ mod test {
#[test]
fn to_dot(){
let path = "files_for_testing/to_dot_test_TB.dot";
let file_content_TB = &mut "".to_owned();
let _ = File::open(path).unwrap().read_to_string(file_content_TB);
let file_content_tb = &mut "".to_owned();
let _ = File::open(path).unwrap().read_to_string(file_content_tb);
let path = "files_for_testing/to_dot_test_LR.dot";
let file_content_LR = &mut "".to_owned();
let _ = File::open(path).unwrap().read_to_string(file_content_LR);
let file_content_lr = &mut "".to_owned();
let _ = File::open(path).unwrap().read_to_string(file_content_lr);
let mut scenery = OpticScenery::new();
let i_s = scenery.add_element(
......@@ -553,8 +552,8 @@ mod test {
let scenery_dot_str_tb = scenery.to_dot("TB").unwrap();
let scenery_dot_str_lr = scenery.to_dot("LR").unwrap();
assert_eq!(file_content_TB.clone(), scenery_dot_str_tb);
assert_eq!(file_content_LR.clone(), scenery_dot_str_lr);
assert_eq!(file_content_tb.clone(), scenery_dot_str_tb);
assert_eq!(file_content_lr.clone(), scenery_dot_str_lr);
}
#[test]
#[ignore]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment