diff options
author | bnewbold <bnewbold@robocracy.org> | 2016-12-17 18:34:47 -0800 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2016-12-17 18:34:47 -0800 |
commit | 9f82aceb9fbdb42f332d68f4a423123bd0788b2c (patch) | |
tree | c082b9795be8e9e9d286c8f8f1345d22f3ec1b59 /tests/lib.rs | |
parent | f6364ebcac0d0a88a3cc6812fd2120c97b42cc26 (diff) | |
download | modelthing-9f82aceb9fbdb42f332d68f4a423123bd0788b2c.tar.gz modelthing-9f82aceb9fbdb42f332d68f4a423123bd0788b2c.zip |
refactor modelica parser into separate crate
Diffstat (limited to 'tests/lib.rs')
-rw-r--r-- | tests/lib.rs | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/tests/lib.rs b/tests/lib.rs index baddf72..bf28476 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -1,5 +1,6 @@ extern crate modelthing; +extern crate modelica_parser; use std::path::Path; @@ -31,39 +32,3 @@ fn test_load_model_entry() { fn test_search_models() { assert_eq!(search_models(Path::new("./examples/")).len() > 1, true); } - -#[test] -fn test_lexical() { - assert_eq!(&format!("{:?}", modelica_parser::parse_integer("+123").unwrap()), - "123"); - assert_eq!(&format!("{:?}", modelica_parser::parse_integer("-9").unwrap()), - "-9"); - assert_eq!(&format!("{:?}", modelica_parser::parse_float("-1.0e0").unwrap()), - "-1"); - assert_eq!(&format!("{:?}", modelica_parser::parse_float("123.456").unwrap()), - "123.456"); -} - -#[test] -fn test_parse() { - let example1 = -r#"model MinimalModel - Real x; -equation - x = 1; -end MinimalModel; -"#; - assert_eq!(&format!("{:?}", modelica_parser::parse_model(example1).unwrap()), example1); - - let example2 = -r#"model MinimalModel - parameter Real a; - Real b; -equation - connect(a, b); - a = 1; - b = ((abs(a) + 2) / 4); -end MinimalModel; -"#; - assert_eq!(&format!("{:?}", modelica_parser::parse_model(example2).unwrap()), example2); -} |