Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Restore unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alxkzmn committed Aug 22, 2024
1 parent d02995f commit 05a9046
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/compiler/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ mod test {
use itertools::Itertools;

use crate::{
compiler::{compile, compile_legacy},
compiler::{compile, compile_file, compile_legacy},
parser::ast::debug_sym_factory::DebugSymRefFactory,
wit_gen::TraceGenerator,
};
Expand Down Expand Up @@ -824,4 +824,24 @@ mod test {
}
}
}

#[test]
fn test_compiler_fibo_file() {
let path = "test/circuit.chiquito";
let result = compile_file::<Fr>(path, Config::default().max_degree(2));
assert!(result.is_ok());
}

#[test]
fn test_compiler_fibo_file_err() {
let path = "test/circuit_error.chiquito";
let result = compile_file::<Fr>(path, Config::default().max_degree(2));

assert!(result.is_err());

assert_eq!(
format!("{:?}", result.unwrap_err()),
r#"[SemErr { msg: "use of undeclared variable c", dsym: test/circuit_error.chiquito:24:39 }, SemErr { msg: "use of undeclared variable c", dsym: test/circuit_error.chiquito:28:46 }]"#
)
}
}

0 comments on commit 05a9046

Please sign in to comment.