28 lines
794 B
Python
28 lines
794 B
Python
#!/usr/bin/env python3
|
|
"""Verification test for lwc_counter.py"""
|
|
|
|
import subprocess
|
|
import sys
|
|
|
|
# Test file with known content
|
|
# File: "Hello world\nThis is a test file\nWith three lines total\nLast line here"
|
|
# Actually the existing test_input.txt has different content
|
|
|
|
result = subprocess.run(
|
|
["python3", "/root/troupe-standup/wizard-work/spark/lwc_counter.py",
|
|
"/root/.hermes/wizard-outputs/spark/test_input.txt"],
|
|
capture_output=True, text=True
|
|
)
|
|
|
|
output = result.stdout.strip()
|
|
lines = "Lines: 1" in output
|
|
words = "Words: 24" in output
|
|
chars = "Chars: 125" in output
|
|
|
|
if lines and words and chars:
|
|
print("PASS: All counts verified correct")
|
|
sys.exit(0)
|
|
else:
|
|
print(f"FAIL: Expected Lines: 1, Words: 24, Chars: 125")
|
|
print(f"Got: {output}")
|
|
sys.exit(1) |