Skip to content

Commit ef65f6a

Browse files
committed
Made code formatter happy; added test fixtures
1 parent e243432 commit ef65f6a

File tree

5 files changed

+73
-3
lines changed

5 files changed

+73
-3
lines changed

tests/examples/hanoi_fixture.txt

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
Step 0
3+
4+
1
5+
2
6+
3
7+
---------
8+
L C R
9+
10+
Step 1
11+
12+
13+
2
14+
3 1
15+
---------
16+
L C R
17+
18+
Step 2
19+
20+
21+
22+
3 2 1
23+
---------
24+
L C R
25+
26+
Step 3
27+
28+
29+
1
30+
3 2
31+
---------
32+
L C R
33+
34+
Step 4
35+
36+
37+
1
38+
2 3
39+
---------
40+
L C R
41+
42+
Step 5
43+
44+
45+
46+
1 2 3
47+
---------
48+
L C R
49+
50+
Step 6
51+
52+
53+
2
54+
1 3
55+
---------
56+
L C R
57+
58+
Step 7
59+
60+
1
61+
2
62+
3
63+
---------
64+
L C R
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
1. Move disk from left pole to right pole.
2+
2. Move disk from left pole to center pole.
3+
3. Move disk from right pole to center pole.
4+
4. Move disk from left pole to right pole.
5+
5. Move disk from center pole to left pole.
6+
6. Move disk from center pole to right pole.
7+
7. Move disk from left pole to right pole.

tests/examples/test_coins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from pyswip.examples.coins import solve, prolog_source
44

5-
class CoinsTestCase(unittest.TestCase):
65

6+
class CoinsTestCase(unittest.TestCase):
77
def test_solve(self):
88
fixture = [{1: 3, 5: 0, 10: 30, 50: 0, 100: 0}]
99
soln = solve(coin_count=33, total_cents=303, max_solutions=1)

tests/examples/test_hanoi.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77

88
class HanoiTestCase(unittest.TestCase):
9-
109
def test_solve(self):
1110
fixture = load_fixture("hanoi_fixture.txt")
1211
sio = StringIO()

tests/examples/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
def load_fixture(filename: str) -> str:
55
path = Path(__file__).parent / filename
66
with open(path) as f:
7-
return f.read()
7+
return f.read()

0 commit comments

Comments
 (0)