use super::expect_diagnostic;
#[test]
fn err_trace_cols_empty() {
let source = "
def test
trace_columns {}
public_inputs {
stack_inputs: [16]
boundary_constraints {
enf clk.first = 0
integrity_constraints {
enf clk' = clk + 1";
expect_diagnostic(source, "missing 'main' declaration in this section");
}
#[test]
fn err_trace_cols_omitted() {
let source = "
def test
public_inputs {
stack_inputs: [16],
}
boundary_constraints {
enf clk.first = 0;
}
integrity_constraints {
enf clk' = clk + 1;
}";
expect_diagnostic(source, "missing trace_columns section");
}
#[test]
fn err_pub_inputs_empty() {
let source = "
def test
trace_columns {
main: [clk],
}
public_inputs {}
boundary_constraints {
enf clk.first = 0;
}
integrity_constraints {
enf clk' = clk + 1;
}";
expect_diagnostic(source, "expected one of: 'identifier'");
}
#[test]
fn err_pub_inputs_omitted() {
let source = "
def test
trace_columns {
main: [clk],
}
boundary_constraints {
enf clk.first = 0;
}
integrity_constraints {
enf clk' = clk + 1;
}";
expect_diagnostic(source, "root module must contain a public_inputs section");
}
#[test]
fn err_bc_empty() {
let source = "
def test
trace_columns {
main: [clk],
}
public_inputs {
stack_inputs: [16],
}
boundary_constraints {}
integrity_constraints {
enf clk' = clk + 1;
}";
expect_diagnostic(source, "expected one of: '\"enf\"', '\"let\"'");
}
#[test]
fn err_bc_omitted() {
let source = "
def test
trace_columns {
main: [clk],
}
public_inputs {
stack_inputs: [16],
}
integrity_constraints {
enf clk' = clk + 1;
}";
expect_diagnostic(
source,
"root module must contain both boundary_constraints and integrity_constraints sections",
);
}
#[test]
fn err_ic_empty() {
let source = "
def test
trace_columns {
main: [clk],
}
public_inputs {
stack_inputs: [16],
}
boundary_constraints {
enf clk.first = 0;
}
integrity_constraints {}";
expect_diagnostic(source, "expected one of: '\"enf\"', '\"let\"'");
}
#[test]
fn err_ic_omitted() {
let source = "
def test
trace_columns {
main: [clk],
}
public_inputs {
stack_inputs: [16],
}
boundary_constraints {
enf clk.first = 0;
}";
expect_diagnostic(
source,
"root module must contain both boundary_constraints and integrity_constraints sections",
);
}