chromium/third_party/dawn/src/tint/lang/wgsl/reader/parser/error_msg_test.cc

// Copyright 2020 The Dawn & Tint Authors
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
//    list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its
//    contributors may be used to endorse or promote products derived from
//    this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "src/tint/lang/wgsl/reader/parser/helper_test.h"

#include "src/tint/utils/text/string_stream.h"

namespace tint::wgsl::reader {
namespace {

const diag::Formatter::Style formatter_style{};

class ParserImplErrorTest : public WGSLParserTest {};

#define EXPECT(SOURCE, EXPECTED)

TEST_F(ParserImplErrorTest, AdditiveInvalidExpr) {}

TEST_F(ParserImplErrorTest, AndInvalidExpr) {}

TEST_F(ParserImplErrorTest, AliasDeclInvalidAttribute) {}

TEST_F(ParserImplErrorTest, ConstAttributeInvalid) {}

TEST_F(ParserImplErrorTest, IndexExprInvalidExpr) {}

TEST_F(ParserImplErrorTest, IndexExprMissingRBracket) {}

TEST_F(ParserImplErrorTest, AssignmentStmtMissingAssignment) {}

TEST_F(ParserImplErrorTest, AssignmentStmtMissingAssignment2) {}

TEST_F(ParserImplErrorTest, AssignmentStmtMissingSemicolon) {}

TEST_F(ParserImplErrorTest, AssignmentStmtInvalidLHS_BuiltinFunctionName) {}

TEST_F(ParserImplErrorTest, AssignmentStmtInvalidRHS) {}

TEST_F(ParserImplErrorTest, BreakStmtMissingSemicolon) {}

TEST_F(ParserImplErrorTest, CallExprMissingRParen) {}

TEST_F(ParserImplErrorTest, CallStmtArgsTreatedAsTemplateLHS) {}

TEST_F(ParserImplErrorTest, CallStmtArgsTreatedAsTemplateRHS) {}

TEST_F(ParserImplErrorTest, CallStmtMissingRParen) {}

TEST_F(ParserImplErrorTest, CallStmtInvalidArgument0) {}

TEST_F(ParserImplErrorTest, CallStmtInvalidArgument1) {}

TEST_F(ParserImplErrorTest, CallStmtMissingSemicolon) {}

TEST_F(ParserImplErrorTest, InitializerExprMissingLParen) {}

TEST_F(ParserImplErrorTest, InitializerExprMissingRParen) {}

TEST_F(ParserImplErrorTest, ConstVarStmtInvalid) {}

TEST_F(ParserImplErrorTest, ConstVarStmtMissingAssignment) {}

TEST_F(ParserImplErrorTest, ConstVarStmtMissingInitializer) {}

TEST_F(ParserImplErrorTest, ContinueStmtMissingSemicolon) {}

TEST_F(ParserImplErrorTest, DiscardStmtMissingSemicolon) {}

TEST_F(ParserImplErrorTest, EqualityInvalidExpr) {}

TEST_F(ParserImplErrorTest, ForLoopInitializerMissingSemicolon) {}

TEST_F(ParserImplErrorTest, ForLoopInitializerMissingVar) {}

TEST_F(ParserImplErrorTest, ForLoopConditionMissingSemicolon) {}

TEST_F(ParserImplErrorTest, ForLoopMissingLParen) {}

TEST_F(ParserImplErrorTest, ForLoopMissingRParen) {}

TEST_F(ParserImplErrorTest, ForLoopMissingLBrace) {}

TEST_F(ParserImplErrorTest, ForLoopMissingRBrace) {}

TEST_F(ParserImplErrorTest, FunctionDeclConstAssertMissingCondThenEOF) {}

TEST_F(ParserImplErrorTest, FunctionDeclConstAssertMissingCondThenSemicolon) {}

TEST_F(ParserImplErrorTest, FunctionDeclConstAssertMissingCondThenLet) {}

TEST_F(ParserImplErrorTest, FunctionDeclConstAssertMissingLParen) {}

TEST_F(ParserImplErrorTest, FunctionDeclConstAssertMissingRParen) {}

TEST_F(ParserImplErrorTest, FunctionDeclConstAssertMissingSemicolon) {}

TEST_F(ParserImplErrorTest, FunctionDeclWorkgroupSizeXInvalid) {}

TEST_F(ParserImplErrorTest, FunctionDeclWorkgroupSizeYInvalid) {}

TEST_F(ParserImplErrorTest, FunctionDeclWorkgroupSizeZInvalid) {}

TEST_F(ParserImplErrorTest, FunctionDeclMissingIdentifier) {}

TEST_F(ParserImplErrorTest, FunctionDeclMissingLParen) {}

TEST_F(ParserImplErrorTest, FunctionDeclMissingRParen) {}

TEST_F(ParserImplErrorTest, FunctionDeclMissingArrow) {}

TEST_F(ParserImplErrorTest, FunctionDeclInvalidReturnType) {}

TEST_F(ParserImplErrorTest, FunctionDeclParamMissingColon) {}

TEST_F(ParserImplErrorTest, FunctionDeclParamInvalidType) {}

TEST_F(ParserImplErrorTest, FunctionDeclParamMissing) {}

TEST_F(ParserImplErrorTest, FunctionDeclMissingLBrace) {}

TEST_F(ParserImplErrorTest, FunctionDeclMissingRBrace) {}

TEST_F(ParserImplErrorTest, FunctionScopeUnusedDecl) {}

TEST_F(ParserImplErrorTest, FunctionMissingOpenLine) {}

TEST_F(ParserImplErrorTest, GlobalDeclConstInvalidIdentifier) {}

TEST_F(ParserImplErrorTest, GlobalDeclConstMissingSemicolon) {}

TEST_F(ParserImplErrorTest, GlobalDeclConstMissingRParen) {}

TEST_F(ParserImplErrorTest, GlobalDeclConstBadConstLiteral) {}

TEST_F(ParserImplErrorTest, GlobalDeclConstExprMaxDepth) {}

TEST_F(ParserImplErrorTest, GlobalDeclConstExprMissingLParen) {}

TEST_F(ParserImplErrorTest, GlobalDeclConstExprMissingRParen) {}

TEST_F(ParserImplErrorTest, GlobalDeclLet) {}

TEST_F(ParserImplErrorTest, GlobalDeclInvalidAttribute) {}

TEST_F(ParserImplErrorTest, GlobalDeclSampledTextureMissingGreaterThan) {}

TEST_F(ParserImplErrorTest, GlobalDeclMultisampledTextureMissingGreaterThan) {}

TEST_F(ParserImplErrorTest, GlobalDeclConstAssertMissingCondThenEOF) {}

TEST_F(ParserImplErrorTest, GlobalDeclConstAssertMissingCondThenSemicolon) {}

TEST_F(ParserImplErrorTest, GlobalDeclConstAssertMissingCondThenAlias) {}

TEST_F(ParserImplErrorTest, GlobalDeclConstAssertMissingLParen) {}

TEST_F(ParserImplErrorTest, GlobalDeclConstAssertMissingRParen) {}

TEST_F(ParserImplErrorTest, GlobalDeclConstAssertMissingSemicolon) {}

TEST_F(ParserImplErrorTest, GlobalDeclStorageTextureMissingGreaterThan) {}

TEST_F(ParserImplErrorTest, GlobalDeclStorageTextureMissingSubtype) {}

TEST_F(ParserImplErrorTest, GlobalDeclStructDeclMissingIdentifier) {}

TEST_F(ParserImplErrorTest, GlobalDeclStructDeclMissingLBrace) {}

TEST_F(ParserImplErrorTest, GlobalDeclStructDeclMissingRBrace) {}

TEST_F(ParserImplErrorTest, GlobalDeclStructMemberInvalidIdentifier) {}

TEST_F(ParserImplErrorTest, GlobalDeclStructMemberAlignInvaldValue) {}

TEST_F(ParserImplErrorTest, GlobalDeclStructMemberSizeInvaldValue) {}

TEST_F(ParserImplErrorTest, GlobalDeclTypeAliasMissingIdentifier) {}

TEST_F(ParserImplErrorTest, GlobalDeclTypeAliasInvalidType) {}

TEST_F(ParserImplErrorTest, GlobalDeclTypeAliasMissingAssignment) {}

TEST_F(ParserImplErrorTest, GlobalDeclTypeAliasMissingSemicolon) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarArrayMissingGreaterThan) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarArrayInvalidSize) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarAttrListMissingAt) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarAttrLocationMissingLParen) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarAttrLocationMissingRParen) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarAttrLocationInvalidValue) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarAttrIdMissingLParen) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarAttrIdMissingRParen) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarAttrIdInvalidValue) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarAttrBuiltinMissingLParen) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarAttrBuiltinMissingRParen) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarAttrBindingMissingLParen) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarAttrBindingMissingRParen) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarAttrBindingInvalidValue) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarAttrGroupMissingLParen) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarAttrGroupMissingRParen) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarAttrBindingGroupValue) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarInvalidIdentifier) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarMatrixMissingGreaterThan) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarMissingSemicolon) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarPtrMissingGreaterThan) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarStorageDeclMissingGThan) {}

TEST_F(ParserImplErrorTest, GlobalDeclVarVectorMissingGreaterThan) {}

TEST_F(ParserImplErrorTest, IfStmtMissingRParen) {}

TEST_F(ParserImplErrorTest, IfStmtInvalidCond) {}

TEST_F(ParserImplErrorTest, LogicalAndInvalidExpr) {}

TEST_F(ParserImplErrorTest, LogicalOrInvalidExpr) {}

TEST_F(ParserImplErrorTest, LoopMissingLBrace) {}

TEST_F(ParserImplErrorTest, LoopMissingRBrace) {}

TEST_F(ParserImplErrorTest, MaxErrorsReached) {}

TEST_F(ParserImplErrorTest, MemberExprMissingIdentifier) {}

TEST_F(ParserImplErrorTest, MultiplicativeInvalidExpr) {}

TEST_F(ParserImplErrorTest, OrInvalidExpr) {}

TEST_F(ParserImplErrorTest, PostfixIncrementAsExpr) {}

TEST_F(ParserImplErrorTest, RelationalInvalidExpr) {}

TEST_F(ParserImplErrorTest, ReturnStmtMissingSemicolon) {}

TEST_F(ParserImplErrorTest, ShiftInvalidExpr) {}

TEST_F(ParserImplErrorTest, SwitchStmtMissingLBrace) {}

TEST_F(ParserImplErrorTest, SwitchStmtMissingRBrace) {}

TEST_F(ParserImplErrorTest, SwitchStmtInvalidCase) {}

TEST_F(ParserImplErrorTest, SwitchStmtCaseMissingLBrace) {}

TEST_F(ParserImplErrorTest, SwitchStmtCaseMissingRBrace) {}

TEST_F(ParserImplErrorTest, VarStmtMissingSemicolon) {}

TEST_F(ParserImplErrorTest, VarStmtInvalidAssignment) {}

TEST_F(ParserImplErrorTest, UnaryInvalidExpr) {}

TEST_F(ParserImplErrorTest, UnexpectedToken) {}

TEST_F(ParserImplErrorTest, XorInvalidExpr) {}

TEST_F(ParserImplErrorTest, InvalidUTF8) {}

TEST_F(ParserImplErrorTest, Bug_Chromium_1417465) {}

}  // namespace
}  // namespace tint::wgsl::reader