From c380ee22066a6fb55546a26b074bb103623c6f81 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Sat, 20 Aug 2022 08:11:20 +0200 Subject: [PATCH] toStringResult for easy testing --- .../src/rescript/ForTS/ForTS_SquiggleValue.res | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/squiggle-lang/src/rescript/ForTS/ForTS_SquiggleValue.res b/packages/squiggle-lang/src/rescript/ForTS/ForTS_SquiggleValue.res index 12a73d64..893c50b3 100644 --- a/packages/squiggle-lang/src/rescript/ForTS/ForTS_SquiggleValue.res +++ b/packages/squiggle-lang/src/rescript/ForTS/ForTS_SquiggleValue.res @@ -79,6 +79,12 @@ let getTag = (variant: squiggleValue) => let toString = (variant: squiggleValue) => ReducerInterface_InternalExpressionValue.toString(variant) +// This is a useful method for unit tests. +// Convert the result along with the error message to a string. +@genType +let toStringResult = (variantResult: result_) => + ReducerInterface_InternalExpressionValue.toStringResult(variantResult) + @genType let getArray = (variant: squiggleValue): option => //FIXME: Convert