Skip to content

Commit

Permalink
tests for super_send bytecodes
Browse files Browse the repository at this point in the history
  • Loading branch information
OctaveLarose authored and Hirevo committed Feb 16, 2024
1 parent 44522ff commit 06dbd7a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions som-interpreter-bc/tests/specialized_bc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,32 @@ fn send_bytecodes() {
&[PushArgument(0, 0), Push1, Push1, Push1, SendN(3)],
);
}

#[test]
fn super_send_bytecodes() {
let class_txt = "Foo = (
run = (
super send1.
super sendtwo: 1.
super send: 1 three: 1.
super send: 1 with: 1 four: 1.
)
)
";

let bytecodes = get_bytecodes_from_method(class_txt, "run");

expect_bytecode_sequence(&bytecodes, &[PushArgument(0, 0), SuperSend1(0)]);

expect_bytecode_sequence(&bytecodes, &[PushArgument(0, 0), Push1, SuperSend2(1)]);

expect_bytecode_sequence(
&bytecodes,
&[PushArgument(0, 0), Push1, Push1, SuperSend3(2)],
);

expect_bytecode_sequence(
&bytecodes,
&[PushArgument(0, 0), Push1, Push1, Push1, SuperSendN(3)],
);
}

0 comments on commit 06dbd7a

Please sign in to comment.