lean4-htt/src/lake/tests
Mario Carneiro 62cdb51ed5
feat: UTF-8 string validation (#3958)
Previously, there was a function `opaque fromUTF8Unchecked : ByteArray
-> String` which would convert a list of bytes into a string, but as the
name implies it does not validate that the string is UTF-8 before doing
so and as a result it produces unsound results in the compiler (because
the lean model of `String` indirectly asserts UTF-8 validity). This PR
replaces that function by
```lean
opaque validateUTF8 (a : @& ByteArray) : Bool

opaque fromUTF8 (a : @& ByteArray) (h : validateUTF8 a) : String
```
so that while the function is still "unchecked", we have a proof witness
that the string is valid. To recover the original, actually unchecked
version, use `lcProof` or other unsafe methods to produce the proof
witness.

Because this was the only `ByteArray -> String` conversion function, it
was used in several places in an unsound way (e.g. reading untrusted
input from IO and treating it as UTF-8). These have been replaced by
`fromUTF8?` or `fromUTF8!` as appropriate.
2024-04-20 18:36:37 +00:00
..
badImport feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
buildArgs feat: lake: GNU/BSD OS detection in test scripts (#3180) 2024-01-14 02:49:38 +00:00
clone feat: lake: GNU/BSD OS detection in test scripts (#3180) 2024-01-14 02:49:38 +00:00
depTree feat: lake: GNU/BSD OS detection in test scripts (#3180) 2024-01-14 02:49:38 +00:00
env feat: lake: LEAN_GITHASH override (#3609) 2024-03-08 15:03:07 +00:00
globs feat: lake: alternative TOML config (#3298) 2024-03-28 02:35:02 +00:00
init feat: lake: alternative TOML config (#3298) 2024-03-28 02:35:02 +00:00
lean feat: lake lean (#3793) 2024-03-29 22:54:31 +00:00
llvm-bitcode-gen chore: remove supportInterpreter from lake template (#2984) 2023-11-29 06:16:34 +00:00
lock feat: lake: GNU/BSD OS detection in test scripts (#3180) 2024-01-14 02:49:38 +00:00
manifest feat: lake: GNU/BSD OS detection in test scripts (#3180) 2024-01-14 02:49:38 +00:00
meta fix: lake: whitelist loaded config olean env exts 2023-11-17 13:50:14 -05:00
noBuild fix: do not dllexport symbols in core static libraries (#3601) 2024-03-15 11:58:34 +00:00
old chore: ignore forgotten Lake test artifacts 2023-11-17 21:25:41 -05:00
order refactor: reverse pkg/lib search & no exe roots in import (#2937) 2023-11-27 16:12:11 +00:00
postUpdate chore: update tests to account for .lake 2023-11-13 20:31:24 -05:00
precompileArgs chore: update tests to account for .lake 2023-11-13 20:31:24 -05:00
rebuild chore: update tests to account for .lake 2023-11-13 20:31:24 -05:00
serve feat: lake: GNU/BSD OS detection in test scripts (#3180) 2024-01-14 02:49:38 +00:00
test feat: lake test (#3779) 2024-03-29 03:19:46 +00:00
toml feat: UTF-8 string validation (#3958) 2024-04-20 18:36:37 +00:00
toolchain feat: lake: GNU/BSD OS detection in test scripts (#3180) 2024-01-14 02:49:38 +00:00
translateConfig feat: lake test (#3779) 2024-03-29 03:19:46 +00:00