Пример #1
0
 def test_stack_manipulation_rolld_floats_and_negative_integers(self):
     _, _, b = calc.stack_manipulation((" 1.2 rolld ").split(" "),
                                       [1, 2, 3])
     assert b == 1
     _, _, b = calc.stack_manipulation((" 1/-/ rolld ").split(" "),
                                       [1, 2, 3])
     assert b == 1
Пример #2
0
 def test_stack_manipulation_dropn_from_small_stack_floats_negative_integers(
         self):
     _, _, b = calc.stack_manipulation(("2 dropn").split(" "), [1])
     assert b == 1
     _, _, b = calc.stack_manipulation(("2.2 dropn").split(" "), [1, 2, 3])
     assert b == 1
     _, _, b = calc.stack_manipulation(("2/-/ dropn").split(" "), [1, 2, 3])
     assert b == 1
Пример #3
0
 def test_stack_manipulation_dupn_empty_stack_negatives_floats(self):
     _, _, b = calc.stack_manipulation(("3 dupn").split(" "), [])
     assert b == 1
     _, _, b = calc.stack_manipulation(("3/-/ dupn").split(" "), [1, 2, 3])
     assert b == 1
     _, _, b = calc.stack_manipulation(("3.3 dupn").split(" "),
                                       [1, 2, 3, 4])
     assert b == 1
Пример #4
0
 def test_stack_manipulation_pick_from_smaller_stack_floats_negative_integers(
         self):
     _, _, b = calc.stack_manipulation(("2 pick").split(" "), [3])
     assert b == 1
     _, _, b = calc.stack_manipulation(("1.3 pick").split(" "),
                                       [1, 2, 3, 4])
     assert b == 1
     _, _, b = calc.stack_manipulation(("1/-/ pick").split(" "), [1, 2, 3])
     assert b == 1
Пример #5
0
 def test_stack_manipulation_rolld(self, inp, inp2, out):
     _, stac, _ = calc.stack_manipulation(inp, inp2)
     assert stac == out
Пример #6
0
 def test_stack_manipulation_swap_smaller_stack(self):
     _, _, b = calc.stack_manipulation((" swap ").split(" "), [1])
     assert b == 1
Пример #7
0
 def test_stack_manipulation_drop_from_empty_stack(self):
     _, _, b = calc.stack_manipulation((" drop").split(" "), [])
     assert b == 1