Lines
77.92 %
Functions
100 %
Branches
use indoc::indoc;
use merc_syntax::UntypedDataSpecification;
use pest::Parser;
use merc_syntax::Mcrl2Parser;
use merc_syntax::Rule;
use merc_syntax::UntypedProcessSpecification;
use merc_syntax::UntypedStateFrmSpec;
use merc_syntax::parse_sortexpr;
use merc_utilities::test_logger;
#[test]
fn test_parse_ifthen() {
let expr = "init a -> b <> b;";
match UntypedProcessSpecification::parse(expr) {
Ok(result) => {
println!("{}", result);
}
Err(e) => {
panic!("Failed to parse expression: {}", e);
fn test_parse_keywords() {
let expr = "map or : Boolean # Boolean -> Boolean ;";
fn test_parse_sort_spec() {
let sort_spec = indoc! {"
sort D = Bool -> Int -> Bool;
% Test
F = struct d1 | d2;
Error = struct e;
"};
match UntypedProcessSpecification::parse(sort_spec) {
fn test_parse_regular_expression() {
let spec = "[true++false]true";
match UntypedStateFrmSpec::parse(spec) {
fn test_parse_procexpr() {
test_logger();
let spec: &str = indoc! {"init
true -> delta <> delta;
match UntypedProcessSpecification::parse(spec) {
fn test_parse_statefrm() {
let spec: &str = indoc! {"<b> <a> exists b: Bool . b && !b"};
fn test_sort_precedence() {
let term = "Bool # Int -> Int -> Bool";
match Mcrl2Parser::parse(Rule::SortExpr, term) {
print!("{}", parse_sortexpr(result).unwrap());
panic!("{}", e);
fn test_bool_spec() {
match UntypedDataSpecification::parse(include_str!("../spec/bool.mcrl2")) {
fn test_int_spec() {
match UntypedDataSpecification::parse(include_str!("../spec/int.mcrl2")) {
fn test_nat_spec() {
match UntypedDataSpecification::parse(include_str!("../spec/nat.mcrl2")) {
fn test_pos_spec() {
match UntypedDataSpecification::parse(include_str!("../spec/pos.mcrl2")) {
fn test_real_spec() {
match UntypedDataSpecification::parse(include_str!("../spec/real.mcrl2")) {
fn test_list_spec() {
match UntypedDataSpecification::parse(include_str!("../spec/list.mcrl2")) {
fn test_set_spec() {
match UntypedDataSpecification::parse(include_str!("../spec/set.mcrl2")) {
fn test_fset_spec() {
match UntypedDataSpecification::parse(include_str!("../spec/fset.mcrl2")) {
fn test_bag_spec() {
match UntypedDataSpecification::parse(include_str!("../spec/bag.mcrl2")) {
fn test_fbag_spec() {
match UntypedDataSpecification::parse(include_str!("../spec/fbag.mcrl2")) {