From 1fc00948dfca0a8a5080f24a459356b7ec884ea4 Mon Sep 17 00:00:00 2001 From: Drew Crawford Date: Tue, 18 Oct 2016 22:02:47 -0500 Subject: [PATCH] Add error tests See f0193f2078f94516ab1d097c2d1d7afdae72e528 --- tests/CoreTests/Errors.swift | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/CoreTests/Errors.swift diff --git a/tests/CoreTests/Errors.swift b/tests/CoreTests/Errors.swift new file mode 100644 index 0000000..799292b --- /dev/null +++ b/tests/CoreTests/Errors.swift @@ -0,0 +1,36 @@ +// Copyright (c) 2016 Drew Crawford. +// +// 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. + +import CarolineCore +class NoErrorCheck: CarolineTest { + func test() { + self.check { + print("got here") + } + } +} + +private struct MyError: Error { + +} + +class ErrorCheck: CarolineTest { + func test() { + self.check { + throw MyError() + } + } + var expectFailure: Bool { return true } +} + -- 2.22.0