caraya icon indicating copy to clipboard operation
caraya copied to clipboard

Assert Almost Equal does not work for Arrays

Open neilpate opened this issue 1 year ago • 2 comments

All the other comparison operations support an array input, but the Amost Equal does not.

image

neilpate avatar Feb 23 '24 12:02 neilpate

@neilpate I'm not terribly fond of adding more polymorphic VIs to account for all the use cases.

However, there are a couple things you can do to create nice reusable addons to Caraya Assert methods. Here is an example for handling an array of inputs, while not using Variant inputs (and all the shenanigans that would be needed to ensure the inputs are actually "almost comparable". The technique allows you to wrap all the methods if you want, including changing formats or using classes/interfaces.

image

AssertAlmostEqualArray example.zip

francois-normandin avatar Mar 02 '24 17:03 francois-normandin

Thanks @francois-normandin

I can completely believe what a pain managing all the polymorphic VIs is. In 20 years of LV dev I never mustered up the enthusiasm to create a single one!

I changed my test to not need this API, just thought I would mention it for completeness.

neilpate avatar Mar 04 '24 15:03 neilpate