/* ----------------------------------------------------------------------------- Copyright 2023 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$ // NOTE: You must specify TestChecker in order to use this. // // testcase "my testcase" { // success TestChecker // } concrete Matches { // Fails immediately if match fails. @category with<#x> (optional #x, ValueMatcher<#x>) -> () // Fails later if match fails. @category tryWith<#x> (optional #x, ValueMatcher<#x>) -> () // Fails immediately if match fails. @category value<#x> #x requires TestCompare<#x> (optional #x, #x) -> () // Fails later if match fails. @category tryValue<#x> #x requires TestCompare<#x> (optional #x, #x) -> () } // Unconditional outcomes regardless of the actual value. concrete CheckAlways { // Unconditionally match. @category match () -> (ValueMatcher) // Unconditional error. @category error (Formatted) -> (ValueMatcher) // Immediate crash if the matcher is used to check a value. @category die (Formatted) -> (ValueMatcher) }