/* ----------------------------------------------------------------------------- Copyright 2021 Kevin P. Barry Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ----------------------------------------------------------------------------- */ // Author: Kevin P. Barry [ta0kira@gmail.com] $TestsOnly$ // General lib/util helpers for use in unit tests. concrete UtilTesting { // Check the value for an ErrorOr error. Crashes if it is not an error. // // Args: // - ErrorOr: Actual value. @type checkError (ErrorOr) -> () // Check the values for equality. Crashes if they are not equal. // // Args: // - ErrorOr<#x>: Actual value. // - #x: Expected value. @type checkSuccess<#x> #x requires Formatted #x defines Equals<#x> (ErrorOr<#x>,#x) -> () // Check that the value is within a range. Crashes if it is not in the range. // // Args: // - ErrorOr<#x>: Actual value. // - #x: Lower bound. // - #x: Upper bound. @type checkSuccessBetween<#x> #x requires Formatted #x defines Equals<#x> #x defines LessThan<#x> (ErrorOr<#x>,#x,#x) -> () }