forked from genewildish/Mainline
Major changes: - Pipeline architecture with capability-based dependency resolution - Effects plugin system with performance monitoring - Display abstraction with multiple backends (terminal, null, websocket) - Camera system for viewport scrolling - Sensor framework for real-time input - Command-and-control system via ntfy - WebSocket display backend for browser clients - Comprehensive test suite and documentation Issue #48: ADR for preset scripting language included This commit consolidates 110 individual commits into a single feature integration that can be reviewed and tested before further refinement.
32 lines
879 B
Python
32 lines
879 B
Python
from engine.effects.legacy import vis_offset, vis_trunc
|
|
|
|
|
|
def test_vis_offset_no_change():
|
|
"""vis_offset with offset 0 returns original."""
|
|
result = vis_offset("hello", 0)
|
|
assert result == "hello"
|
|
|
|
|
|
def test_vis_offset_trims_start():
|
|
"""vis_offset skips first N characters."""
|
|
result = vis_offset("hello world", 6)
|
|
assert result == "world"
|
|
|
|
|
|
def test_vis_offset_handles_ansi():
|
|
"""vis_offset handles ANSI codes correctly."""
|
|
result = vis_offset("\033[31mhello\033[0m", 3)
|
|
assert result == "lo\x1b[0m" or "lo" in result
|
|
|
|
|
|
def test_vis_offset_greater_than_length():
|
|
"""vis_offset with offset > length returns empty-ish."""
|
|
result = vis_offset("hi", 10)
|
|
assert result == ""
|
|
|
|
|
|
def test_vis_trunc_still_works():
|
|
"""Ensure vis_trunc still works after changes."""
|
|
result = vis_trunc("hello world", 5)
|
|
assert result == "hello"
|