Skip to content

Latest commit

 

History

History
112 lines (94 loc) · 5.7 KB

File metadata and controls

112 lines (94 loc) · 5.7 KB

Rich Ruby: Test Report

This document showcases the results of the final test verification for the Rich Ruby library.

Environment

  • Ruby: 3.4.8 (MSVC)
  • Platform: Windows 10 (64-bit)
  • Date: December 23, 2025

1. Functional Test Suite

The functional test suite covers core components: Color, Style, Text, Markup, Console, Box, Table, Trees, Progress, Syntax, Markdown, and JSON.

Command:

ruby -W0 -Ilib -Itest -e "require './test/test_helper'; Dir['test/test_*.rb'].each { |f| require File.expand_path(f) }"

Results:

Run options: --seed 29775

# Running:

.......................................................................................
───────────────────────────────── Title ───────────────────────────────────────────────
...Hello
..................................................................................................

Finished in 0.041029s, 4582.0690 runs/s, 8432.9568 assertions/s.

188 runs, 346 assertions, 0 failures, 0 errors, 0 skips

2. Performance & Stress Test Suite

The stress test suite validates the library under heavy load and deep nesting conditions.

Command:

ruby -W0 -Ilib examples/stress_test.rb

Results:

======================================================================
Rich Library Stress Test Suite
======================================================================

  Parse all 256 ANSI color names                    ... ✓ PASS (0.000s)
  Parse 10,000 random hex colors                    ... ✓ PASS (0.042s)
  Color downgrade from truecolor to 256             ... ✓ PASS (0.004s)
  Color downgrade from truecolor to 16              ... ✓ PASS (0.014s)
  ColorTriplet HSL roundtrip                        ... ✓ PASS (0.000s)
  Color parse caching performance                   ... ✓ PASS (0.125s)
  Parse complex style definitions                   ... ✓ PASS (0.000s)
  Style combination chain (1000 styles)             ... ✓ PASS (0.008s)
  Style attribute bitmask integrity                 ... ✓ PASS (0.000s)
  Style render with all attributes                  ... ✓ PASS (0.000s)
  CJK character width calculation                   ... ✓ PASS (0.001s)
  Zero-width combining characters                   ... ✓ PASS (0.000s)
  Mixed ASCII and Unicode                           ... ✓ PASS (0.001s)
  Large Unicode string (10KB)                       ... ✓ PASS (0.315s)
  Empty and whitespace strings                      ... ✓ PASS (0.000s)
  Segment split at every position                   ... ✓ PASS (0.002s)
  Segment line splitting with many newlines         ... ✓ PASS (0.000s)
  Segment simplification (1000 segments)            ... ✓ PASS (0.001s)
  Segment rendering with control codes              ... ✓ PASS (0.000s)
  Text with 1000 overlapping spans                  ... ✓ PASS (0.053s)
  Deeply nested markup                              ... ✓ PASS (0.000s)
  Markup validation with errors                     ... ✓ PASS (0.000s)
  Text wrapping at various widths                   ... ✓ PASS (0.120s)
  Text with special characters                      ... ✓ PASS (0.000s)
  Panel with very long content                      ... ✓ PASS (0.061s)
  Panel with Unicode borders and content            ... ✓ PASS (0.001s)
  Table with 100 rows                               ... ✓ PASS (0.088s)
  Table with Unicode content                        ... ✓ PASS (0.003s)
  Tree with deep nesting (10 levels)                ... ✓ PASS (0.000s)
  Tree with many siblings (100)                     ... ✓ PASS (0.000s)
  All box styles render correctly                   ... ✓ PASS (0.002s)
  Progress bar at every percentage                  ... ✓ PASS (0.000s)
  Progress bar with very large total                ... ✓ PASS (0.000s)
  Spinner cycles through all frames                 ... ✓ PASS (0.004s)
  Multiple spinner styles                           ... ✓ PASS (0.000s)
  JSON with deeply nested structure                 ... ✓ PASS (0.002s)
  JSON with large array                             ... ✓ PASS (0.017s)
  JSON with special characters                      ... ✓ PASS (0.000s)
  Pretty print complex Ruby object                  ... ✓ PASS (0.001s)
  Console size detection                            ... ✓ PASS (0.000s)
  Console options update                            ... ✓ PASS (0.000s)
  Control codes generate valid ANSI                 ... ✓ PASS (0.000s)
  ANSI stripping                                    ... ✓ PASS (0.000s)
  Windows Console API functions available           ... ✓ PASS (0.000s)
  Windows ANSI support detection                    ... ✓ PASS (0.000s)
  Windows console size valid                        ... ✓ PASS (0.000s)
  Empty inputs handled gracefully                   ... ✓ PASS (0.000s)
  Nil inputs handled gracefully                     ... ✓ PASS (0.000s)
  Very long single-line content                     ... ✓ PASS (0.000s)
  Content at exact width boundary                   ... ✓ PASS (0.002s)
  Zero and negative values                          ... ✓ PASS (0.000s)

======================================================================
Results: 51/51 tests passed in 0.87s
======================================================================

3. Transparency & Stability

The recent repairs to the Syntax lexers specifically addressed infinite loop scenarios, ensuring that even large or malformed code blocks are processed efficiently. The library remains a zero-dependency, pure Ruby implementation optimized for the modern terminal.