Skip to content

Commit

Permalink
uncomment test
Browse files Browse the repository at this point in the history
  • Loading branch information
Josep M. Bach committed Dec 31, 2012
1 parent a44334f commit 7108d1b
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion tests/vm_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,42 @@ char *test_pushlocaldepth()
TEARDOWN();
}

char *test_setlocaldepth()
{
SETUP();

DEFN(
"foo",
PUSHNIL,
SETLOCALDEPTH, 1, 0,
RET
);

PUSH_LITERAL(Number_new(123), integer);
PUSH_LITERAL(String_new("foo"), method);
PUSH_LITERAL(String_new("fn"), function);

// a = 123
// self.fn = -> { a }
// fn()
RUN(
PUSH, 0,
SETLOCAL, 0,

PUSHSELF,
DEFN, 1,
SETSLOT, 2,

PUSHSELF,
SEND, 2, 0,
RET
);

mu_assert(result == NilObject, "Setlocaldepth failed.");

TEARDOWN();
}

char *test_setlocal()
{
SETUP();
Expand Down Expand Up @@ -436,7 +472,7 @@ char *all_tests() {
mu_run_test(test_pushlocal);
mu_run_test(test_setlocal);
mu_run_test(test_pushlocaldepth);
/* mu_run_test(test_setlocaldepth); */
mu_run_test(test_setlocaldepth);
mu_run_test(test_jmp);
mu_run_test(test_jif);
mu_run_test(test_jit);
Expand Down

0 comments on commit 7108d1b

Please sign in to comment.