Ejemplo
Measure custom validators and composite option types in NimbleOptions 1.1.1
sha256:bf574f199498ebc024cf6e9bdea360f62321db0b50dba14496f956334bbf700f
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidencia de ejecución
Separamos el entorno declarado de las ejecuciones firmadas para mostrar qué se demostró.
Base de evidenciaContrato firmado aprobado
Recibos de verificación1
Nivel de verificaciónL3_CONTRACT_PASS
Entorno declarado
- Contexto de ejecución
- elixir 1
- Sistema operativo
- linux
- Arquitectura
- x64
- Runtime
- elixir 1
- Lenguaje
- elixir
- Gestor de paquetes
- mix
Entornos de las ejecuciones de verificación
- Contexto de ejecución
- elixir 1
- Sistema operativo
- linux alpine · musl
- Arquitectura
- x64
- Runtime
- elixir 1
- Lenguaje
- elixir
- Gestor de paquetes
- mix
- Ejecución
- container · docker
CONTAINER_RUN · compile:PASS · contract:PASS · load:PASS · resolve:PASS · hex@1 · 2026-08-17
Caso
- Objetivo
- Measure custom validators and composite option types in NimbleOptions 1.1.1 HOW
- Paquetes
-
nimble_options 1.1.1
- Entorno
- elixir 1
- Creado
- 2026-08-17T04:44:18Z
Lo que suele suponerse
A NimbleOptions custom validator can be an anonymous function that returns a boolean and receives its value after any configured arguments.
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- assert a custom validator uses an MFA 4-tuple, receives the option value first, returns {:ok, transformed} or {:error, message}, and can replace the validated value
- assert an anonymous-function custom type is rejected while a custom MFA returning a boolean raises RuntimeError
- assert {:or, types} accepts either branch, reports both alternative failures, and retains a transformation from a successful custom branch
- assert typed lists validate and transform every element and report a failing zero-based position
- assert :mfa, :mod_arg, positional tuple, and typed map schemas enforce their measured shapes and error locations
- assert docs with nest_level 1 starts its option list with two spaces
Archivos
- NOTES.md
- csx.json
- lib/custom_options.ex
- mix.exs
- mix.lock
- test/contract_test.exs
- test/test_helper.exs
Descargar el artefacto de código fuente (tar.gz)
Seeder de origen
csx-seed
Recibos de verificación
- elixir 1 · linux alpine/x64 · docker · CONTAINER_RUN · compile:PASS · contract:PASS · load:PASS · resolve:PASS · hex@1 · 2026-08-17 · ed25519:d91480838ac982c9