nomo/tests/cases/if_else_if.3-instructions.snap
Marcel Müller 06816567ff Use macro per-test-file
Signed-off-by: Marcel Müller <neikos@neikos.email>
2026-03-12 18:15:20 +01:00

88 lines
1.9 KiB
Text

---
source: tests/file_tests.rs
expression: emit
info:
input: "{{ if test }}\n Not Hello World! :C\n{{ else if another_test }}\n Hello World!\n{{ end }}"
context:
test: false
stuff: more
another_test: true
---
VMInstructions {
labels: {
LabelSlot {
index: 0,
}: 14,
LabelSlot {
index: 2,
}: 7,
LabelSlot {
index: 4,
}: 14,
},
instructions: [
LoadFromContextToSlot {
name: "test" (6..10),
slot: VariableSlot {
index: 1,
},
},
JumpIfNotTrue {
emit_slot: VariableSlot {
index: 1,
},
jump: LabelSlot {
index: 2,
},
},
AppendContent {
content: "\n " (13..18),
},
AppendContent {
content: "Not Hello World! :C" (18..37),
},
AppendContent {
content: "\n" (37..38),
},
Jump {
jump: LabelSlot {
index: 0,
},
},
AppendContent {
content: "\n " (13..18),
},
LoadFromContextToSlot {
name: "another_test" (49..61),
slot: VariableSlot {
index: 3,
},
},
JumpIfNotTrue {
emit_slot: VariableSlot {
index: 3,
},
jump: LabelSlot {
index: 4,
},
},
AppendContent {
content: "\n " (64..69),
},
AppendContent {
content: "Hello World!" (69..81),
},
AppendContent {
content: "\n" (81..82),
},
Jump {
jump: LabelSlot {
index: 0,
},
},
AppendContent {
content: "\n " (64..69),
},
NoOp,
],
}