chromium/third_party/angle/src/tests/preprocessor_tests/space_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
{

class SpaceTest : public PreprocessorTest
{};

// Whitespace characters allowed in GLSL.
// Note that newline characters (\n) will be tested separately.
static const char kSpaceChars[] =;

// This test fixture tests the processing of a single whitespace character.
// All tests in this fixture are ran with all possible whitespace character
// allowed in GLSL.
class SpaceCharTest : public SpaceTest, public testing::WithParamInterface<char>
{};

TEST_P(SpaceCharTest, SpaceIgnored)
{}

INSTANTIATE_TEST_SUITE_P();

// This test fixture tests the processing of a string containing consecutive
// whitespace characters. All tests in this fixture are ran with all possible
// combinations of whitespace characters allowed in GLSL.
SpaceStringParams;
class SpaceStringTest : public SpaceTest, public testing::WithParamInterface<SpaceStringParams>
{};

TEST_P(SpaceStringTest, SpaceIgnored)
{}

INSTANTIATE_TEST_SUITE_P();

// The tests above make sure that the space char is recorded in the
// next token. This test makes sure that a token is not incorrectly marked
// to have leading space.
TEST_F(SpaceTest, LeadingSpace)
{}

}  // namespace angle