diff --git a/CHANGELOG.md b/CHANGELOG.md index 308f268..b95761a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Cambios notables de la librería Dart. El proyecto usa versionado semántico; mi ## Especificación 0.11, en la rama `v0.11` — sin versión +### El gate con Node.js (05-10-2026) + +- `tool/check.sh` corre también `dart test -p node`: las pruebas que no leen ficheros, compiladas a JavaScript, comprueban en cada commit que los enteros son exactos en la web. Lo decidió el autor. + ### Etapa 1: errores, bytes, CBOR y DER (05-10-2026) - **Errores normativos (§69).** `ErrorCode` con los 19 códigos en el orden del spec y `DateKeysException`, con el mensaje `contexto: CÓDIGO` de Go. `wrap` y `withContext` hacen lo que `fmt.Errorf("prefijo: %w")`, y `errorCode` lo que `datekeys.Code`. Una prueba compara el catálogo con las líneas `ERR_` del §69, leído de `datekeys-go` en el tag `spec-v0.11`. diff --git a/README.md b/README.md index 9ea8a3a..3c64023 100644 --- a/README.md +++ b/README.md @@ -67,16 +67,9 @@ tool/check.sh - el formato; - `dart analyze --fatal-infos`; - `dart test`; +- `dart test -p node`: las pruebas que no leen ficheros corren también compiladas a JavaScript, en Node.js, para comprobar que los enteros son exactos en la web. Las que leen ficheros llevan `@TestOn('vm')`. Por eso el gate necesita Node.js, como `datekeys-ts`; lo decidió el autor el 5 de octubre de 2026; - la copia de `testdata/` frente al repositorio de Go, que debe estar al lado, en `../datekeys-go`. -Las pruebas que no leen ficheros corren también compiladas a JavaScript, en Node.js. Así se comprueba que los enteros son exactos en la web. No forman parte del gate: - -```bash -dart test -p node -``` - -Las que leen ficheros llevan `@TestOn('vm')`. - ## Datos de prueba `testdata/` es una copia de `datekeys-go/testdata` en un commit fijo. `testdata/SOURCE.json` registra el commit y el SHA-256 de cada fichero, igual que en `datekeys-ts`. La copia actual es la del tag `spec-v0.11` (`ae33434`). diff --git a/tool/check.sh b/tool/check.sh index 8146259..47e7b0d 100755 --- a/tool/check.sh +++ b/tool/check.sh @@ -1,7 +1,8 @@ #!/usr/bin/env bash # Local gate of datekeys-dart, as scripts/check.sh of datekeys-go and npm run -# verify of datekeys-ts: format, analysis, tests, and the copy of testdata/ -# against the Go repository next to this one. Run it before every commit. +# verify of datekeys-ts: format, analysis, tests on the VM and compiled to +# JavaScript, and the copy of testdata/ against the Go repository next to this +# one. Run it before every commit. It needs Node.js, as datekeys-ts does. # # tool/check.sh set -euo pipefail @@ -16,6 +17,12 @@ dart analyze --fatal-infos echo "== dart test" dart test +# The integers of the library must be exact on the web too, where an int is +# a double and the bit operators work on 32 bits: the tests that read no file +# run again compiled to JavaScript (the others are @TestOn('vm')). +echo "== dart test -p node" +dart test -p node + echo "== testdata against datekeys-go" dart run tool/sync_testdata.dart check --against ../datekeys-go