Skip to content

Commit

Permalink
test: instruction table (#37)
Browse files Browse the repository at this point in the history
* test: rename add_row test

* test: add add_row unit test
  • Loading branch information
zmalatrax authored Nov 8, 2024
1 parent 0fe157f commit df66803
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion crates/brainfuck_prover/src/components/instruction/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ mod tests {
}

#[test]
fn test_add_row() {
fn test_add_row_front_registers() {
let mut instruction_table = InstructionTable::new();
// Create a row to add to the table
let row = InstructionTableRow {
Expand All @@ -118,6 +118,21 @@ mod tests {
assert_eq!(instruction_table.table, vec![row], "Added row should match the expected row.");
}

#[test]
fn test_add_row() {
let mut instruction_table = InstructionTable::new();
// Create a row to add to the table
let row = InstructionTableRow {
ip: BaseField::zero(),
ci: BaseField::from(43),
ni: BaseField::from(91),
};
// Add the row to the table
instruction_table.add_row(row.clone());
// Check that the table contains the added row
assert_eq!(instruction_table.table, vec![row], "Added row should match the expected row.");
}

#[test]
fn test_add_multiple_rows() {
let mut instruction_table = InstructionTable::new();
Expand Down

0 comments on commit df66803

Please sign in to comment.