-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_windows.py
More file actions
47 lines (40 loc) · 1.36 KB
/
test_windows.py
File metadata and controls
47 lines (40 loc) · 1.36 KB
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
40
41
42
43
44
45
46
47
"""Quick Windows compatibility test"""
from pathlib import Path
from chess_generator import ChessDiagramGenerator
print("=" * 50)
print("ChessPublisher Windows Test")
print("=" * 50)
# Test 1: Basic diagram
print("\n1. Testing basic diagram generation...")
g = ChessDiagramGenerator(verbose=True)
success = g.generate_single_diagram(
fen="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
output_path=Path("output/windows_test.pdf"),
title="Windows Test"
)
print(f" Result: {'PASS' if success else 'FAIL'}")
# Test 2: tex_only mode
print("\n2. Testing tex_only mode...")
success = g.generate_single_diagram(
fen="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
output_path=Path("output/windows_test_texonly.pdf"),
title="TeX Only Test",
tex_only=True
)
tex_exists = Path("output/windows_test_texonly.tex").exists()
print(f" Result: {'PASS' if success and tex_exists else 'FAIL'}")
# Test 3: Annotated game
print("\n3. Testing annotated game...")
pgn = '''[Event "Test"]
[White "White"]
[Black "Black"]
[Result "1-0"]
1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 1-0'''
success = g.generate_annotated_game(
pgn_content=pgn,
output_path=Path("output/windows_test_game.pdf")
)
print(f" Result: {'PASS' if success else 'FAIL'}")
print("\n" + "=" * 50)
print("Tests complete! Check the output/ folder for generated files.")
print("=" * 50)