-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests-anim.py
39 lines (31 loc) · 1022 Bytes
/
tests-anim.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import unittest
import game2048
G = game2048.G
G.debug_anim = True
G.size = 4
class TestAnimation(unittest.TestCase):
def test_1(self):
print("\n↑")
G.M = [[0, 0, 0, 0], [16, 0, 0, 0], [4, 0, 0, 0], [4, 0, 0, 0]]
G.start()
self.assertTrue(G.debug_exit_status)
def test_2(self):
print("\n↓")
G.M = [[4, 0, 0, 0], [4, 0, 0, 0], [2, 0, 0, 0], [2, 0, 0, 0]]
G.start()
self.assertTrue(G.debug_exit_status)
def test_3(self):
print("\n↑")
G.M = [[2, 0, 0, 0], [2, 0, 0, 0], [4, 0, 0, 0], [4, 0, 0, 0]]
G.start()
self.assertTrue(G.debug_exit_status)
def test_4(self):
print("\n→")
G.M = [[4, 4, 2, 2], [0, 0, 0, 0], [2, 2, 4, 4], [0, 0, 0, 0]]
G.start()
self.assertTrue(G.debug_exit_status)
def test_5(self):
print("\n←")
G.M = [[4, 4, 2, 2], [0, 0, 0, 0], [2, 2, 4, 4], [0, 0, 0, 0]]
G.start()
self.assertTrue(G.debug_exit_status)