Skip to content

Commit 73befe5

Browse files
committed
Test that bindcurhllsym/getcurhllsym use the hll language of the compunit.
1 parent 4e16fd4 commit 73befe5

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

t/qast/01-qast.t

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use QAST;
22

3-
plan(70);
3+
plan(72);
44

55
# Following a test infrastructure.
66
sub compile_qast($qast) {
@@ -1066,3 +1066,36 @@ is_qast(
10661066
),
10671067
'hilarious',
10681068
'hllize');
1069+
1070+
test_qast_result(
1071+
QAST::CompUnit.new(
1072+
:hll<foo>,
1073+
QAST::Block.new(
1074+
QAST::Op.new(:op<bindcurhllsym>,
1075+
QAST::SVal.new(:value<key1>),
1076+
QAST::IVal.new(:value(100))
1077+
),
1078+
QAST::Op.new(:op<bindhllsym>,
1079+
QAST::SVal.new(:value<bar>),
1080+
QAST::SVal.new(:value<key1>),
1081+
QAST::IVal.new(:value(200))
1082+
),
1083+
QAST::Op.new(:op<bindhllsym>,
1084+
QAST::SVal.new(:value<foo>),
1085+
QAST::SVal.new(:value<key2>),
1086+
QAST::IVal.new(:value(300))
1087+
),
1088+
QAST::Op.new(
1089+
:op('list'),
1090+
QAST::Op.new(:op<gethllsym>, QAST::SVal.new(:value<foo>), QAST::SVal.new(:value<key1>)),
1091+
QAST::Op.new(:op<getcurhllsym>, QAST::SVal.new(:value<key2>))
1092+
)
1093+
)
1094+
),
1095+
1096+
-> $r {
1097+
ok($r[0] == 100, 'bindcurhllsym/gethllsym');
1098+
ok($r[1] == 300, 'bindhllsym/getcurhllsym');
1099+
}
1100+
);
1101+

0 commit comments

Comments
 (0)