mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
REF is tested ok
This commit is contained in:
parent
edf3552aeb
commit
71bb89eb0c
@ -76,6 +76,19 @@ TEST(VM, str_xy_space) {
|
||||
|
||||
ASSERT_STREQ(obj_getStr(self, (char*)"a"), (char*)"xy ");
|
||||
|
||||
obj_deinit(self);
|
||||
args_deinit(buffs);
|
||||
EXPECT_EQ(pikaMemNow(), 0);
|
||||
}
|
||||
|
||||
TEST(VM, ref_a_b) {
|
||||
Args* buffs = New_strBuff();
|
||||
PikaObj* self = newRootObj((char*)"root", New_PikaStdLib_SysObj);
|
||||
|
||||
pikaVM_runAsm(self, pikaParseToAsm(buffs, (char*)"a = 'xy '"));
|
||||
pikaVM_runAsm(self, pikaParseToAsm(buffs, (char*)"b = a"));
|
||||
|
||||
ASSERT_STREQ(obj_getStr(self, (char*)"b"), (char*)"xy ");
|
||||
obj_deinit(self);
|
||||
args_deinit(buffs);
|
||||
EXPECT_EQ(pikaMemNow(), 0);
|
||||
|
@ -69,6 +69,9 @@ Arg* pikaVM_runAsmInstruct(PikaObj* self,
|
||||
arg_deinit(outArg);
|
||||
return NULL;
|
||||
}
|
||||
if (instruct == REF) {
|
||||
return arg_copy(obj_getArg(self, data));
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user