Files
horizon-airdef/tools/test_tooltip_display_parity.py
T
Ludovic Marie 9dd896bfc3 tooltip_display harness: write the case flags in lowercase
Rust's bool parser takes only true/false, so the fixture failed on Python's
True/False; Java's Boolean.parseBoolean ignores case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 10:10:57 +02:00

33 lines
1.1 KiB
Python

#!/usr/bin/env python3
"""Compare item tooltip display visibility with the pinned vanilla client."""
try:
from . import lab, oracle_harness as harness
except ImportError:
import lab, oracle_harness as harness
def cases(build):
values = [
(False, False, False),
(False, False, True),
(False, True, True),
(True, False, False),
(True, True, False),
(True, True, True),
]
path = build / 'cases.txt'
# Lowercase: Rust's bool parser takes only true/false (Java's parseBoolean ignores case).
path.write_text('\n'.join('\t'.join(str(v).lower() for v in row) for row in values) + '\n')
return path, len(values)
if __name__ == '__main__':
harness.differential(
'tooltip-display-parity', 'VanillaTooltipDisplayOracle', 'tooltip_display_fixture', cases,
'Diamond sword name and attribute tooltip visibility for hide_tooltip, hidden_components, and creative flags',
sources=[
lab.ROOT / 'crates/horizon-client/src/game/stations.rs',
lab.ROOT / 'crates/horizon-client/src/item_tooltip.rs',
],
expected_lines=6)