aboutsummaryrefslogtreecommitdiffstats
path: root/src/modelica_ast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/modelica_ast.rs')
-rw-r--r--src/modelica_ast.rs52
1 files changed, 1 insertions, 51 deletions
diff --git a/src/modelica_ast.rs b/src/modelica_ast.rs
index d93d81d..6fd29f8 100644
--- a/src/modelica_ast.rs
+++ b/src/modelica_ast.rs
@@ -1,6 +1,6 @@
use std::fmt::{Debug, Formatter, Error};
-use std::collections::{HashMap, HashSet};
+use std::collections::HashMap;
#[derive(PartialEq)]
pub struct ModelicaModel {
@@ -129,37 +129,6 @@ impl Expr {
}
}
-#[cfg(test)]
-fn set_eq(a: Vec<String>, b: Vec<String>) -> bool {
- let set_a: HashSet<String> = HashSet::from_iter(a);
- let set_b: HashSet<String> = HashSet::from_iter(b);
- return set_a == set_b;
-}
-
-#[test]
-fn test_expr_identifiers() {
- use self::Expr::*;
-
- assert!(set_eq(
- vec![],
- Integer(0).identifiers()));
- assert!(set_eq(
- vec!["x".to_string()],
- Ident("x".to_string()).identifiers()));
- assert!(set_eq(
- vec!["x".to_string(), "y".to_string(), "z".to_string()],
- BinExpr(BinOperator::Add,
- Box::new(Abs(Box::new(Ident("z".to_string())))),
- Box::new(BinExpr(BinOperator::Add,
- Box::new(Abs(Box::new(Ident("x".to_string())))),
- Box::new(Abs(Box::new(Ident("y".to_string()))))))).identifiers()));
- assert!(set_eq(
- vec!["z".to_string()],
- BinExpr(BinOperator::Add,
- Box::new(Ident("z".to_string())),
- Box::new(Ident("z".to_string()))).identifiers()));
-}
-
impl SimpleEquation {
// Order is undefined
@@ -168,25 +137,6 @@ impl SimpleEquation {
}
}
-#[test]
-fn test_eqn_identifiers() {
- use self::Expr::*;
-
- assert!(set_eq(
- vec![],
- SimpleEquation{
- lhs: Integer(0),
- rhs: Integer(0),
- }.identifiers()));
- assert!(set_eq(
- vec!["z".to_string()],
- SimpleEquation{
- lhs: Ident("z".to_string()),
- rhs: BinExpr(BinOperator::Add,
- Box::new(Ident("z".to_string())),
- Box::new(Ident("z".to_string()))),
- }.identifiers()));
-}
//// Debug Implementations