merge: issue/0023-testing-utils — Go testing utilities

# Conflicts:
#	registry.db
This commit is contained in:
2026-04-13 02:06:03 +02:00
30 changed files with 1545 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
---
name: test_db
lang: go
domain: core
version: "1.0.0"
algebraic: product
definition: |
type TestDB struct {
DB *sql.DB
Path string
Cleanup func()
}
description: "Base de datos SQLite de test con puntero al DB abierto, path (vacio para :memory:) y funcion de cleanup para cerrar conexiones al finalizar el test."
tags: [testing, database, sqlite, test_helper]
uses_types: []
file_path: "functions/core/test_db.go"
---
## Notas
Tipo producto — todos los campos siempre presentes. Retornado por `test_db_setup_go_core`.
Path es `:memory:` para bases de datos en memoria.
Cleanup se registra automaticamente en t.Cleanup() al crear el DB.
+22
View File
@@ -0,0 +1,22 @@
---
name: test_server
lang: go
domain: core
version: "1.0.0"
algebraic: product
definition: |
type TestServer struct {
URL string
Client *http.Client
Cleanup func()
}
description: "Servidor HTTP de test con URL base, cliente preconfigurado y funcion de cleanup para liberar recursos al finalizar el test."
tags: [testing, http, server, test_helper]
uses_types: []
file_path: "functions/core/test_server.go"
---
## Notas
Tipo producto — todos los campos siempre presentes. Retornado por `test_http_server_go_core`.
Cleanup se registra automaticamente en t.Cleanup() al crear el servidor.