From 0bc8b17a3e750e02981f6d67f7713afa9b3b9f63 Mon Sep 17 00:00:00 2001 From: malatrax Date: Fri, 8 Nov 2024 12:21:28 +0100 Subject: [PATCH 1/2] test: rename add_row test --- crates/brainfuck_prover/src/components/instruction/table.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/brainfuck_prover/src/components/instruction/table.rs b/crates/brainfuck_prover/src/components/instruction/table.rs index 44fc2c2..0026b25 100644 --- a/crates/brainfuck_prover/src/components/instruction/table.rs +++ b/crates/brainfuck_prover/src/components/instruction/table.rs @@ -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 { From 98bcf67b0472a6068fc95f8d171ed456f8a2d6e0 Mon Sep 17 00:00:00 2001 From: malatrax Date: Fri, 8 Nov 2024 12:21:57 +0100 Subject: [PATCH 2/2] test: add add_row unit test --- .../src/components/instruction/table.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/crates/brainfuck_prover/src/components/instruction/table.rs b/crates/brainfuck_prover/src/components/instruction/table.rs index 0026b25..adee241 100644 --- a/crates/brainfuck_prover/src/components/instruction/table.rs +++ b/crates/brainfuck_prover/src/components/instruction/table.rs @@ -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();