chromium/third_party/angle/src/tests/preprocessor_tests/identifier_test.cpp

//
// Copyright 2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

#include <tuple>

#include "PreprocessorTest.h"
#include "compiler/preprocessor/Token.h"

namespace angle
{

#define CLOSED_RANGE(x, y)

class IdentifierTest : public SimplePreprocessorTest
{};

class SingleLetterIdentifierTest : public IdentifierTest, public testing::WithParamInterface<char>
{};

// This test covers identifier names of form [_a-zA-Z].
TEST_P(SingleLetterIdentifierTest, Identified)
{}

// Test string: '_'
INSTANTIATE_TEST_SUITE_P();

// Test string: [a-z]
INSTANTIATE_TEST_SUITE_P();

// Test string: [A-Z]
INSTANTIATE_TEST_SUITE_P();

IdentifierParams;
class DoubleLetterIdentifierTest : public IdentifierTest,
                                   public testing::WithParamInterface<IdentifierParams>
{};

// This test covers identifier names of form [_a-zA-Z][_a-zA-Z0-9].
TEST_P(DoubleLetterIdentifierTest, Identified)
{}

// Test string: "__"
INSTANTIATE_TEST_SUITE_P();

// Test string: "_"[a-z]
INSTANTIATE_TEST_SUITE_P();

// Test string: "_"[A-Z]
INSTANTIATE_TEST_SUITE_P();

// Test string: "_"[0-9]
INSTANTIATE_TEST_SUITE_P();

// Test string: [a-z]"_"
INSTANTIATE_TEST_SUITE_P();

// Test string: [a-z][a-z]
INSTANTIATE_TEST_SUITE_P();

// Test string: [a-z][A-Z]
INSTANTIATE_TEST_SUITE_P();

// Test string: [a-z][0-9]
INSTANTIATE_TEST_SUITE_P();

// Test string: [A-Z]"_"
INSTANTIATE_TEST_SUITE_P();

// Test string: [A-Z][a-z]
INSTANTIATE_TEST_SUITE_P();

// Test string: [A-Z][A-Z]
INSTANTIATE_TEST_SUITE_P();

// Test string: [A-Z][0-9]
INSTANTIATE_TEST_SUITE_P();

// The tests above cover one-letter and various combinations of two-letter
// identifier names. This test covers all characters in a single string.
TEST_F(IdentifierTest, AllLetters)
{}

}  // namespace angle