Skip to content
Testaroo

Explore the test library

Find files, editable templates and browser test targets by what you need to make or test. The directory below is cut by format; the two collections under it cut the same library by subject and by workflow.

125 results

Page 4 of 6; 24 results per page.

Show the canonical directory
Preview of PHP: Hello World
php
69 B
Actual file preview for PHP: Hello World

PHP: Hello World

The classic hello-world in PHP (an opening tag and echo) for testing highlighters, the PHP interpreter, and parsers.

File
PHP · PHP
Preview of PHP: Invoice (enum, class, promoted properties)
php
1.1 KB
Actual file preview for PHP: Invoice (enum, class, promoted properties)

PHP: Invoice (enum, class, promoted properties)

A realistic modern-PHP snippet with strict types, a namespace, a backed enum, a final class with constructor-promoted readonly properties, and array_reduce with an arrow function, for testing highlighters, PHPStan, and parsers.

File
PHP · PHP
Preview of Python: Fibonacci (dataclass, generator, type hints)
py
1 KB
Actual file preview for Python: Fibonacci (dataclass, generator, type hints)

Python: Fibonacci (dataclass, generator, type hints)

A realistic Python snippet exercising type hints, an lru_cache-memoised recursive function, a generator, and a frozen dataclass, for testing syntax highlighters, linters (ruff/flake8), and formatters (black).

File
PY · Python
Preview of Python: Hello World
py
168 B
Actual file preview for Python: Hello World

Python: Hello World

The classic hello-world in idiomatic Python 3, with a shebang, a module docstring, and the standard main guard: the minimal correct program for testing highlighters and interpreters.

File
PY · Python
Preview of Ruby: Hello World
rb
59 B
Actual file preview for Ruby: Hello World

Ruby: Hello World

The classic hello-world in Ruby (a single puts) for testing highlighters, the Ruby interpreter, and parsers.

File
RB · Ruby
Preview of Ruby: Stack (Enumerable, blocks, custom error)
rb
658 B
Actual file preview for Ruby: Stack (Enumerable, blocks, custom error)

Ruby: Stack (Enumerable, blocks, custom error)

A realistic Ruby snippet: a Stack class that mixes in Enumerable, yields blocks, raises a custom error class, and uses string interpolation and symbol-to-proc, for testing highlighters, RuboCop, and parsers.

File
RB · Ruby
Preview of Rust: Hello World
rs
84 B
Actual file preview for Rust: Hello World

Rust: Hello World

The classic hello-world in Rust: fn main and the println! macro, for testing highlighters, rustc, and parsers.

File
RS · Rust