MCPcopy Create free account
hub / github.com/BitVM/BitVM / test_xor

Function test_xor

bitvm/src/u4/u4_logic_stack.rs:163–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

161
162 #[test]
163 fn test_xor() {
164 for x in 0..16 {
165 for y in 0..16 {
166 let mut stack = StackTracker::new();
167 let xor = u4_push_full_xor_table_stack(&mut stack);
168 let lookup = u4_push_full_lookup_table_stack(&mut stack);
169 stack.number(x);
170 stack.number(y);
171 u4_logic_with_table_stack(&mut stack, lookup, xor);
172 stack.number(x ^ y);
173 stack.op_equalverify();
174 stack.drop(lookup);
175 stack.drop(xor);
176 stack.op_true();
177 assert!(stack.run().success);
178 }
179 }
180 }
181
182 #[test]
183 fn test_xor_half() {

Callers

nothing calls this directly

Calls 4

dropMethod · 0.45

Tested by

no test coverage detected