feat(compat): sweep of components against the real core with strict diagnostics
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
# Smoke HTTP del paquete id. Recibe BASE, PKG, RESULTS.
|
||||
set -u
|
||||
|
||||
check() {
|
||||
local comp="$1" path="$2" expect="$3" body
|
||||
if ! body="$(curl -fsS "$BASE$path" 2>/dev/null)"; then
|
||||
echo "$PKG:$comp|fail" >> "$RESULTS"; return
|
||||
fi
|
||||
if printf '%s' "$body" | grep -qF "$expect"; then
|
||||
echo "$PKG:$comp|ok" >> "$RESULTS"
|
||||
else
|
||||
echo " inesperado en $path: $(printf '%s' "$body" | head -c 200)" >&2
|
||||
echo "$PKG:$comp|fail" >> "$RESULTS"
|
||||
fi
|
||||
}
|
||||
|
||||
check ulid /compat/id/ulid 'ULID_OK'
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
// Router de compatibilidad del paquete id.
|
||||
|
||||
use Libs\Router;
|
||||
use Libs\Ulid;
|
||||
|
||||
Router::get('/compat/id/ulid', function () {
|
||||
$a = Ulid::generate();
|
||||
$b = Ulid::generate();
|
||||
$ok = strlen($a) === 26 && Ulid::validate($a) && !Ulid::validate(str_repeat('0', 25)) && $a !== $b;
|
||||
echo $ok ? 'ULID_OK' : 'ULID_FAIL';
|
||||
});
|
||||
Reference in New Issue
Block a user