blob: 88e87ca8424f8b970c6c33381cb7cb1ed8ec4af7 [file] [log] [blame]
# Copyright 2022 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test the cpp module."""
import pytest
from chromite.format.formatters import cpp
# None means input is already formatted to avoid having to repeat.
@pytest.mark.parametrize(
"data,exp",
(
("", None),
("int main() {}", None),
("int main(){return 0;}", "int main() { return 0; }"),
),
)
def test_check_format(data, exp) -> None:
"""Verify inputs match expected outputs."""
if exp is None:
exp = data
assert exp == cpp.Data(data)