Module Simantics/Testing

This module is undocumented. This is a list of its definitions.

exportModel :: Resource -> String -> String -> Integer -> <ReadGraph> ()

exportModel model fileName format version writes the given model into the named file as a transferable graph of the given format and format version.

genericParameterTypeContentDump :: Resource -> <ReadGraph> Vector Byte

Returns a dump of the given component type property as UTF-8 bytes: its type, default value, unit if it has one, label, and description if it has one, separated by spaces.

graphFileContentDump :: Resource -> <ReadGraph> Vector Byte

Returns the file data of the given graph file resource as it is stored, with no conversion.

pgraphContentDump :: Resource -> <ReadGraph> Vector Byte

Returns the definition of the given pgraph resource as UTF-8 bytes.

sclModuleContentDump :: Resource -> <ReadGraph> Vector Byte

Returns the definition of the given SCL module resource as UTF-8 bytes. The content dump functions of this module give a resource a byte presentation that a test can compare against a previously recorded one.

sclScriptContentDump :: Resource -> <ReadGraph> Vector Byte

Returns the definition of the given SCL script resource as UTF-8 bytes.

structuralComponentContentDump :: Resource -> <ReadGraph> Vector Byte

Returns a dump of the given structural component as UTF-8 bytes: the URIs of its principal types, and then its properties in alphabetical order, each with its display value and, for a connection relation, the relative RVIs of the connection points it reaches.

structuralComponentTypeContentDump :: Resource -> <ReadGraph> Vector Byte

As structuralComponentContentDump but for a component type, so that the procedural code of the type and the SCL scripts attached to it are appended to the dump, the scripts in alphabetical order.

withinEpsilon :: Double -> Double -> Double -> String

withinEpsilon value reference epsilon returns "True" when value differs from reference by less than epsilon, and otherwise a message naming the three numbers. The result is a string rather than a truth value so that a failing comparison explains itself in the test output.