Skip to content

Add unit tests for dispatch optimisation #448

@alexdewar

Description

@alexdewar

When we added the code for the dispatch optimisation, we didn't add unit tests, partly because of time constraints but also because it's not obvious exactly what the best way to write tests for the optimisation code is. It would be nice, for example, to check that under condition X, constraints Y will be added. This would be dead easy in Python -- you could just mock all the functions -- but sadly this is an inherently harder problem with statically typed languages.

I see two ways we could approach this:

  1. Read e.g. row values back out of the highs::RowProblem -- although this part of the C API is not wrapped by the Rust crate yet, so we'd probably have to add it
  2. Write a mock solver, either manually or with help from a library (mockall seems to be popular, though I've not used it)

I'm leaning towards the second, because it gels nicely with #447 -- we'd need to write traits for solver code for that anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🔖 Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions