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

Commit

Permalink
Test basic step type creation. Fix cargo format error
Browse files Browse the repository at this point in the history
  • Loading branch information
nullbitx8 committed Nov 7, 2023
1 parent f341683 commit 099324c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/frontend/dsl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ mod tests {
let forward_a: Queriable<i32> = context.forward("forward_a");
let step_offset: ExposeOffset = ExposeOffset::Last;

// expose the forward signal of the final step
// expose the forward signal of the final step
context.expose(forward_a, step_offset);

// assert the signal is exposed
Expand All @@ -561,4 +561,23 @@ mod tests {
std::mem::discriminant(&step_offset)
);
}

#[test]
fn test_step_type() {
// create circuit context
let circuit: Circuit<i32, i32> = Circuit::default();
let mut context = CircuitContext {
circuit,
tables: Default::default(),
};

// create a step type
let handler: StepTypeHandler = context.step_type("fibo_first_step");

// assert that the created step type was added to the circuit annotations
assert_eq!(
context.circuit.annotations[&handler.uuid()],
"fibo_first_step"
)
}
}

0 comments on commit 099324c

Please sign in to comment.