Hello Mahmoud,
Thank you very much for sharing your `simpletests` prototype! It was truly inspiring and gave us fantastic ideas for enhancing RingTest.
I am glad to let you know that I have officially integrated and expanded all these key concepts into RingTest (v1.2.0):
What's New in RingTest 1.2.0:
1. Extended Assertions & Matchers: Added comprehensive matchers including `.toBeNull()`, `.toBeNotNull()`, `.toBeString()`, `.toBeNumber()`, `.toBeList()`, `.toBeObject()`, `.toBeCloseTo()`, `.toBeGreaterThanOrEqual()`, `.toBeLessThanOrEqual()`, `.toStartWith()`, `.toEndWith()`, `.toBeSorted()`, `.toThrowError()`, and Mock Spies (`.toHaveBeenCalled()`, `.toHaveBeenCalledTimes()`).
2. Parameterized / Data-Driven Testing: Added `itEach` / `testEach` to run tests over datasets with automatic description formatting (`%1`, `%2`...).
3. Test Lifecycle & Skipping: Added `itSkip`, `itTodo`, `itFailing` / `itXFail` (expected failures), and `suite.skipAll()`.
4. Benchmarking & High-Precision Timing: Added `benchmark(name, iters, func)` and `benchmarkCompare(...)` to measure ops/sec and speedup factors, with automatic integration with AlQalam's `QalamChronos` for C++ hardware nanosecond precision timekeeping.
5. Enhanced Reporting: Skipped tests and precise timing (nanoseconds/microseconds) are now fully reflected across the terminal CLI, interactive dark-mode HTML reports (`--html`), and standard CI/CD JUnit XML (`--junit`).
Thank you again for your constant support and valuable insights!
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
C:\ring\tools\ringpm\packages\ringtest
λ ringtest
RUNS C:/ring/tools/ringpm/packages/ringtest/tests/advanced_features_test.ring
Advanced Framework Features Suite
[PASS] runs normal tests properly (< 1 ms)
[SKIP] demonstrates skipped test case (work in progress)
[SKIP] demonstrates todo test case (todo)
[PASS] demonstrates expected failure (xfail) (< 1 ms)
[PASS] calculates addition 1 + 2 = 3 (1 ms)
[PASS] calculates addition 10 + 20 = 30 (< 1 ms)
[PASS] calculates addition 5 + 5 = 10 (< 1 ms)
[PASS] validates non-empty fruits: apple (< 1 ms)
[PASS] validates non-empty fruits: banana (< 1 ms)
[PASS] validates non-empty fruits: cherry (< 1 ms)
RUNS C:/ring/tools/ringpm/packages/ringtest/tests/benchmark_test.ring
Benchmark Integration Suite
⚡ BENCHMARK: String Concatenation (100 iterations)
Total: 1 ms Avg: 10 µs 100000 ops/sec
[PASS] measures execution of single benchmark (1 ms)
[PASS] measures time with chronos / TestTimer API (1 ms)
RUNS C:/ring/tools/ringpm/packages/ringtest/tests/context_test.ring
Context Suite
[PASS] stores and reads back a string (< 1 ms)
[PASS] keeps values across tests (< 1 ms)
[PASS] overwrites an existing key (< 1 ms)
[PASS] increments a counter numerically (< 1 ms)
[PASS] adds an arbitrary step (< 1 ms)
RUNS C:/ring/tools/ringpm/packages/ringtest/tests/diagnostic_demo_test.ring
Diagnostic & Rich Error Reporting Demo
[PASS] should show clean diff comparison on mismatch (< 1 ms)
[PASS] should trigger R19 diagnostic tip on less parameters (< 1 ms)
[PASS] should trigger R24 diagnostic tip on uninitialized variable (< 1 ms)
RUNS C:/ring/tools/ringpm/packages/ringtest/tests/error_test.ring
Exception Handling Suite
[PASS] should detect division by zero exception (< 1 ms)
[PASS] should detect custom raised errors (1 ms)
[PASS] should detect syntax errors in eval (< 1 ms)
RUNS C:/ring/tools/ringpm/packages/ringtest/tests/extended_assertions_test.ring
Extended Matchers & Assertions Suite
[PASS] verifies toBeNull and toBeNotNull (< 1 ms)
[PASS] verifies type checking matchers (toBeString, toBeNumber, toBeList, toBeObject)
(< 1 ms)
[PASS] verifies boundary comparisons (toBeGreaterThanOrEqual, toBeLessThanOrEqual) (<
1 ms)
[PASS] verifies floating point approximation (toBeCloseTo) (< 1 ms)
[PASS] verifies string prefix and suffix matchers (toStartWith, toEndWith) (< 1 ms)
[PASS] verifies sorted list assertion (toBeSorted) (1 ms)
[PASS] verifies exception assertions (toThrowError, notToThrow) (< 1 ms)
[PASS] verifies mock spy assertions (toHaveBeenCalled, toHaveBeenCalledTimes) (< 1 ms
)
RUNS C:/ring/tools/ringpm/packages/ringtest/tests/hooks_test.ring
Hooks Suite - Lifecycle Hooks
[PASS] should execute beforeAll exactly once before any test (1 ms)
[PASS] should execute beforeEach on subsequent tests (< 1 ms)
[PASS] should have accumulated afterEach calls after third test (< 1 ms)
RUNS C:/ring/tools/ringpm/packages/ringtest/tests/math_test.ring
Math Operations Suite
[PASS] should calculate addition and subtraction correctly (< 1 ms)
[PASS] should handle multiplication and division (< 1 ms)
[PASS] should validate numerical boundaries (< 1 ms)
[PASS] should verify toBeBetween with math operations (< 1 ms)
RUNS C:/ring/tools/ringpm/packages/ringtest/tests/mock_test.ring
Mock Suite
[PASS] registers a mock and reports it as called (1 ms)
[PASS] counts calls (< 1 ms)
[PASS] returns the registered mock by name (< 1 ms)
[PASS] restores a single mock (< 1 ms)
[PASS] restores all mocks (< 1 ms)
RUNS C:/ring/tools/ringpm/packages/ringtest/tests/sample_test.ring
Basic Assertions Suite
[PASS] should verify strict equality and comparisons (1 ms)
[PASS] should check boolean truthiness and falsiness (< 1 ms)
[PASS] should verify lists and deep equality (< 1 ms)
[PASS] should verify string substring matching (< 1 ms)
[PASS] should verify toBeBetween assertion (< 1 ms)
[PASS] should verify toMatch assertion (< 1 ms)
[PASS] should verify toBeEmpty assertion (< 1 ms)
[PASS] should verify toHaveLength assertion (< 1 ms)
RUNS C:/ring/tools/ringpm/packages/ringtest/tests/string_test.ring
String Utilities Suite
[PASS] should concatenate strings correctly (< 1 ms)
[PASS] should verify string length and content (< 1 ms)
[PASS] should verify truthiness for empty and non-empty strings (< 1 ms)
[PASS] should verify toMatch with string patterns (< 1 ms)
[PASS] should verify toHaveLength with strings (< 1 ms)
--------------------------------------------------
Test Suites: 11 passed, 11 total
Tests: 2 skipped, 54 passed, 56 total
Time: 1.93 s
--------------------------------------------------
STATUS: ALL TESTS PASSED!
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Best regards,
Azzeddine