Skip to content

Commit 3bdb01f

Browse files
committed
Fix
1 parent 8b3f945 commit 3bdb01f

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

macro/tests/operand.rs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ fn simple() {
1717

1818
let r#type = Type::parse(&context, "i32").unwrap();
1919
let block = Block::new(&[(r#type, location), (r#type, location)]);
20-
let op = operand_test::simple(
20+
let operation = operand_test::simple(
2121
&context,
2222
r#type,
2323
block.argument(0).unwrap().into(),
2424
block.argument(1).unwrap().into(),
2525
location,
2626
);
2727

28-
assert_eq!(op.lhs().unwrap(), block.argument(0).unwrap().into());
29-
assert_eq!(op.rhs().unwrap(), block.argument(1).unwrap().into());
30-
assert_eq!(op.operation().operand_count(), 2);
28+
assert_eq!(operation.lhs().unwrap(), block.argument(0).unwrap().into());
29+
assert_eq!(operation.rhs().unwrap(), block.argument(1).unwrap().into());
30+
assert_eq!(operation.operation().operand_count(), 2);
3131
}
3232

3333
#[test]
@@ -39,7 +39,7 @@ fn variadic_after_single() {
3939

4040
let r#type = Type::parse(&context, "i32").unwrap();
4141
let block = Block::new(&[(r#type, location), (r#type, location), (r#type, location)]);
42-
let op = operand_test::variadic(
42+
let operation = operand_test::variadic(
4343
&context,
4444
r#type,
4545
block.argument(0).unwrap().into(),
@@ -50,9 +50,18 @@ fn variadic_after_single() {
5050
location,
5151
);
5252

53-
assert_eq!(op.first().unwrap(), block.argument(0).unwrap().into());
54-
assert_eq!(op.others().next(), Some(block.argument(2).unwrap().into()));
55-
assert_eq!(op.others().nth(1), Some(block.argument(1).unwrap().into()));
56-
assert_eq!(op.operation().operand_count(), 3);
57-
assert_eq!(op.others().count(), 2);
53+
assert_eq!(
54+
operation.first().unwrap(),
55+
block.argument(0).unwrap().into()
56+
);
57+
assert_eq!(
58+
operation.others().next(),
59+
Some(block.argument(2).unwrap().into())
60+
);
61+
assert_eq!(
62+
operation.others().nth(1),
63+
Some(block.argument(1).unwrap().into())
64+
);
65+
assert_eq!(operation.operation().operand_count(), 3);
66+
assert_eq!(operation.others().count(), 2);
5867
}

0 commit comments

Comments
 (0)