feat(busca): pin-number queries in every language, pin answer card
CI / Lint e auditorias (push) Successful in 46s
CI / Trivy (dependências e segredos) (push) Successful in 10s
CI / Imagem Docker (linux/arm64) (push) Successful in 3m50s
Release / Plano (reaproveitar a imagem?) (push) Successful in 5s
Release / ci (push) Skipped
Release / Publica a imagem (linux/arm64) (push) Successful in 23s
Release / Cria a release no Gitea (push) Successful in 5s
CI / Lint e auditorias (push) Successful in 46s
CI / Trivy (dependências e segredos) (push) Successful in 10s
CI / Imagem Docker (linux/arm64) (push) Successful in 3m50s
Release / Plano (reaproveitar a imagem?) (push) Successful in 5s
Release / ci (push) Skipped
Release / Publica a imagem (linux/arm64) (push) Successful in 23s
Release / Cria a release no Gitea (push) Successful in 5s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fe1802f818
commit
71c5708726
5 files changed
+208
-15
No files matched your search
@@ -59,5 +59,49 @@ for (const loc of idiomas) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Consulta por pino físico: "pino 32 esp32-s3" traz o cartão do pino 32, com nome, funções e avisos.
|
||||
const comoDizer = {
|
||||
pt: ["pino 32 esp32-s3", "pino 32", "pino 999 s3"],
|
||||
en: ["pin 32 esp32-s3", "pin 32", "pin 999 s3"],
|
||||
es: ["pin 32 esp32-s3", "pin 32", "pin 999 s3"],
|
||||
fr: ["broche 32 esp32-s3", "broche 32", "broche 999 s3"],
|
||||
de: ["pin 32 esp32-s3", "pin 32", "pin 999 s3"],
|
||||
"zh-CN": ["esp32-s3 32号引脚", "引脚 32", "s3 999号引脚"],
|
||||
};
|
||||
for (const loc of idiomas) {
|
||||
const res = await fetch(`${base}/api/busca/${loc}`);
|
||||
if (!res.ok) continue;
|
||||
const indice = preparar(await res.json());
|
||||
const [comChip, semChip, inexistente] = comoDizer[loc];
|
||||
const a = buscar(indice, comChip);
|
||||
const cartao = a.resultados.find((r) => r.tipo === "resposta" && r.linhas?.[0]?.v === "32");
|
||||
if (!cartao || !cartao.linhas.some((l) => l.k && l.v) || cartao.linhas.length < 3) {
|
||||
console.log(`FALHOU [${loc}] "${comChip}": sem cartão do pino 32`);
|
||||
falhas++;
|
||||
} else if (!cartao.href.startsWith(`/${loc}/`)) {
|
||||
console.log(`FALHOU [${loc}] "${comChip}": link fora do idioma: ${cartao.href}`);
|
||||
falhas++;
|
||||
}
|
||||
if (!a.interpretacao.pinos?.length) {
|
||||
console.log(`FALHOU [${loc}] "${comChip}": o pino não aparece em "entendi"`);
|
||||
falhas++;
|
||||
}
|
||||
const b = buscar(indice, semChip);
|
||||
const geral = b.resultados.find((r) => r.tipo === "resposta" && (r.linhas?.length ?? 0) >= 8);
|
||||
if (!geral) {
|
||||
console.log(`FALHOU [${loc}] "${semChip}": sem o quadro "pino 32 em cada série"`);
|
||||
falhas++;
|
||||
}
|
||||
const c = buscar(indice, inexistente);
|
||||
if (!c.resultados.some((r) => r.tipo === "pino" && r.titulo.includes("999"))) {
|
||||
console.log(`FALHOU [${loc}] "${inexistente}": sem aviso de pino inexistente`);
|
||||
falhas++;
|
||||
}
|
||||
if (loc !== "pt") {
|
||||
for (const r of [...a.resultados, ...b.resultados, ...c.resultados]) {
|
||||
for (const s of strings(r)) if (SO_PT.test(s)) { console.log(`FALHOU [${loc}]: português em "${s.slice(0, 80)}"`); falhas++; }
|
||||
}
|
||||
}
|
||||
}
|
||||
if (falhas === 0) console.log(` ✔ Busca: respostas e links corretos em ${idiomas.join(", ")}.`);
|
||||
process.exit(falhas > 0 ? 1 : 0);
|
||||
Reference in new issue
Block a user