Skip to content

Missing tests for some component new flags #2338

Open

Description

@catamorphism

I can't find any tests that exercise component new with the --realloc-via-memory-grow or --merge-imports-based-on-semver flags.

Context: I'm trying to write examples in the help text that illustrate various flags. My first step was to look for tests to see how they should be used.

Activity

  1. alexcrichton commented on Oct 7, 2025

    @alexcrichton
    Member

    I don't think that there are dedicated tests for these flags right now unfortunately. They are used to control the default behavior of how a component is created where, for example, by default cabi_realloc is used to allocate memory but --realloc-via-memory-grow says "don't do that and instead use memory.grow". Similarly for --merge-imports-based-on-semver that turns off on-by-default behavior. These were added over time to tweak the default heuristics which is why the aren't super well tested.

    The tests/cli directory has some files with --merge-world-imports-based-on-semver but none with --merge-world-imports-based-on-semver=false. The tests at crates/wit-component/tests/components test some various behaviors of reallocation but in general don't have a dedicated test for --realloc-via-memory-grow I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions