Skip to content

Commit

Permalink
chore: update variable names in stdlib tests to be more correct (#6419)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench authored Oct 31, 2024
1 parent ec03e77 commit c3c9cc3
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions noir_stdlib/src/field/mod.nr
Original file line number Diff line number Diff line change
Expand Up @@ -285,39 +285,39 @@ mod tests {
// docs:start:to_be_bytes_example
fn test_to_be_bytes() {
let field = 2;
let bits: [u8; 8] = field.to_be_bytes();
assert_eq(bits, [0, 0, 0, 0, 0, 0, 0, 2]);
assert_eq(Field::from_be_bytes::<8>(bits), field);
let bytes: [u8; 8] = field.to_be_bytes();
assert_eq(bytes, [0, 0, 0, 0, 0, 0, 0, 2]);
assert_eq(Field::from_be_bytes::<8>(bytes), field);
}
// docs:end:to_be_bytes_example

#[test]
// docs:start:to_le_bytes_example
fn test_to_le_bytes() {
let field = 2;
let bits: [u8; 8] = field.to_le_bytes();
assert_eq(bits, [2, 0, 0, 0, 0, 0, 0, 0]);
assert_eq(Field::from_le_bytes::<8>(bits), field);
let bytes: [u8; 8] = field.to_le_bytes();
assert_eq(bytes, [2, 0, 0, 0, 0, 0, 0, 0]);
assert_eq(Field::from_le_bytes::<8>(bytes), field);
}
// docs:end:to_le_bytes_example

#[test]
// docs:start:to_be_radix_example
fn test_to_be_radix() {
let field = 2;
let bits: [u8; 8] = field.to_be_radix(256);
assert_eq(bits, [0, 0, 0, 0, 0, 0, 0, 2]);
assert_eq(Field::from_be_bytes::<8>(bits), field);
let bytes: [u8; 8] = field.to_be_radix(256);
assert_eq(bytes, [0, 0, 0, 0, 0, 0, 0, 2]);
assert_eq(Field::from_be_bytes::<8>(bytes), field);
}
// docs:end:to_be_radix_example

#[test]
// docs:start:to_le_radix_example
fn test_to_le_radix() {
let field = 2;
let bits: [u8; 8] = field.to_le_radix(256);
assert_eq(bits, [2, 0, 0, 0, 0, 0, 0, 0]);
assert_eq(Field::from_le_bytes::<8>(bits), field);
let bytes: [u8; 8] = field.to_le_radix(256);
assert_eq(bytes, [2, 0, 0, 0, 0, 0, 0, 0]);
assert_eq(Field::from_le_bytes::<8>(bytes), field);
}
// docs:end:to_le_radix_example

Expand Down

0 comments on commit c3c9cc3

Please sign in to comment.