mathic 0.2.0

A compiler with builtin support of symbolic operations, built with LLVM/MLIR
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
mod common;

use std::path::PathBuf;

use common::compile_and_execute;
use rstest::rstest;

#[rstest]
#[case("examples/variables/basic_declaration.mth", 42)]
#[case("examples/variables/reassignment.mth", 20)]
#[case("examples/variables/multiple_variables.mth", 15)]
#[case("examples/variables/variable_increment.mth", 20)]
fn test_variables(#[case] path: PathBuf, #[case] expected: i64) {
    let result = compile_and_execute(&path);
    assert_eq!(result, expected);
}