Add a FatalUserError macro to help print user-caused errors. (#668)

This commit is contained in:
Jon Meow
2021-07-21 12:38:56 -07:00
committed by GitHub
parent f3cbfc04c6
commit 034f3600e3
15 changed files with 102 additions and 26 deletions
@@ -0,0 +1,15 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "executable_semantics/common/error.h"
#include "gtest/gtest.h"
namespace Carbon {
TEST(ErrorTest, FatalUserError) {
ASSERT_DEATH({ FatalUserError() << "test"; }, "ERROR: test\n");
}
} // namespace Carbon