Commit Graph
1 Commits
Author SHA1 Message Date
dotCooCoo 52b917fce5 craft-testkit: guards read Rust tokens, check hex and f16 floats, and bound rust_sources
predefined_quit and std_instant now run on a small Rust lexer instead of
a masked line search:

- Character and byte literals such as '"' no longer open a phantom
  string that hides the code after them.
- A Quit call split by tabs or a line break around :: is reported, a
  different name such as MyPredefinedMenuItem or quitter is not, and a
  use muda::PredefinedMenuItem as X rename is followed.
- std_instant reports std::time::Instant, <m>::Instant where a use binds
  m to std::time, and each use that imports std::time::Instant or
  std::time::*. A line that also names web_time is still reported, and
  an unrelated time::Instant is not.
- cfg attributes are read from code, not from strings or comments, and
  evaluated for wasm32-unknown-unknown (all, any, not, unix, windows,
  target_* keys). An outer attribute covers the item after it, an inner
  one the rest of its module. A predicate that depends on a feature or
  test is checked.

wgsl_float_literals skips integer literals, reports hexadecimal floats
above f32::MAX, and checks an h-suffixed float against 65504.

rust_sources does not follow symbolic links, skips folders that hold a
CACHEDIR.TAG file, no longer drops every file when the root itself is
under a folder named tests, and returns an error for a file over 8 MiB,
more than 256 MiB in all or more than 50,000 files.
rust_sources_with_limits takes other limits.

The tests use a scratch folder that is never reused and is removed when
a test panics. The crate is not published, and the root README lists
it.
2026-11-14 11:16:07 -08:00