Skip to content

Commit

Permalink
fix var
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger committed Nov 12, 2024
1 parent 2c25f8b commit 8882650
Showing 1 changed file with 27 additions and 24 deletions.
51 changes: 27 additions & 24 deletions crates/brainfuck_prover/src/components/instruction/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ impl From<(Vec<Registers>, &ProgramMemory)> for InstructionTable {

#[cfg(test)]
mod tests {
use crate::utils::JUMP_IF_NON_ZERO_INSTRUCTION_BF;
use crate::utils::{
DECREMENT_INSTRUCTION_BF, JUMP_IF_NON_ZERO_INSTRUCTION_BF, OUTPUT_INSTRUCTION_BF,
SHIFT_LEFT_INSTRUCTION_BF,
};

use super::*;
use brainfuck_vm::{compiler::Compiler, test_helper::create_test_machine};
Expand Down Expand Up @@ -375,21 +378,21 @@ mod tests {
InstructionTableRow {
ip: BaseField::from(3),
ci: BaseField::from(b',' as u32),
ni: BaseField::from(b'<' as u32),
ni: SHIFT_LEFT_INSTRUCTION_BF,
},
InstructionTableRow {
ip: BaseField::from(3),
ci: BaseField::from(b',' as u32),
ni: BaseField::from(b'<' as u32),
ni: SHIFT_LEFT_INSTRUCTION_BF,
},
InstructionTableRow {
ip: BaseField::from(4),
ci: BaseField::from(b'<' as u32),
ci: SHIFT_LEFT_INSTRUCTION_BF,
ni: BaseField::from(b'[' as u32),
},
InstructionTableRow {
ip: BaseField::from(4),
ci: BaseField::from(b'<' as u32),
ci: SHIFT_LEFT_INSTRUCTION_BF,
ni: BaseField::from(b'[' as u32),
},
InstructionTableRow {
Expand Down Expand Up @@ -420,61 +423,61 @@ mod tests {
InstructionTableRow {
ip: BaseField::from(8),
ci: BaseField::from(b'+' as u32),
ni: BaseField::from(b'.' as u32),
ni: OUTPUT_INSTRUCTION_BF,
},
InstructionTableRow {
ip: BaseField::from(8),
ci: BaseField::from(b'+' as u32),
ni: BaseField::from(b'.' as u32),
ni: OUTPUT_INSTRUCTION_BF,
},
InstructionTableRow {
ip: BaseField::from(8),
ci: BaseField::from(b'+' as u32),
ni: BaseField::from(b'.' as u32),
ni: OUTPUT_INSTRUCTION_BF,
},
InstructionTableRow {
ip: BaseField::from(9),
ci: BaseField::from(b'.' as u32),
ni: BaseField::from(b'<' as u32),
ci: OUTPUT_INSTRUCTION_BF,
ni: SHIFT_LEFT_INSTRUCTION_BF,
},
InstructionTableRow {
ip: BaseField::from(9),
ci: BaseField::from(b'.' as u32),
ni: BaseField::from(b'<' as u32),
ci: OUTPUT_INSTRUCTION_BF,
ni: SHIFT_LEFT_INSTRUCTION_BF,
},
InstructionTableRow {
ip: BaseField::from(9),
ci: BaseField::from(b'.' as u32),
ni: BaseField::from(b'<' as u32),
ci: OUTPUT_INSTRUCTION_BF,
ni: SHIFT_LEFT_INSTRUCTION_BF,
},
InstructionTableRow {
ip: BaseField::from(10),
ci: BaseField::from(b'<' as u32),
ni: BaseField::from(b'-' as u32),
ci: SHIFT_LEFT_INSTRUCTION_BF,
ni: DECREMENT_INSTRUCTION_BF,
},
InstructionTableRow {
ip: BaseField::from(10),
ci: BaseField::from(b'<' as u32),
ni: BaseField::from(b'-' as u32),
ci: SHIFT_LEFT_INSTRUCTION_BF,
ni: DECREMENT_INSTRUCTION_BF,
},
InstructionTableRow {
ip: BaseField::from(10),
ci: BaseField::from(b'<' as u32),
ni: BaseField::from(b'-' as u32),
ci: SHIFT_LEFT_INSTRUCTION_BF,
ni: DECREMENT_INSTRUCTION_BF,
},
InstructionTableRow {
ip: BaseField::from(11),
ci: BaseField::from(b'-' as u32),
ci: DECREMENT_INSTRUCTION_BF,
ni: JUMP_IF_NON_ZERO_INSTRUCTION_BF,
},
InstructionTableRow {
ip: BaseField::from(11),
ci: BaseField::from(b'-' as u32),
ci: DECREMENT_INSTRUCTION_BF,
ni: JUMP_IF_NON_ZERO_INSTRUCTION_BF,
},
InstructionTableRow {
ip: BaseField::from(11),
ci: BaseField::from(b'-' as u32),
ci: DECREMENT_INSTRUCTION_BF,
ni: JUMP_IF_NON_ZERO_INSTRUCTION_BF,
},
InstructionTableRow {
Expand Down Expand Up @@ -531,7 +534,7 @@ mod tests {
},
InstructionTableRow {
ip: BaseField::from(2),
ci: BaseField::from(b'-' as u32),
ci: DECREMENT_INSTRUCTION_BF,
ni: JUMP_IF_NON_ZERO_INSTRUCTION_BF,
},
InstructionTableRow {
Expand Down

0 comments on commit 8882650

Please sign in to comment.