โ† Back to Main Report

๐Ÿงช Unit Tests Report

Standalone unit tests that verify individual components without requiring a running server

Generated: 2026-03-31 16:05:36 UTC

Repository: curtcox/hashbin.org

Commit: 2c5b12de1e97947a2ba245ea27314a3b1fde00b0

Total Tests
2
Passed
2
Failed
0
Pass Rate
100.0%

Test Results

test-grep-patterns
test-grep-patterns.sh
โฑ๏ธ 0s PASSED

Test Output

========================================== Testing Grep Patterns for JSON Matching ========================================== Test 1: Formatted JSON with spaces ----------------------------------- Input: {"status": "healthy", "environment": "production"} โœ… PASS: Pattern matched formatted JSON Test 2: Compact JSON without spaces ----------------------------------- Input: {"status":"healthy","environment":"production"} โœ… PASS: Pattern matched compact JSON Test 3: Pretty-printed multi-line JSON --------------------------------------- Input: (multi-line JSON) โœ… PASS: Pattern matched pretty-printed JSON Test 4: Should NOT match unhealthy ----------------------------------- Input: {"status": "unhealthy", "environment": "production"} โœ… PASS: Correctly rejected unhealthy status Test 5: Should NOT match degraded ----------------------------------- Input: {"status": "degraded", "environment": "production"} โœ… PASS: Correctly rejected degraded status Test 6: Environment matching ----------------------------- Input: {"status": "healthy", "environment": "production"} Expected environment: production โœ… PASS: Environment pattern matched Test 7: Environment mismatch ----------------------------- Input: {"status": "healthy", "environment": "production"} Expected environment: development โœ… PASS: Correctly rejected environment mismatch ========================================== โœ… All tests passed! ========================================== The grep patterns now correctly handle: โ€ข Compact JSON: {"status":"healthy"} โ€ข Formatted JSON: {"status": "healthy"} โ€ข Pretty-printed JSON (multi-line) Pattern used: '"status"[[:space:]]*:[[:space:]]*"healthy"' This pattern matches optional whitespace around the colon. ==========================================
test-git-sha-injection
test-git-sha-injection.sh
โฑ๏ธ 0s PASSED

Test Output

========================================== Testing Git SHA Injection ========================================== ========================================== TEST: Inject SHA into HTML files ========================================== โœ… PASS: SHA injected after DOCTYPE in test1.html โœ… PASS: SHA injected at beginning in test2.html (no DOCTYPE) ========================================== TEST: Update existing SHA ========================================== โœ… PASS: SHA updated successfully in test1.html โœ… PASS: SHA updated successfully in test2.html ========================================== TEST: No duplicate SHA comments ========================================== โœ… PASS: Only one SHA comment in test1.html โœ… PASS: Only one SHA comment in test2.html ========================================== Test Summary ========================================== Total tests: 6 Passed: 6 Failed: 0 โœ… All git SHA injection tests passed!