- A renamed import (`use super::other::near as comparison;`) no longer
counts as a call with a path; an import that keeps the name still does.
- A bare call to a helper's name checks for a local binding in scope
(`let near = || {}; near();`), skipping type annotations, field labels
and path segments in patterns.
- Helpers passed in assertion failure messages no longer count as checks.
- A match-arm binding covers the arm's guard, and the arm's pattern stops
at the block of the arm before it.
- `#[ ignore = "..."]` with whitespace is read as an ignore attribute,
both for diagnostic tests and for ignore-without-reason.
- Literal ranges read `0x`, `0o` and `0b` bounds.
- A pin compares literal arguments (`r.items("active")` against
`r.items("archived")`), and does not count when a clone or borrow of the
source made before the snapshot is still alive.
- A function parameter named like a constant table is not the table.
An expression closure such as `|body: fn()| forward::<u8, u16>(body)`
ended at the comma inside the turbofish, so a parameter named like an
asserting helper stopped shadowing it at that comma. The closure body
now skips a turbofish whole.
A count or emptiness getter on a pinned snapshot (`let _ = got.len();`)
keeps the pin; only a read of the receiver itself that is bound or
passed to a call may hand out an alias.
no-assertion:
- A call in a top-level test reaches the helper its own file defines. A
non-asserting helper of the same name in another file of the crate no
longer hides it. Names the file also calls with a path, and
definitions below the file's top level, keep the crate's verdict.
- An `#[ignore = "reason"]` test that prints is a diagnostic and needs
no assertion.
- An asserting function passed by name as a value
(`keeping_settings(the_body)`, `run(&[body])`) counts as the test's
check, also through a helper that passes it, unless a local binding,
loop pattern, match arm or parameter shadows the name in scope, or the
value is dropped (`drop(body)`, `let _ = Some(body)`, `(body,);`).
all-unguarded:
- A parenthesized range of literals or constants, `(0..3).all(...)`.
- A receiver whose source an earlier `assert_eq!` compares with a
non-empty literal: a local collected from the receiver, or the call
the receiver is bound to, when nothing changes the source in between.
A shared borrow passed to a call outside an assertion may change it.
- A call to a function of the file that lists every row of a non-empty
constant table without filtering it; every function of that name in
the file has to do so.
hebrew_marks_stay_with_base_clusters asserts exact glyph start offsets,
which depend on the face that shapes the word. It now skips, as the
sibling font-dependent tests do, when no installed face covers shin,
lamed, vav and final mem.
hebrew_marks_stay_with_base_clusters now calls assert_source_coverage, so
glyphs that start at the four letters but leave the marks out of their
source ranges fail the test.
`presets()` leaves out a name that `preset` does not know, so the test
now compares its length with `PRESET_NAMES` and checks that list holds 15
names, in place of a fixed count of 15 resolved presets.
Panel tests that could pass on an empty list, that only checked a control was
there, or that looped over every language or preset now check the result:
- Character, Glyphs and OpenType: the underline, kashida, size, Up/Down, glyph
form and Proportional Metrics checks compare the text each setting reaches
(for example "AB" underlined, then none) instead of `all()` over the runs,
which passed when a frame had no runs.
- Actions: the built-in actions play on a selection and each makes an undo
step, instead of only looking up their command ids.
- Color Wheel: Show Out-of-Gamut Colors is checked by what the wheel and the
box draw with it on and off. The test that loaded a profile and only checked
the box was shown is removed, and two copies of the junk-parameter test are
removed (the one in tests_color_wheel_vision.rs runs with and without a
document). The error-translation tests check German and Japanese instead of
every catalog.
- History and Paragraph: the name and Mojikumi checks use a few languages
instead of every catalog, and the Numbered List presets are checked by one
style instead of every number style.
- Graphic Styles, Stroke and Swatches: the rename, profile preview and row
menu checks count what they read before checking each item.
- Image Trace: the off-thread trace test waits on the trace's own channel
through a new test-only `trace_runs::finish_all`, instead of polling with a
sleep for up to 30 seconds.
Assertions that ran all() over a list that could be empty now check the
list's length first: mesh points, image inks, glyph origins, imported
text, the PDF mesh and arrowhead paths, and the resampled CMYK pixels.
An image that takes a Warp from its art style is checked to keep none of
the look's fills and strokes, instead of checking each of none.
The convolve-matrix tests check that the filtered rectangle is imported,
not only that the import returned Ok. The fan-out clip path test moves
to a unit test that counts the clip paths read. The self-nesting symbol
test checks that the other symbol comes back. The EPS level and preview
id test checks the param values and the trimming and case rules instead
of looping over every value. The ignored PDF text-heavy timing run says
why it is ignored.
A gradient that repeats or reflects with no stops now paints as one
that pads. Before, PDF export wrote it as two 160 by 160 images and EPS
wrote three runs of a conic where one that pads writes one;
`Gradient::is_spread` is false without stops. `paint.setFill`'s params
still report the spread.
Tests whose all() passed on an empty list now check the list's length or
that it is not empty:
- huge_circles_bridge_with_finite_anchors_or_are_refused (pathops bridge)
- smooth_rounds_corners (pathops ops): the four corners stay, smoothed
- a_held_rotation_turns_the_art_around_its_pin (tools ARAP): one point
per mesh vertex
- the_eraser_drag_area_matches_the_release_when_pressure_or_a_mode_starts_during_the_drag
(tools gesture): one released point per press
- every_effect_casts_a_shadow, inflate_cells_across_a_hole_edge_are_cut_to_the_shape,
a_plane_has_only_a_front_and_a_hollow_solid_none and
perspective_runs_0_to_160_degrees_with_the_eye_outside_the_object (three-d)
- a_file_two_branches_include_is_followed_from_the_shallower_one
(scriptcheck): one row per include line
- pens_pick_colors_and_widths (cad HP-GL): four widths
- junk_pressure_brushes_draw_finite_art (brush): all 12 cases draw
Round trips that hold by construction (parse finds the id in ALL) are
replaced with one saved name that must parse and one that must not:
follow_names_parse (pathops shared edge), the shape kinds (pathops
shapes), surfaces_parse_from_their_ids (three-d), the Quick Pen actions
(tools), names_parse_and_serialize_as_names (plugins) and the brush
variation modes, which also compare the serde names with the ids.
crop_keeps_an_instance_whose_art_reaches_the_region (cad) names the
entities written instead of checking that some were.
the_saved_engine_preference_is_found (app) pins the GPU choices the
preferences offer to the three the app reads.
timing_unite_1000_circles (pathops) gets an ignore reason and checks
that Unite gives one shape.
Each changed assertion fails when the code under test is broken (an id
renamed, a list emptied, a flush or instance dropped) and passes when it
is restored.
A scrubbed field or a canvas drag moves the revision while the sections
are not measured. When the release itself left the revision unchanged,
the panel skipped the measurement and kept the sizes from before the
drag. The edit now stays pending until a frame runs without a drag or
an open undo group.
Weak tests in vectorcraft-render and vectorcraft-trace now assert the
behavior they name:
- The stroke glow test checks that the glow is drawn and that four
threads draw what one does, instead of only rendering.
- The JPEG and palette id tests name saved ids and labels directly
(gray, optimized, none, blackWhite), unknown and empty ids, instead
of looping over every value and reading its own id back.
- The trace presets test drops the loop over every preset name, which
presets().len() already covers, and checks the [Default] and padded
name lookups by their result.
- Nested discs each get the disc below them as parent, checked exactly.
- A 20 degree bend gets no corner under a 30 degree minimum turn, and
gets one under a 10 degree minimum.
- The gray BMP, reduced CMYK and tiled image tests check the size of
what they read, and the long stroke tests check that one outline was
made before checking that none is cropped.
- The three drag timing probes assert that the frame after the drag is
what a fresh renderer draws, in place of printing two hashes.
Tests in vectorcraft-text and vectorcraft-doc that could pass on an empty
result, or that only checked a result exists, now assert the values:
- Blend: gradient steps assert their stop count before checking each
stop's swatch, tint and plates; the odd dash blended to solid asserts
the whole pattern; a copied step asserts its members.
- Symbols: limiting depth keeps every symbol; a stroke override on type
keeps the run it styles.
- File fonts: an extreme descent clamps to the lowest table value and
the Windows descent still fits.
- Invert wrap on a tangled shape asserts the line still meets it.
- Bidi, ligature carets, Thai and whitespace fallback: the glyph and
line counts are asserted, Hebrew points stay in their letters'
clusters, and every character of an isolate test has a glyph.
- Glyph categories, trace views, compound shape modes and digit
systems check written-out ids instead of a round trip over every
value.
Removed joins_on_a_circle_are_measured, which printed measurements and
asserted nothing, and chord_placement_leaves_the_join_gap_above_the_baseline,
which checked arithmetic done in the test itself;
joined_glyphs_meet_on_a_curved_path covers joined type on a curve.
Parse tests in the color crate looped over every id or label and parsed
it back. Blend modes, policies, harmony rules, recolor methods and WCAG
categories parse by looking the text up in that same table, so those
loops could not fail. They now parse representative ids, labels and
spellings, and the edge cases: "Color" next to "Color Burn", empty
text, and a label where only ids parse.
- default_swatches_parse read swatch.rs as text. It now checks the
built swatches: no two solid swatches share a color (a bad hex
literal falls back to black), and the Sunset and Ocean stops equal
the swatches their literals name.
- loads_system_cmyk_icc ran only on macOS and returned early without
the system profile. loads_icc_files_and_refuses_bad_ones runs on every
native target: a missing file is an I/O error naming the path, a file
that is not a profile is refused, and a built-in profile's bytes are
refused for their name.
- the_other_libraries_keep_classic_mixing_and_centered_midpoints is
removed: those libraries are built with Gradient::new's defaults.
- pixel_timings and bench_catalog_lookup are removed. They were ignored
and only printed timings.
- Checks over lists that can be empty now also check the count:
reverse and move keep every stop, a conic draws its 4 wedges, each
harmony gives at least two colors, the fit leaves patches out, the
wireframe draws edges, a flat warp keeps its anchors, a gradient
stroke has slices, and fitted dashes on a curve are drawn.
- the_effects_are_colour_adjustments_in_their_own_menu checks one
add-on effect and one effect outside it instead of every entry.
svg_type_shifted_two_billion_points_exports_to_pdf now checks that the
SVG import keeps the type's shift of more than 2,000,000,000 pt, and that
the exported PDF leaves the type out, read back with the PDF importer.
Before, it checked only that the export returned Ok, so an import that
dropped or clamped the shift made it pass without reaching the bound.
a_long_thin_shape_with_a_shadow_renders_and_exports now checks that the
Affinity import gives exactly one shape with a drop shadow, more than
3,000,000 pt wide, before it renders and exports it. Before, an import
that dropped the shadow made it pass without drawing one.
The other 66 test-lint hits in import_fuzz.rs are property tests whose
claim is that hostile input loads, renders and exports without a panic.
Their helpers (survive, survive_library and the others) fail the case
through TestCaseError, which the no-assertion rule does not count.
- Changed mode builds the base's target-root routes from the base tree,
so a deleted tests/<root>.rs still counts as loading tests/common/mod.rs.
- A base test is matched by its name, its inline modules and its place
among same-named tests in them, so removing `mod a` does not let
`a::t` hide a newly off `b::t`.
- reads-source looks through grouping around the read path and names a
file only from a complete literal, a format!/concat! call or
Path::new/PathBuf::from; `"data.json".trim_end_matches(".rs")` no
longer counts as a .rs file.
- mirror keys keep a raw literal whole up to its own delimiter, and a
key must be one complete string literal.
- for, if let, while let, let and match patterns keep word boundaries
(`mut n` binds `n`), and a struct pattern's braces are not taken as
the loop or if-let body.
- #[path] and cfg_attr path values accept raw string literals.
- never-run in changed mode lints the file as it was at the base and
matches a test by its name and its place among tests of that name, so
a test that was already off is not counted again when lines move.
- A file reached by name inherits only the gates of named declarations,
and one reached through #[path] only those of #[path] declarations.
- The changed-file walk also reads the base child declarations of a
#[path]-loaded file, so a removed `mod child;` still reaches the child.
- reads-source classifies the outer path step, not a join nested in its
argument.
- mirror treats complete raw string literals as keys.
- A raw cfg value keeps the quotes inside it (r#""unix""# is not unix).
- census keeps word boundaries, so `k as usize` reads `k` and the local
`kasusize` does not.
- fixture-only finds a for loop's `in` across line breaks.
The Properties panel measured all of its sections before showing them
whenever the document's revision changed. A Selection tool drag changes
the revision on every pointer move, so each frame of the drag ran the
whole panel twice. On a blank document with one rectangle, a drag frame
ran 396 components where a hover frame ran 170.
The revision is now kept apart from the selection, tool and isolation
key. While a canvas drag or a scrubbed field is in progress, a new
revision alone does not measure the sections; the edit is measured once
when the drag ends. A drag frame now runs 168 components and each frame
still takes one pass.