Skip to content

Commit

Permalink
Fixed RPN test
Browse files Browse the repository at this point in the history
  • Loading branch information
goodpaul6 committed Jan 18, 2019
1 parent 4a0fc19 commit 82cf060
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/src/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,10 @@ static void test_RevPolishCalc(void)
"op := \"\"\n"
"while op != \"quit\" {\n"
"op = my_input()\n"
"if strchar(op, 0) == '+' array_push(stack, array_pop(stack) + array_pop(stack))\n"
"else if strchar(op, 0) == '-' array_push(stack, array_pop(stack) - array_pop(stack))\n"
"else if strchar(op, 0) == '*' array_push(stack, array_pop(stack) * array_pop(stack))\n"
"else if strchar(op, 0) == '/' array_push(stack, array_pop(stack) / array_pop(stack))\n"
"if stridx(op, 0) == '+' array_push(stack, array_pop(stack) + array_pop(stack))\n"
"else if stridx(op, 0) == '-' array_push(stack, array_pop(stack) - array_pop(stack))\n"
"else if stridx(op, 0) == '*' array_push(stack, array_pop(stack) * array_pop(stack))\n"
"else if stridx(op, 0) == '/' array_push(stack, array_pop(stack) / array_pop(stack))\n"
"else if op != \"quit\" array_push(stack, ston(op)) }\n";

Tiny_CompileString(state, "test_rpn", code);
Expand Down

0 comments on commit 82cf060

Please sign in to comment.